buildFlutterApplication: prevent conflicting app directories (#345404)
This commit is contained in:
@@ -43,21 +43,21 @@ flutter324.buildFlutterApplication rec {
|
||||
|
||||
postInstall = ''
|
||||
# Swap the authenticator-helper symlink with the correct symlink.
|
||||
ln -fs "${passthru.helper}/bin/authenticator-helper" "$out/app/helper/authenticator-helper"
|
||||
ln -fs "${passthru.helper}/bin/authenticator-helper" "$out/app/$pname/helper/authenticator-helper"
|
||||
|
||||
# Move the icon.
|
||||
mkdir $out/share/icons
|
||||
mv $out/app/linux_support/com.yubico.yubioath.png $out/share/icons
|
||||
mv $out/app/$pname/linux_support/com.yubico.yubioath.png $out/share/icons
|
||||
|
||||
# Cleanup.
|
||||
rm -rf \
|
||||
"$out/app/README.adoc" \
|
||||
"$out/app/desktop_integration.sh" \
|
||||
"$out/app/linux_support" \
|
||||
"$out/app/$pname/README.adoc" \
|
||||
"$out/app/$pname/desktop_integration.sh" \
|
||||
"$out/app/$pname/linux_support" \
|
||||
$out/bin/* # We will repopulate this directory later.
|
||||
|
||||
# Symlink binary.
|
||||
ln -sf "$out/app/authenticator" "$out/bin/yubioath-flutter"
|
||||
ln -sf "$out/app/$pname/authenticator" "$out/bin/yubioath-flutter"
|
||||
|
||||
# Set the correct path to the binary in desktop file.
|
||||
substituteInPlace "$out/share/applications/com.yubico.authenticator.desktop" \
|
||||
|
||||
@@ -33,7 +33,7 @@ flutter324.buildFlutterApplication {
|
||||
};
|
||||
|
||||
postFixup = ''
|
||||
patchelf $out/app/finamp --add-needed libisar.so --add-needed libmpv.so --add-rpath ${lib.makeLibraryPath [ mpv-unwrapped ]}
|
||||
patchelf $out/app/$pname/finamp --add-needed libisar.so --add-needed libmpv.so --add-rpath ${lib.makeLibraryPath [ mpv-unwrapped ]}
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
|
||||
@@ -50,11 +50,13 @@ flutterPackages.v3_19.buildFlutterApplication rec {
|
||||
|
||||
# without this, only the splash screen will be shown and the logs will contain the
|
||||
# line `Failed to load dynamic library 'lib/libintiface_engine_flutter_bridge.so'`
|
||||
extraWrapProgramArgs = "--chdir $out/app";
|
||||
# Environmental variables don't quite eval outside of hooks so use pname and
|
||||
# version directly.
|
||||
extraWrapProgramArgs = "--chdir $out/app/${pname}";
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/pixmaps
|
||||
cp $out/app/data/flutter_assets/assets/icons/intiface_central_icon.png $out/share/pixmaps/intiface-central.png
|
||||
cp $out/app/$pname/data/flutter_assets/assets/icons/intiface_central_icon.png $out/share/pixmaps/intiface-central.png
|
||||
'';
|
||||
|
||||
desktopItems = [
|
||||
|
||||
@@ -23,16 +23,16 @@ flutter.buildFlutterApplication rec {
|
||||
|
||||
postInstall = ''
|
||||
rm $out/bin/calculator
|
||||
ln -s $out/app/calculator $out/bin/expidus-calculator
|
||||
ln -s $out/app/$pname/calculator $out/bin/expidus-calculator
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
mv $out/app/data/com.expidusos.calculator.desktop $out/share/applications
|
||||
mv $out/app/$pname/data/com.expidusos.calculator.desktop $out/share/applications
|
||||
|
||||
mkdir -p $out/share/icons
|
||||
mv $out/app/data/com.expidusos.calculator.png $out/share/icons
|
||||
mv $out/app/$pname/data/com.expidusos.calculator.png $out/share/icons
|
||||
|
||||
mkdir -p $out/share/metainfo
|
||||
mv $out/app/data/com.expidusos.calculator.metainfo.xml $out/share/metainfo
|
||||
mv $out/app/$pname/data/com.expidusos.calculator.metainfo.xml $out/share/metainfo
|
||||
|
||||
substituteInPlace "$out/share/applications/com.expidusos.calculator.desktop" \
|
||||
--replace "Exec=calculator" "Exec=$out/bin/expidus-calculator" \
|
||||
|
||||
@@ -23,16 +23,16 @@ flutter.buildFlutterApplication rec {
|
||||
|
||||
postInstall = ''
|
||||
rm $out/bin/file_manager
|
||||
ln -s $out/app/file_manager $out/bin/expidus-file-manager
|
||||
ln -s $out/app/$pname/file_manager $out/bin/expidus-file-manager
|
||||
|
||||
mkdir -p $out/share/applications
|
||||
mv $out/app/data/com.expidusos.file_manager.desktop $out/share/applications
|
||||
mv $out/app/$pname/data/com.expidusos.file_manager.desktop $out/share/applications
|
||||
|
||||
mkdir -p $out/share/icons
|
||||
mv $out/app/data/com.expidusos.file_manager.png $out/share/icons
|
||||
mv $out/app/$pname/data/com.expidusos.file_manager.png $out/share/icons
|
||||
|
||||
mkdir -p $out/share/metainfo
|
||||
mv $out/app/data/com.expidusos.file_manager.metainfo.xml $out/share/metainfo
|
||||
mv $out/app/$pname/data/com.expidusos.file_manager.metainfo.xml $out/share/metainfo
|
||||
|
||||
substituteInPlace "$out/share/applications/com.expidusos.file_manager.desktop" \
|
||||
--replace "Exec=file_manager" "Exec=$out/bin/expidus-file-manager" \
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user