From 4a2735dfd54561bdc278852fcb65d5ebed790f38 Mon Sep 17 00:00:00 2001 From: Steffen Beyer Date: Sat, 31 May 2025 16:54:39 +0200 Subject: [PATCH] androidenv: emulator: nixfmt emulator.nix --- .../mobile/androidenv/emulator.nix | 69 ++++++++++--------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/pkgs/development/mobile/androidenv/emulator.nix b/pkgs/development/mobile/androidenv/emulator.nix index 473a9d1d1c06..afb7634e36f5 100644 --- a/pkgs/development/mobile/androidenv/emulator.nix +++ b/pkgs/development/mobile/androidenv/emulator.nix @@ -57,45 +57,46 @@ deployAndroidPackage { libxshmfence ]) ++ lib.optional (os == "linux" && stdenv.isx86_64) pkgsi686Linux.glibc; - 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 + 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 - # 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 + # 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 - for file in $out/libexec/android-sdk/emulator/lib64/vulkan/libvulkan_lvp.so; do - patchelf --replace-needed libLLVM-15.so.1 libLLVM-15.so "$file" || true - done + for file in $out/libexec/android-sdk/emulator/lib64/vulkan/libvulkan_lvp.so; do + patchelf --replace-needed libLLVM-15.so.1 libLLVM-15.so "$file" || true + done - autoPatchelf $out + 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 - '') - + '' - 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 + # 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 + '') + + '' + 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} - ''; + cd $out/libexec/android-sdk + ${postInstall} + ''; dontMoveLib64 = true; inherit meta;