mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
buildDartApplication: Generate LD_LIBRARY_PATH at build time
This allows setup hooks to add runtime dependencies.
This commit is contained in:
parent
1ae96d0704
commit
cf55bc7300
@ -89,7 +89,7 @@ let
|
||||
baseDerivation = stdenv.mkDerivation (finalAttrs: (builtins.removeAttrs args [ "gitHashes" "sdkSourceBuilders" "pubspecLock" ]) // {
|
||||
inherit pubspecLockFile packageConfig sdkSetupScript pubGetScript
|
||||
dartCompileCommand dartOutputType dartRuntimeCommand dartCompileFlags
|
||||
dartJitFlags runtimeDependencies;
|
||||
dartJitFlags;
|
||||
|
||||
outputs = args.outputs or [ ] ++ [ "out" "pubcache" ];
|
||||
|
||||
@ -98,7 +98,7 @@ let
|
||||
then writeText "entrypoints.json" (builtins.toJSON dartEntryPoints)
|
||||
else null;
|
||||
|
||||
runtimeDependencyLibraryPath = lib.makeLibraryPath finalAttrs.runtimeDependencies;
|
||||
runtimeDependencies = map lib.getLib runtimeDependencies;
|
||||
|
||||
nativeBuildInputs = (args.nativeBuildInputs or [ ]) ++ [
|
||||
dart
|
||||
|
@ -10,9 +10,12 @@ dartFixupHook() {
|
||||
#
|
||||
# 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
|
||||
wrapProgramArgs+=(--suffix LD_LIBRARY_PATH : \"$runtimeDependencyLibraryPath\")
|
||||
APPLICATION_LD_LIBRARY_PATH=""
|
||||
for runtimeDependency in "${runtimeDependencies[@]}"; do
|
||||
addToSearchPath APPLICATION_LD_LIBRARY_PATH "${runtimeDependency}/lib"
|
||||
done
|
||||
if [[ ! -z "$APPLICATION_LD_LIBRARY_PATH" ]]; then
|
||||
wrapProgramArgs+=(--suffix LD_LIBRARY_PATH : \"$APPLICATION_LD_LIBRARY_PATH\")
|
||||
fi
|
||||
|
||||
if [[ ! -z "$extraWrapProgramArgs" ]]; then
|
||||
|
Loading…
Reference in New Issue
Block a user