From ca7877a49daa636e2a800f5f1824de336d5a194a Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Sun, 29 Sep 2024 19:15:54 -0700 Subject: [PATCH] buildFlutterApplication: prevent conflicting app directories --- .../build-support/build-flutter-application.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix index ff6c6b31006f..ae89d3720b33 100644 --- a/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix +++ b/pkgs/development/compilers/flutter/build-support/build-flutter-application.nix @@ -146,21 +146,22 @@ let built=build/linux/*/$flutterMode/bundle mkdir -p $out/bin - mv $built $out/app + mkdir -p $out/app + mv $built $out/app/$pname - for f in $(find $out/app -iname "*.desktop" -type f); do + for f in $(find $out/app/$pname -iname "*.desktop" -type f); do install -D $f $out/share/applications/$(basename $f) done - for f in $(find $out/app -maxdepth 1 -type f); do + for f in $(find $out/app/$pname -maxdepth 1 -type f); do ln -s $f $out/bin/$(basename $f) done # make *.so executable - find $out/app -iname "*.so" -type f -exec chmod +x {} + + find $out/app/$pname -iname "*.so" -type f -exec chmod +x {} + # remove stuff like /build/source/packages/ubuntu_desktop_installer/linux/flutter/ephemeral - for f in $(find $out/app -executable -type f); do + for f in $(find $out/app/$pname -executable -type f); do if patchelf --print-rpath "$f" | grep /build; then # this ignores static libs (e,g. libapp.so) also echo "strip RPath of $f" newrp=$(patchelf --print-rpath $f | sed -r "s|/build.*ephemeral:||g" | sed -r "s|/build.*profile:||g")