flutter: Use autoPatchelfHook for SDK artifacts
This allows SDK artifacts (including build tools and libraries) to use the right interpreter and library locations, abolishing the need for a FHS or post-build patches. `autoPatchelf` has been used through `autoPatchelfHook`, instead of the `autoPatchelf` command on just the artifact directory, due to the latter method not patching interpreter paths (https://discourse.nixos.org/t/trying-to-use-autopatchelf/24003). Co-authored-by: FlafyDev <flafyarazi@gmail.com> Co-authored-by: gilice <gilice@proton.me> Co-authored-by: hacker1024 <hacker1024@users.sourceforge.net>
This commit is contained in:
parent
65708c3360
commit
94a34aadf6
@ -4,12 +4,25 @@
|
||||
, src
|
||||
|
||||
, lib
|
||||
, git
|
||||
, stdenv
|
||||
, autoPatchelfHook
|
||||
, git
|
||||
, which
|
||||
, atk
|
||||
, glib
|
||||
, gtk3
|
||||
, libepoxy
|
||||
}:
|
||||
|
||||
let
|
||||
# Libraries that Flutter artifacts depend on at runtime.
|
||||
artifactRuntimeDeps = [
|
||||
atk
|
||||
glib
|
||||
gtk3
|
||||
libepoxy
|
||||
];
|
||||
|
||||
self =
|
||||
stdenv.mkDerivation {
|
||||
name = "$flutter-${version}-unwrapped";
|
||||
@ -17,7 +30,8 @@ let
|
||||
|
||||
outputs = [ "out" "cache" ];
|
||||
|
||||
buildInputs = [ git ];
|
||||
nativeBuildInputs = [ autoPatchelfHook ];
|
||||
buildInputs = [ git ] ++ artifactRuntimeDeps;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs --build ./bin/
|
||||
|
@ -95,6 +95,5 @@ in
|
||||
--prefix PATH : '${lib.makeBinPath buildTools}' \
|
||||
--prefix PKG_CONFIG_PATH : '${builtins.concatStringsSep ":" pkgConfigDirectories}' \
|
||||
--prefix CXXFLAGS "''\t" '${builtins.concatStringsSep " " cppFlags}' \
|
||||
--prefix LDFLAGS "''\t" '${builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags)}' \
|
||||
--suffix LD_LIBRARY_PATH : '${lib.makeLibraryPath appPrebuiltDeps}'
|
||||
--prefix LDFLAGS "''\t" '${builtins.concatStringsSep " " (map (flag: "-Wl,${flag}") linkerFlags)}'
|
||||
'')
|
||||
|
Loading…
Reference in New Issue
Block a user