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:
Will Dietz 2018-03-26 14:17:53 -05:00 committed by GitHub
commit 73320be341
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 3 deletions

View file

@ -1,5 +1,6 @@
{ stdenv, fetchurl, fetchpatch, pkgconfig, libsepol, pcre
, enablePython ? true, swig ? null, python ? null
, musl-fts
}:
assert enablePython -> swig != null && python != null;
@ -18,7 +19,8 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libsepol pcre ]
++ optionals enablePython [ swig python ];
++ optionals enablePython [ swig python ]
++ optional stdenv.hostPlatform.isMusl musl-fts;
# Avoid this false warning:
# avc_internal.c: In function 'avc_netlink_receive':

View 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

View file

@ -11,4 +11,6 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ autoreconfHook pkgconfig ];
setupHook = ./fts-setup-hook.sh;
}

View file

@ -1,4 +1,4 @@
{ stdenv, fetchurl, libxml2, openssl, zlib, bzip2 }:
{ stdenv, fetchurl, libxml2, openssl, zlib, bzip2, musl-fts }:
stdenv.mkDerivation rec {
version = "1.6.1";
@ -9,7 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "0ghmsbs6xwg1092v7pjcibmk5wkyifwxw6ygp08gfz25d2chhipf";
};
buildInputs = [ libxml2 openssl zlib bzip2 ];
buildInputs = [ libxml2 openssl zlib bzip2 ]
++ stdenv.lib.optional stdenv.hostPlatform.isMusl musl-fts;
meta = {
homepage = https://mackyle.github.io/xar/;