summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam A. Kennington III <william@wkennington.com>2014-10-30 14:43:37 -0700
committerWilliam A. Kennington III <william@wkennington.com>2014-11-02 17:22:27 -0800
commit09d970ce129146eb91158cfac6a96fcd95a2ac25 (patch)
treeb743cc9df2ff0df657102ac4ec0400d5af621e0f
parentaf8654db278019f9f7ef69b58a4702871ba1c407 (diff)
downloadnixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar.gz
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar.bz2
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar.lz
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar.xz
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.tar.zst
nixpkgs-09d970ce129146eb91158cfac6a96fcd95a2ac25.zip
boost: Remove dependencies on boost-dev
-rw-r--r--pkgs/development/libraries/boost/generic.nix7
-rw-r--r--pkgs/development/libraries/boost/strip-header-path.sh12
2 files changed, 17 insertions, 2 deletions
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index c3493d6a14d..fd784e0b650 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames
+{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, makeSetupHook
 , toolset ? null
 , enableRelease ? true
 , enableDebug ? false
@@ -89,13 +89,16 @@ let
 
     # Create a derivation which encompasses everything, making buildInputs nicer
     mkdir -p $out/nix-support
-    echo "$dev $lib" > $out/nix-support/propagated-native-build-inputs
+    echo "${stripHeaderPathHook} $dev $lib" > $out/nix-support/propagated-native-build-inputs
   '';
 
   commonConfigureFlags = [
     "--includedir=$(dev)/include"
     "--libdir=$(lib)/lib"
   ];
+
+  stripHeaderPathHook = makeSetupHook { } ./strip-header-path.sh;
+
 in
 
 stdenv.mkDerivation {
diff --git a/pkgs/development/libraries/boost/strip-header-path.sh b/pkgs/development/libraries/boost/strip-header-path.sh
new file mode 100644
index 00000000000..f8243fc27be
--- /dev/null
+++ b/pkgs/development/libraries/boost/strip-header-path.sh
@@ -0,0 +1,12 @@
+postPhases+=" boostHeaderStripPhase"
+
+boostHeaderStripPhase() {
+    runHook preBoostHeaderStrip
+    [ -z "$outputs" ] && outputs=out
+    for output in $outputs; do
+      eval "path=\$$outputs"
+      [ -d "$path/bin" ] || continue
+      find "$path/bin" -type f -exec sed -i "s,[^/]*\(-boost-[0-9.]*-dev\),xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\1,g" {} \;
+    done
+    runHook postBoostHeaderStrip
+}