mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 04:50:21 +00:00
buildDartApplication: Recognise extraWrapProgramArgs
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
else null
|
||||
|
||||
, runtimeDependencies ? [ ]
|
||||
, extraWrapProgramArgs ? ""
|
||||
, customPackageOverrides ? { }
|
||||
, autoDepsList ? false
|
||||
, depsListFile ? null
|
||||
|
||||
@@ -3,15 +3,26 @@
|
||||
dartFixupHook() {
|
||||
echo "Executing dartFixupHook"
|
||||
|
||||
echo "Providing runtime dependencies"
|
||||
declare -a wrapProgramArgs
|
||||
|
||||
# Add runtime library dependencies to the LD_LIBRARY_PATH.
|
||||
# For some reason, the RUNPATH of the executable is not used to load dynamic libraries in dart:ffi with DynamicLibrary.open().
|
||||
#
|
||||
# This could alternatively be fixed with patchelf --add-needed, but this would cause all the libraries to be opened immediately,
|
||||
# which is not what application authors expect.
|
||||
echo "$runtimeDependencyLibraryPath"
|
||||
if [[ ! -z "$runtimeDependencyLibraryPath" ]]; then
|
||||
# Add runtime library dependencies to the LD_LIBRARY_PATH.
|
||||
# For some reason, the RUNPATH of the executable is not used to load dynamic libraries in dart:ffi with DynamicLibrary.open().
|
||||
#
|
||||
# This could alternatively be fixed with patchelf --add-needed, but this would cause all the libraries to be opened immediately,
|
||||
# which is not what application authors expect.
|
||||
wrapProgramArgs+=(--suffix LD_LIBRARY_PATH : \"$runtimeDependencyLibraryPath\")
|
||||
fi
|
||||
|
||||
if [[ ! -z "$extraWrapProgramArgs" ]]; then
|
||||
wrapProgramArgs+=("$extraWrapProgramArgs")
|
||||
fi
|
||||
|
||||
if [ ${#wrapProgramArgs[@]} -ne 0 ]; then
|
||||
for f in "$out"/bin/*; do
|
||||
wrapProgram "$f" --suffix LD_LIBRARY_PATH : "$runtimeDependencyLibraryPath"
|
||||
echo "Wrapping $f..."
|
||||
eval "wrapProgram \"$f\" ${wrapProgramArgs[@]}"
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user