diff options
Diffstat (limited to 'pkgs/development/interpreters')
7 files changed, 67 insertions, 40 deletions
diff --git a/pkgs/development/interpreters/perl/default.nix b/pkgs/development/interpreters/perl/default.nix index f013f6ec3727..3fe04e6bde2e 100644 --- a/pkgs/development/interpreters/perl/default.nix +++ b/pkgs/development/interpreters/perl/default.nix @@ -36,7 +36,7 @@ let ./no-sys-dirs.patch ] ++ optional stdenv.isSunOS ./ld-shared.patch - ++ optional stdenv.isDarwin [ ./cpp-precomp.patch ]; + ++ optional stdenv.isDarwin [ ./cpp-precomp.patch ./sw_vers.patch ]; postPatch = '' pwd="$(type -P pwd)" @@ -121,17 +121,16 @@ let in rec { - perl = perl522; - - perl520 = common { - version = "5.20.3"; - sha256 = "0jlvpd5l5nk7lzfd4akdg1sw6vinbkj6izclyyr0lrbidfky691m"; + perl = perl524; + perl522 = common { + version = "5.22.3"; + sha256 = "10q087l1ffdy3gpryr8z540jcnsr0dhm37raicyfqqkyvys1yd8v"; }; - perl522 = common { - version = "5.22.2"; - sha256 = "1hl3v85ggm027v9h2ycas4z5i3401s2k2l3qpnw8q5mahmiikbc1"; + perl524 = common { + version = "5.24.1"; + sha256 = "1bqqb5ghfj4486nqr77kgsd8aff6a289jy7n2cdkznwvn34qbhg6"; }; } diff --git a/pkgs/development/interpreters/perl/sw_vers.patch b/pkgs/development/interpreters/perl/sw_vers.patch new file mode 100644 index 000000000000..9d4cd75486e6 --- /dev/null +++ b/pkgs/development/interpreters/perl/sw_vers.patch @@ -0,0 +1,13 @@ +diff --git a/hints/darwin.sh b/hints/darwin.sh +index afadf53..80b7533 100644 +--- a/hints/darwin.sh ++++ b/hints/darwin.sh +@@ -329,7 +329,7 @@ EOM + # sw_vers output what we want + # "ProductVersion: 10.10.5" "10.10" + # "ProductVersion: 10.11" "10.11" +- prodvers=`sw_vers|awk '/^ProductVersion:/{print $2}'|awk -F. '{print $1"."$2}'` ++ prodvers="10.10" + case "$prodvers" in + 10.*) + add_macosx_version_min ccflags $prodvers diff --git a/pkgs/development/interpreters/picolisp/default.nix b/pkgs/development/interpreters/picolisp/default.nix index 04aca84f902f..2a5d9d2f5744 100644 --- a/pkgs/development/interpreters/picolisp/default.nix +++ b/pkgs/development/interpreters/picolisp/default.nix @@ -3,10 +3,10 @@ with stdenv.lib; stdenv.mkDerivation rec { name = "picoLisp-${version}"; - version = "16.6"; + version = "16.12"; src = fetchurl { url = "http://www.software-lab.de/${name}.tgz"; - sha256 = "0y9b4wqpgx0j0igbp4h7k0bw3hvp7dnrhl3fsaagjpp305b003z3"; + sha256 = "1k3x6mvk9b34iiyml142bzh3gf241f25ywjlaagbxzb9vklpws75"; }; buildInputs = optional stdenv.is64bit jdk; patchPhase = optionalString stdenv.isArm '' diff --git a/pkgs/development/interpreters/python/cpython/3.3/default.nix b/pkgs/development/interpreters/python/cpython/3.3/default.nix index 3ab0de96704c..c561a1ed750a 100644 --- a/pkgs/development/interpreters/python/cpython/3.3/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.3/default.nix @@ -50,7 +50,17 @@ in stdenv.mkDerivation { NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; - postPatch = optionalString (x11Support && (tix != null)) '' + # Determinism: The interpreter is patched to write null timestamps when compiling python files. + # This way python doesn't try to update them when we freeze timestamps in nix store. + DETERMINISTIC_BUILD=1; + # Determinism: We fix the hashes of str, bytes and datetime objects. + PYTHONHASHSEED=0; + + postPatch = '' + # Determinism + substituteInPlace "Lib/py_compile.py" --replace "source_stats['mtime']" "(1 if 'DETERMINISTIC_BUILD' in os.environ else source_stats['mtime'])" +# # We do not patch `Lib/importlib/_bootstrap_external.py` because it does not exist. + '' + optionalString (x11Support && (tix != null)) '' substituteInPlace "Lib/tkinter/tix.py" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" ''; @@ -80,12 +90,17 @@ in stdenv.mkDerivation { fi done touch $out/lib/python${majorVersion}/test/__init__.py + ln -s "$out/include/python${majorVersion}m" "$out/include/python${majorVersion}" paxmark E $out/bin/python${majorVersion} # Python on Nix is not manylinux1 compatible. https://github.com/NixOS/nixpkgs/issues/18484 echo "manylinux1_compatible=False" >> $out/lib/${libPrefix}/_manylinux.py + # Determinism: Windows installers were not deterministic. + # We're also not interested in building Windows installers. + find "$out" -name 'wininst*.exe' | xargs -r rm -f + # Use Python3 as default python ln -s "$out/bin/idle3" "$out/bin/idle" ln -s "$out/bin/pip3" "$out/bin/pip" @@ -93,18 +108,20 @@ in stdenv.mkDerivation { ln -s "$out/bin/python3" "$out/bin/python" ln -s "$out/bin/python3-config" "$out/bin/python-config" ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc" - ''; - postFixup = '' # Get rid of retained dependencies on -dev packages, and remove # 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" done - # FIXME: should regenerate this. - rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython* - + # Determinism: rebuild all bytecode + # We exclude lib2to3 because that's Python 2 code which fails + # We rebuild three times, once for each optimization level + find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - ''; passthru = let diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix index 58e4f21bb4a1..b2a4d849c942 100644 --- a/pkgs/development/interpreters/python/cpython/3.4/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix @@ -132,24 +132,19 @@ in stdenv.mkDerivation { ln -s "$out/bin/python3-config" "$out/bin/python-config" ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc" - # Determinism: rebuild all bytecode - # We exclude lib2to3 because that's Python 2 code which fails - # We rebuild three times, once for each optimization level - find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - - ''; - - postFixup = '' # Get rid of retained dependencies on -dev packages, and remove # 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" done - # FIXME: should regenerate this. - rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython* - + # Determinism: rebuild all bytecode + # We exclude lib2to3 because that's Python 2 code which fails + # We rebuild three times, once for each optimization level + find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - ''; passthru = let diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 082f6ff67897..76f445f7a509 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -134,23 +134,19 @@ in stdenv.mkDerivation { ln -s "$out/bin/python3-config" "$out/bin/python-config" ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc" - # Determinism: rebuild all bytecode - # We exclude lib2to3 because that's Python 2 code which fails - # We rebuild three times, once for each optimization level - find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - - find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - - ''; - - postFixup = '' # Get rid of retained dependencies on -dev packages, and remove # 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" done - # FIXME: should regenerate this. - rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython* + # Determinism: rebuild all bytecode + # We exclude lib2to3 because that's Python 2 code which fails + # We rebuild three times, once for each optimization level + find $out -name "*.py" | $out/bin/python -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -O -m compileall -q -f -x "lib2to3" -i - + find $out -name "*.py" | $out/bin/python -OO -m compileall -q -f -x "lib2to3" -i - ''; passthru = let diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index 78e57fef15f6..150786191669 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -126,6 +126,13 @@ in stdenv.mkDerivation { ln -s "$out/bin/python3-config" "$out/bin/python-config" ln -s "$out/lib/pkgconfig/python3.pc" "$out/lib/pkgconfig/python.pc" + # Get rid of retained dependencies on -dev packages, and remove + # 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" + done + # Determinism: rebuild all bytecode # We exclude lib2to3 because that's Python 2 code which fails # We rebuild three times, once for each optimization level |