2020-04-24 23:36:52 +00:00
|
|
|
{deployAndroidPackage, lib, package, autoPatchelfHook, makeWrapper, os, pkgs, pkgs_i686, postInstall ? ""}:
|
|
|
|
|
|
|
|
deployAndroidPackage {
|
|
|
|
name = "androidsdk";
|
|
|
|
inherit os package;
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ lib.optionals (os == "linux") [ autoPatchelfHook ];
|
|
|
|
buildInputs = lib.optional (os == "linux") (
|
|
|
|
(with pkgs; [ glibc freetype fontconfig fontconfig.lib])
|
2022-06-16 17:23:12 +00:00
|
|
|
++ (with pkgs.xorg; [ libX11 libXrender libXext ])
|
|
|
|
++ (with pkgs_i686; [ glibc xorg.libX11 xorg.libXrender xorg.libXext fontconfig.lib freetype zlib ])
|
|
|
|
);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
patchInstructions = ''
|
|
|
|
${lib.optionalString (os == "linux") ''
|
|
|
|
# Auto patch all binaries
|
|
|
|
autoPatchelf .
|
|
|
|
''}
|
|
|
|
|
|
|
|
# Wrap all scripts that require JAVA_HOME
|
|
|
|
for i in bin
|
|
|
|
do
|
|
|
|
find $i -maxdepth 1 -type f -executable | while read program
|
|
|
|
do
|
|
|
|
if grep -q "JAVA_HOME" $program
|
|
|
|
then
|
|
|
|
wrapProgram $PWD/$program --prefix PATH : ${pkgs.jdk8}/bin
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
# Wrap monitor script
|
|
|
|
wrapProgram $PWD/monitor \
|
|
|
|
--prefix PATH : ${pkgs.jdk8}/bin \
|
2021-03-19 17:17:44 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ pkgs.xorg.libX11 pkgs.xorg.libXtst ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Patch all script shebangs
|
|
|
|
patchShebangs .
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
${postInstall}
|
|
|
|
'';
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
meta.license = lib.licenses.unfree;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|