about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-12-08 13:19:02 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2018-12-26 10:37:55 +0100
commit2526f9f157465cfc66385ea3213ed833a3944c43 (patch)
tree50c50580743228a30c12626cf5c95a9bae0f3902 /pkgs/development/interpreters
parentae0f5d2705a34d590f6e439432926f89cfff0744 (diff)
downloadnixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar.gz
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar.bz2
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar.lz
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar.xz
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.tar.zst
nixlib-2526f9f157465cfc66385ea3213ed833a3944c43.zip
python37: remove references to openssl.dev
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/python/cpython/3.7/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/development/interpreters/python/cpython/3.7/default.nix b/pkgs/development/interpreters/python/cpython/3.7/default.nix
index 30ebe5c6591f..177b5aa184d8 100644
--- a/pkgs/development/interpreters/python/cpython/3.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/3.7/default.nix
@@ -14,6 +14,7 @@
 , self
 , CF, configd
 , python-setup-hook
+, nukeReferences
 # For the Python package set
 , packageOverrides ? (self: super: {})
 , buildPackages
@@ -34,7 +35,7 @@ let
   sitePackages = "lib/${libPrefix}/site-packages";
 
   buildInputs = filter (p: p != null) [
-    zlib bzip2 expat lzma libffi gdbm sqlite readline ncurses openssl ]
+    zlib bzip2 expat lzma libffi gdbm sqlite readline ncurses openssl nukeReferences ]
     ++ optionals x11Support [ tcl tk libX11 xproto ]
     ++ optionals stdenv.isDarwin [ CF configd ];
 
@@ -173,9 +174,14 @@ in stdenv.mkDerivation {
     # some $TMPDIR references to improve binary reproducibility.
     # Note that the .pyc file of _sysconfigdata.py should be regenerated!
     for i in $out/lib/python${majorVersion}/_sysconfigdata*.py $out/lib/python${majorVersion}/config-${majorVersion}m*/Makefile; do
-      sed -i $i -e "s|-I/nix/store/[^ ']*||g" -e "s|-L/nix/store/[^ ']*||g" -e "s|$TMPDIR|/no-such-path|g"
+      sed -i $i -e "s|$TMPDIR|/no-such-path|g"
+      nuke-refs $i
     done
 
+    # Further get rid of references. https://github.com/NixOS/nixpkgs/issues/51668
+    find $out/lib/python*/config-*-* -type f -print -exec nuke-refs '{}' +
+    find $out/lib -name '_sysconfigdata_m*.py*' -print -exec nuke-refs '{}' +
+
     # Determinism: rebuild all bytecode
     # We exclude lib2to3 because that's Python 2 code which fails
     # We rebuild three times, once for each optimization level
@@ -186,6 +192,10 @@ in stdenv.mkDerivation {
     find $out -name "*.py" | ${pythonForBuild} -OO -m compileall -q -f -x "lib2to3" -i -
   '';
 
+  # Enforce that we don't have references to the OpenSSL -dev package, which we
+  # explicitly specify in our configure flags above.
+  disallowedReferences = [ openssl.dev ];
+
   passthru = let
     pythonPackages = callPackage ../../../../../top-level/python-packages.nix {
       python = self;