2023-02-02 18:25:31 +00:00
|
|
|
{ deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, pkgsi686Linux, postInstall }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
deployAndroidPackage {
|
|
|
|
inherit package os;
|
2022-09-09 14:08:57 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ lib.optionals (os == "linux") [ autoPatchelfHook ];
|
|
|
|
buildInputs = lib.optionals (os == "linux") (with pkgs; [
|
2022-06-16 17:23:12 +00:00
|
|
|
glibc
|
|
|
|
libcxx
|
|
|
|
libGL
|
|
|
|
libpulseaudio
|
2024-04-21 15:54:59 +00:00
|
|
|
libtiff
|
2022-06-16 17:23:12 +00:00
|
|
|
libuuid
|
|
|
|
zlib
|
2024-04-21 15:54:59 +00:00
|
|
|
libbsd
|
2022-06-16 17:23:12 +00:00
|
|
|
ncurses5
|
2024-04-21 15:54:59 +00:00
|
|
|
libdrm
|
2022-06-16 17:23:12 +00:00
|
|
|
stdenv.cc.cc
|
2022-12-17 10:02:37 +00:00
|
|
|
pkgsi686Linux.glibc
|
2022-06-16 17:23:12 +00:00
|
|
|
expat
|
|
|
|
freetype
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
alsa-lib
|
|
|
|
]) ++ (with pkgs.xorg; [
|
|
|
|
libX11
|
|
|
|
libXext
|
|
|
|
libXdamage
|
|
|
|
libXfixes
|
|
|
|
libxcb
|
|
|
|
libXcomposite
|
|
|
|
libXcursor
|
|
|
|
libXi
|
|
|
|
libXrender
|
|
|
|
libXtst
|
2024-04-21 15:54:59 +00:00
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
libxkbfile
|
2022-06-16 17:23:12 +00:00
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
patchInstructions = lib.optionalString (os == "linux") ''
|
|
|
|
addAutoPatchelfSearchPath $packageBaseDir/lib
|
|
|
|
addAutoPatchelfSearchPath $packageBaseDir/lib64
|
|
|
|
addAutoPatchelfSearchPath $packageBaseDir/lib64/qt/lib
|
|
|
|
# autoPatchelf is not detecting libuuid :(
|
|
|
|
addAutoPatchelfSearchPath ${pkgs.libuuid.out}/lib
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# This library is linked against a version of libtiff that nixpkgs doesn't have
|
|
|
|
for file in $out/libexec/android-sdk/emulator/*/qt/plugins/imageformats/libqtiffAndroidEmu.so; do
|
|
|
|
patchelf --replace-needed libtiff.so.5 libtiff.so "$file" || true
|
|
|
|
done
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
autoPatchelf $out
|
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
# Wrap emulator so that it can load required libraries at runtime
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/libexec/android-sdk/emulator/emulator \
|
2021-02-05 17:12:51 +00:00
|
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
2020-06-02 18:00:15 +00:00
|
|
|
pkgs.dbus
|
|
|
|
pkgs.systemd
|
|
|
|
]} \
|
2020-04-24 23:36:52 +00:00
|
|
|
--set QT_XKB_CONFIG_ROOT ${pkgs.xkeyboard_config}/share/X11/xkb \
|
|
|
|
--set QTCOMPOSE ${pkgs.xorg.libX11.out}/share/X11/locale
|
2023-02-02 18:25:31 +00:00
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cd $out/bin
|
|
|
|
find $out/libexec/android-sdk/emulator -type f -executable -mindepth 1 -maxdepth 1 | while read i; do
|
|
|
|
ln -s $i
|
|
|
|
done
|
|
|
|
|
|
|
|
cd $out/libexec/android-sdk
|
|
|
|
${postInstall}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
dontMoveLib64 = true;
|
|
|
|
}
|