-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #175785: libidn2: hack to avoid referencing bootstrap tools
...into staging
- Loading branch information
Showing
3 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
pkgs/development/libraries/libidn2/no-bootstrap-reference.nix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ stdenv, lib, libidn2, libunistring, runCommandLocal, patchelf }: | ||
# Construct a copy of libidn2.* where all (transitive) libc references (in .bin) | ||
# get replaced by a new one, so that there's no reference to bootstrap tools. | ||
runCommandLocal | ||
"${libidn2.pname}-${libidn2.version}" | ||
{ | ||
outputs = [ "bin" "dev" "out" ]; | ||
passthru = { | ||
inherit (libidn2) out info devdoc; # no need to touch these store paths | ||
}; | ||
} | ||
'' | ||
cp -r '${libidn2.bin}' "$bin" | ||
chmod +w "$bin"/bin/* | ||
patchelf \ | ||
--set-interpreter '${stdenv.cc.bintools.dynamicLinker}' \ | ||
--set-rpath '${lib.concatMapStringsSep ":" (p: lib.getLib p + "/lib") | ||
[ stdenv.cc.libc libunistring libidn2 ]}' \ | ||
"$bin"/bin/* | ||
cp -r '${libidn2.dev}' "$dev" | ||
chmod +w "$dev"/nix-support/propagated-build-inputs | ||
substituteInPlace "$dev"/nix-support/propagated-build-inputs \ | ||
--replace '${libidn2.bin}' "$bin" | ||
substituteInPlace "$dev"/lib/pkgconfig/libidn2.pc \ | ||
--replace '${libidn2.dev}' "$dev" | ||
ln -s '${libidn2.out}' "$out" # it's hard to be without any $out | ||
'' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters