Merge pull request #37885 from dtzWill/fix/musl-fts
musl-fts: setup-hook to add -lfts, use in xar and libselinux
This commit is contained in:
commit
73320be341
@ -1,5 +1,6 @@
|
|||||||
{ stdenv, fetchurl, fetchpatch, pkgconfig, libsepol, pcre
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, libsepol, pcre
|
||||||
, enablePython ? true, swig ? null, python ? null
|
, enablePython ? true, swig ? null, python ? null
|
||||||
|
, musl-fts
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert enablePython -> swig != null && python != null;
|
assert enablePython -> swig != null && python != null;
|
||||||
@ -18,7 +19,8 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig ];
|
||||||
buildInputs = [ libsepol pcre ]
|
buildInputs = [ libsepol pcre ]
|
||||||
++ optionals enablePython [ swig python ];
|
++ optionals enablePython [ swig python ]
|
||||||
|
++ optional stdenv.hostPlatform.isMusl musl-fts;
|
||||||
|
|
||||||
# Avoid this false warning:
|
# Avoid this false warning:
|
||||||
# avc_internal.c: In function 'avc_netlink_receive':
|
# avc_internal.c: In function 'avc_netlink_receive':
|
||||||
|
17
pkgs/os-specific/linux/musl/fts-setup-hook.sh
Normal file
17
pkgs/os-specific/linux/musl/fts-setup-hook.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
ftsLdflags() {
|
||||||
|
# The `depHostOffset` describes how the host platform of the dependencies
|
||||||
|
# are slid relative to the depending package. It is brought into scope of
|
||||||
|
# the environment hook defined as the role of the dependency being applied.
|
||||||
|
case $depHostOffset in
|
||||||
|
-1) local role='BUILD_' ;;
|
||||||
|
0) local role='' ;;
|
||||||
|
1) local role='TARGET_' ;;
|
||||||
|
*) echo "cc-wrapper: Error: Cannot be used with $depHostOffset-offset deps" >2;
|
||||||
|
return 1 ;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
export NIX_${role}LDFLAGS+=" -lfts"
|
||||||
|
}
|
||||||
|
|
||||||
|
addEnvHooks "$hostOffset" ftsLdflags
|
||||||
|
|
@ -11,4 +11,6 @@ stdenv.mkDerivation rec {
|
|||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
nativeBuildInputs = [ autoreconfHook pkgconfig ];
|
||||||
|
|
||||||
|
setupHook = ./fts-setup-hook.sh;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, fetchurl, libxml2, openssl, zlib, bzip2 }:
|
{ stdenv, fetchurl, libxml2, openssl, zlib, bzip2, musl-fts }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "1.6.1";
|
version = "1.6.1";
|
||||||
@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0ghmsbs6xwg1092v7pjcibmk5wkyifwxw6ygp08gfz25d2chhipf";
|
sha256 = "0ghmsbs6xwg1092v7pjcibmk5wkyifwxw6ygp08gfz25d2chhipf";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ libxml2 openssl zlib bzip2 ];
|
buildInputs = [ libxml2 openssl zlib bzip2 ]
|
||||||
|
++ stdenv.lib.optional stdenv.hostPlatform.isMusl musl-fts;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = https://mackyle.github.io/xar/;
|
homepage = https://mackyle.github.io/xar/;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user