mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 13:03:34 +00:00
b0663a3dc3
This is supposed to fix an issue caused by this PR: https://github.com/NixOS/nixpkgs/pull/163924 Which made `autoPatchelfHook` available only on Linux, resulting in builds of Android packages failing with: ``` error: Package ‘auto-patchelf-hook’ in /nix/store/...-nixpkgs-source/pkgs/build-support/trivial-builders.nix:73 is not supported on ‘x86_64-darwin’, refusing to evaluate. ``` Signed-off-by: Jakub Sokołowski <jakub@status.im>
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ deployAndroidPackage, lib, package, os, autoPatchelfHook, makeWrapper, pkgs, pkgs_i686 }:
|
|
|
|
deployAndroidPackage {
|
|
inherit package os;
|
|
buildInputs = [ makeWrapper ]
|
|
++ lib.optionals (os == "linux") (with pkgs; [
|
|
autoPatchelfHook
|
|
glibc
|
|
libcxx
|
|
libGL
|
|
libpulseaudio
|
|
libuuid
|
|
zlib
|
|
ncurses5
|
|
stdenv.cc.cc
|
|
i686.glibc
|
|
expat
|
|
freetype
|
|
nss
|
|
nspr
|
|
alsa-lib
|
|
]) ++ (with pkgs.xorg; [
|
|
libX11
|
|
libXext
|
|
libXdamage
|
|
libXfixes
|
|
libxcb
|
|
libXcomposite
|
|
libXcursor
|
|
libXi
|
|
libXrender
|
|
libXtst
|
|
]);
|
|
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
|
|
autoPatchelf $out
|
|
|
|
# Wrap emulator so that it can load required libraries at runtime
|
|
wrapProgram $out/libexec/android-sdk/emulator/emulator \
|
|
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
|
pkgs.dbus
|
|
pkgs.systemd
|
|
]} \
|
|
--set QT_XKB_CONFIG_ROOT ${pkgs.xkeyboard_config}/share/X11/xkb \
|
|
--set QTCOMPOSE ${pkgs.xorg.libX11.out}/share/X11/locale
|
|
'';
|
|
dontMoveLib64 = true;
|
|
}
|