From 780caf66908046e7bcd4f3549363f300c99c4f62 Mon Sep 17 00:00:00 2001 From: Spencer Baugh Date: Sat, 29 Aug 2020 16:44:17 -0400 Subject: python37: 3.7.8 -> 3.7.9 Release notes: https://docs.python.org/release/3.7.9/whatsnew/changelog.html Most notable is the fixed behavior of asynchronous generators; without this fix, they fail to work in some scenarios. --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 76963587c20..1fdf465f871 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -81,10 +81,10 @@ in { sourceVersion = { major = "3"; minor = "7"; - patch = "8"; + patch = "9"; suffix = ""; }; - sha256 = "Q6VDQEs2PwA3+J34R48Z2y28DW8//uMQvCmX+nGFSmM="; + sha256 = "008v6g1jkrjrdmiqlgjlq6msbbj848bvkws6ppwva1ahn03k14li"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 2248a7422f498cf796b1c52518066ca835504b21 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 30 Aug 2020 08:59:42 +0200 Subject: python36: 3.6.11 -> 3.6.12 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 1fdf465f871..773e365889b 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -68,10 +68,10 @@ in { sourceVersion = { major = "3"; minor = "6"; - patch = "11"; + patch = "12"; suffix = ""; }; - sha256 = "dB69y8Tjk3pf8jUX3UVev31UPqn+9vXPb0blddbE/aQ="; + sha256 = "cJU6m11okdkuZdGEw1EhJqFYFL7hXh7/LdzOBDNOmpk="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 762434fb02e1aff996dffdf3e03dc8fe985901b6 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 1 Sep 2020 13:44:07 -0700 Subject: python39: 3.9.0b5 -> 3.9.0rc1 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 76963587c20..db60c0ead6f 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -108,9 +108,9 @@ in { major = "3"; minor = "9"; patch = "0"; - suffix = "b5"; + suffix = "rc1"; }; - sha256 = "0r0m82srq4z44dahczd1cv6wgmxcpqbn5dyd8czcpk2pp9ydgqbc"; + sha256 = "0w6wvyy9fbvfvrmhvmlb5gq18haagywk9hjkp1knjdarfczag9zv"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 7abb57c7b5eaa9aa34ea289fc1e23ed259547bdb Mon Sep 17 00:00:00 2001 From: Johannes Rosenberger Date: Fri, 18 Sep 2020 00:45:31 +0200 Subject: fix passing qt5 version to pythonInterpreters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes c88f3adb1793cd3b007baff0292cf1fa8d0ab1e6, which resulted in qt 5.15 being used in pythonPackages, despite 5.14 being declared, and adapts qutebrowser accordingly. 'callPackage { pkgs = pkgs // { … }; }' does not work, because it does not take into account the recursive evaluation of nixpkgs: `pkgs/development/interpreters/python/default.nix` calls `pkgs/top-level/python-packages.nix` with `callPackage`. Thus, even if the former gets passed the updated `pkgs`, the latter always gets passed `pkgs.pkgs`. For the change in the qt5 version to apply consistently, 'pkgs.extend' must be used. qutebrowser only used the right qt5 version (5.15) because all pythonPackages used it anyway. --- pkgs/development/interpreters/python/default.nix | 2 +- pkgs/top-level/all-packages.nix | 29 ++++++++++-------------- 2 files changed, 13 insertions(+), 18 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index e4230093e9c..94422518b25 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -1,4 +1,4 @@ -{ pkgs, lib }: +{ pkgs }: with pkgs; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c111685ca01..570e27b45ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10217,10 +10217,10 @@ in pythonInterpreters = callPackage ./../development/interpreters/python { # Overrides that apply to all Python interpreters - pkgs = pkgs // { - qt5 = pkgs.qt514; - libsForQt5 = pkgs.libsForQt514; - }; + pkgs = pkgs.extend (final: _: { + qt5 = final.qt514; + libsForQt5 = final.libsForQt514; + }); }; inherit (pythonInterpreters) python27 python36 python37 python38 python39 python3Minimal pypy27 pypy36; @@ -22956,19 +22956,14 @@ in quodlibet-xine-full = quodlibet-full.override { xineBackend = true; tag = "-xine-full"; }; qutebrowser = let - libsForQt5 = libsForQt515; - qt5 = qt515; - python = python3.override { - packageOverrides = self: super: { - pkgs = pkgs // { - inherit libsForQt5 qt5; - }; - }; - self = python3; - }; - in libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { - python3 = python; - }; + pkgs_ = pkgs.extend(_: prev: { + pythonInterpreters = prev.pythonInterpreters.override(oldAttrs: { + pkgs = oldAttrs.pkgs.extend(_: _: { + inherit (pkgs) qt5 libsForQt5; + }); + }); + }); + in pkgs_.libsForQt5.callPackage ../applications/networking/browsers/qutebrowser { }; rabbitvcs = callPackage ../applications/version-management/rabbitvcs {}; -- cgit 1.4.1 From 74f3e9cce1770c19e35f3e4e2559a49dce22f8c6 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 27 Sep 2020 11:48:00 +0200 Subject: python39: 3.9.0rc1 -> 3.9.0rc2 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 94422518b25..53fed542c05 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -108,9 +108,9 @@ in { major = "3"; minor = "9"; patch = "0"; - suffix = "rc1"; + suffix = "rc2"; }; - sha256 = "0w6wvyy9fbvfvrmhvmlb5gq18haagywk9hjkp1knjdarfczag9zv"; + sha256 = "gLV8EfYNwfRqQIsVQ/BO1S5kde1eWXtMI/P9ZfC3Kbo="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 7c411b372977b3f6d8547345fe55d4742a3f27db Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 27 Sep 2020 11:41:23 +0200 Subject: python38: 3.8.5 -> 3.8.6 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 94422518b25..cfd7d2478cf 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -94,10 +94,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "5"; + patch = "6"; suffix = ""; }; - sha256 = "1c43dbv9lvlp3ynqmgdi4rh8q94swanhqarqrdx62zmigpakw073"; + sha256 = "qeC3nSeqBW65zOjWOkJ7X5urFGXe4/lC3P2yWoL0q4o="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 3696bc0e893387a9e0c34c8570204d064aab774b Mon Sep 17 00:00:00 2001 From: Raphael Borun Das Gupta Date: Tue, 6 Oct 2020 00:15:32 +0200 Subject: python39: 3.9.0rc2 -> 3.9.0 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 53fed542c05..2ed5ed951d3 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -108,9 +108,9 @@ in { major = "3"; minor = "9"; patch = "0"; - suffix = "rc2"; + suffix = ""; }; - sha256 = "gLV8EfYNwfRqQIsVQ/BO1S5kde1eWXtMI/P9ZfC3Kbo="; + sha256 = "0m18z05nlmqm1zjw9s0ifgrn1jvjn3jwjg0bpswhjmw5k4yfcwww"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 67d2de5ffaa6766a71b077a331b1cad07b7e3a80 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 12 Oct 2020 23:28:25 -0700 Subject: python310: init at 3.10a1 --- .../python/cpython/3.10/no-ldconfig.patch | 100 +++++++++++++++++++++ pkgs/development/interpreters/python/default.nix | 14 +++ pkgs/top-level/all-packages.nix | 3 +- 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch new file mode 100644 index 00000000000..a1f9d68eb16 --- /dev/null +++ b/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch @@ -0,0 +1,100 @@ +From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk +Date: Mon, 28 Aug 2017 09:24:06 +0200 +Subject: [PATCH] Don't use ldconfig + +--- + Lib/ctypes/util.py | 70 ++---------------------------------------------------- + 1 file changed, 2 insertions(+), 68 deletions(-) + +diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py +index 5e8b31a854..7b45ce6c15 100644 +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -94,46 +94,7 @@ elif os.name == "posix": + import re, tempfile + + def _findLib_gcc(name): +- # Run GCC's linker with the -t (aka --trace) option and examine the +- # library name it prints out. The GCC command will fail because we +- # haven't supplied a proper program with main(), but that does not +- # matter. +- expr = os.fsencode(r'[^\(\)\s]*lib%s\.[^\(\)\s]*' % re.escape(name)) +- +- c_compiler = shutil.which('gcc') +- if not c_compiler: +- c_compiler = shutil.which('cc') +- if not c_compiler: +- # No C compiler available, give up +- return None +- +- temp = tempfile.NamedTemporaryFile() +- try: +- args = [c_compiler, '-Wl,-t', '-o', temp.name, '-l' + name] +- +- env = dict(os.environ) +- env['LC_ALL'] = 'C' +- env['LANG'] = 'C' +- try: +- proc = subprocess.Popen(args, +- stdout=subprocess.PIPE, +- stderr=subprocess.STDOUT, +- env=env) +- except OSError: # E.g. bad executable +- return None +- with proc: +- trace = proc.stdout.read() +- finally: +- try: +- temp.close() +- except FileNotFoundError: +- # Raised if the file was already removed, which is the normal +- # behaviour of GCC if linking fails +- pass +- res = re.search(expr, trace) +- if not res: +- return None +- return os.fsdecode(res.group(0)) ++ return None + + + if sys.platform == "sunos5": +@@ -255,34 +216,7 @@ elif os.name == "posix": + else: + + def _findSoname_ldconfig(name): +- import struct +- if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' +- else: +- machine = os.uname().machine + '-64' +- mach_map = { +- 'x86_64-64': 'libc6,x86-64', +- 'ppc64-64': 'libc6,64bit', +- 'sparc64-64': 'libc6,64bit', +- 's390x-64': 'libc6,64bit', +- 'ia64-64': 'libc6,IA-64', +- } +- abi_type = mach_map.get(machine, 'libc6') +- +- # XXX assuming GLIBC's ldconfig (with option -p) +- regex = r'\s+(lib%s\.[^\s]+)\s+\(%s' +- regex = os.fsencode(regex % (re.escape(name), abi_type)) +- try: +- with subprocess.Popen(['/sbin/ldconfig', '-p'], +- stdin=subprocess.DEVNULL, +- stderr=subprocess.DEVNULL, +- stdout=subprocess.PIPE, +- env={'LC_ALL': 'C', 'LANG': 'C'}) as p: +- res = re.search(regex, p.stdout.read()) +- if res: +- return os.fsdecode(res.group(1)) +- except OSError: +- pass ++ return None + + def _findLib_ld(name): + # See issue #9998 for why this is needed +-- +2.15.0 + diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 90b6e8ee0cb..a8db9bc9257 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -28,6 +28,7 @@ with pkgs; isPy37 = pythonVersion == "3.7"; isPy38 = pythonVersion == "3.8"; isPy39 = pythonVersion == "3.9"; + isPy310 = pythonVersion == "3.10"; isPy2 = lib.strings.substring 0 1 pythonVersion == "2"; isPy3 = lib.strings.substring 0 1 pythonVersion == "3"; isPy3k = isPy3; @@ -115,6 +116,19 @@ in { inherit passthruFun; }; + python310 = callPackage ./cpython { + self = python310; + sourceVersion = { + major = "3"; + minor = "10"; + patch = "0"; + suffix = "a1"; + }; + sha256 = "0q59a99w1yad808mx4w6l0j7bk7dbd2kakngbk0w1h9z4dhr8wyv"; + inherit (darwin) configd; + inherit passthruFun; + }; + # Minimal versions of Python (built without optional dependencies) python3Minimal = (python38.override { self = python3Minimal; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a6f812b2252..a63bb6a9652 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10258,7 +10258,7 @@ in pkgs = pkgs.extend (final: _: { }); }; - inherit (pythonInterpreters) python27 python36 python37 python38 python39 python3Minimal pypy27 pypy36; + inherit (pythonInterpreters) python27 python36 python37 python38 python39 python310 python3Minimal pypy27 pypy36; # Python package sets. python27Packages = lib.hiPrioSet (recurseIntoAttrs python27.pkgs); @@ -10266,6 +10266,7 @@ in python37Packages = recurseIntoAttrs python37.pkgs; python38Packages = recurseIntoAttrs python38.pkgs; python39Packages = python39.pkgs; + python310Packages = python310.pkgs; pypyPackages = pypy.pkgs; pypy2Packages = pypy2.pkgs; pypy27Packages = pypy27.pkgs; -- cgit 1.4.1 From 5a5122418ae3f4c7cafaa867915826afda3a5b5d Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Mon, 9 Nov 2020 10:37:15 -0800 Subject: python310: 3.10.0a1 -> 3.10.0a2 --- .../python/cpython/3.10/no-ldconfig.patch | 33 +++++++++++++--------- .../interpreters/python/cpython/default.nix | 3 ++ pkgs/development/interpreters/python/default.nix | 4 +-- 3 files changed, 25 insertions(+), 15 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch index a1f9d68eb16..c259aed72b9 100644 --- a/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch +++ b/pkgs/development/interpreters/python/cpython/3.10/no-ldconfig.patch @@ -1,18 +1,18 @@ -From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 -From: Frederik Rietdijk -Date: Mon, 28 Aug 2017 09:24:06 +0200 -Subject: [PATCH] Don't use ldconfig +From 084c6dd6352077e64f10cf7aa168f95d800f3819 Mon Sep 17 00:00:00 2001 +From: Jonathan Ringer +Date: Mon, 9 Nov 2020 10:24:35 -0800 +Subject: [PATCH] CPython: Don't use ldconfig --- - Lib/ctypes/util.py | 70 ++---------------------------------------------------- - 1 file changed, 2 insertions(+), 68 deletions(-) + Lib/ctypes/util.py | 77 ++-------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 5e8b31a854..7b45ce6c15 100644 +index 0c2510e..7fb98af 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -94,46 +94,7 @@ elif os.name == "posix": - import re, tempfile +@@ -100,53 +100,7 @@ elif os.name == "posix": + return thefile.read(4) == elf_header def _findLib_gcc(name): - # Run GCC's linker with the -t (aka --trace) option and examine the @@ -51,15 +51,22 @@ index 5e8b31a854..7b45ce6c15 100644 - # Raised if the file was already removed, which is the normal - # behaviour of GCC if linking fails - pass -- res = re.search(expr, trace) +- res = re.findall(expr, trace) - if not res: - return None -- return os.fsdecode(res.group(0)) +- +- for file in res: +- # Check if the given file is an elf file: gcc can report +- # some files that are linker scripts and not actual +- # shared objects. See bpo-41976 for more details +- if not _is_elf(file): +- continue +- return os.fsdecode(file) + return None if sys.platform == "sunos5": -@@ -255,34 +216,7 @@ elif os.name == "posix": +@@ -268,34 +222,7 @@ elif os.name == "posix": else: def _findSoname_ldconfig(name): @@ -96,5 +103,5 @@ index 5e8b31a854..7b45ce6c15 100644 def _findLib_ld(name): # See issue #9998 for why this is needed -- -2.15.0 +2.28.0 diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 143662abcc9..77512c02d55 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -14,6 +14,7 @@ , self , configd , autoreconfHook +, autoconf-archive , python-setup-hook , nukeReferences # For the Python package set @@ -67,6 +68,8 @@ let nativeBuildInputs = optionals (!stdenv.isDarwin) [ autoreconfHook + ] ++ optionals (!stdenv.isDarwin && passthru.pythonAtLeast "3.10") [ + autoconf-archive # needed for AX_CHECK_COMPILE_FLAG ] ++ [ nukeReferences ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index a8db9bc9257..ae666d44f57 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -122,9 +122,9 @@ in { major = "3"; minor = "10"; patch = "0"; - suffix = "a1"; + suffix = "a2"; }; - sha256 = "0q59a99w1yad808mx4w6l0j7bk7dbd2kakngbk0w1h9z4dhr8wyv"; + sha256 = "0zl5h61s8n2w2v1n40af0mwaw7lqh5fl1ys7kyjgcph60vb9wzjr"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 9e09ad518292b2a522b6ffd38d0fc61333b94be5 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 17 Nov 2020 21:20:02 -0800 Subject: pypy, pypy3: 7.3.1 → 7.3.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- pkgs/development/interpreters/python/default.nix | 16 ++++++++-------- .../interpreters/python/pypy/tk_tcl_paths.patch | 13 +++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index ae666d44f57..f820958df53 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -160,9 +160,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "1"; + patch = "2"; }; - sha256 = "08ckkhd0ix6j9873a7gr507c72d4cmnv5lwvprlljdca9i8p2dzs"; + sha256 = "1l98b7s9sf16a5w8y0fdn7a489l3gpykjasws1j67bahhc6li2c1"; pythonVersion = "2.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; @@ -176,9 +176,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "1"; + patch = "2"; }; - sha256 = "10zsk8jby8j6visk5mzikpb1cidvz27qq4pfpa26jv53klic6b0c"; + sha256 = "03f1fdw6yk2mypa9pbmgk26r8y1hhmw801l6g36zry9zsvz7aqgx"; pythonVersion = "3.6"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; @@ -193,9 +193,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "1"; + patch = "2"; }; - sha256 = "18xc5kwidj5hjwbr0w8v1nfpg5l4lk01z8cn804zfyyz8xjqhx5y"; # linux64 + sha256 = "0fx1kp13cgx3rijd0zf8rdjbai6mfhc9is4xfc7kl5cpd88hhkwd"; # linux64 pythonVersion = "2.7"; inherit passthruFun; }; @@ -206,9 +206,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "1"; + patch = "2"; }; - sha256 = "04nv0mkalaliphbjw7y0pmb372bxwjzwmcsqkf9kwsik99kg2z7n"; # linux64 + sha256 = "10xdx7q04fzy4v4rbj9bbdw8g9y68qgaih7z2n0s5aknj0bizafp"; # linux64 pythonVersion = "3.6"; inherit passthruFun; }; diff --git a/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch b/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch index 0b78caf7e07..15d03830e07 100644 --- a/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch +++ b/pkgs/development/interpreters/python/pypy/tk_tcl_paths.patch @@ -1,13 +1,14 @@ ---- pypy-pypy-84a2f3e6a7f8.org/lib_pypy/_tkinter/tklib_build.py 2017-10-03 11:49:20.000000000 +0100 -+++ pypy-pypy-84a2f3e6a7f8/lib_pypy/_tkinter/tklib_build.py 2017-11-21 13:20:51.398607530 +0000 -@@ -17,18 +17,14 @@ +--- a/lib_pypy/_tkinter/tklib_build.py ++++ b/lib_pypy/_tkinter/tklib_build.py +@@ -17,19 +17,14 @@ elif sys.platform == 'win32': incdirs = [] linklibs = ['tcl85', 'tk85'] libdirs = [] -elif sys.platform == 'darwin': -- incdirs = ['/System/Library/Frameworks/Tk.framework/Versions/Current/Headers/'] -- linklibs = ['tcl', 'tk'] -- libdirs = [] +- # homebrew +- incdirs = ['/usr/local/opt/tcl-tk/include'] +- linklibs = ['tcl8.6', 'tk8.6'] +- libdirs = ['/usr/local/opt/tcl-tk/lib'] else: # On some Linux distributions, the tcl and tk libraries are # stored in /usr/include, so we must check this case also -- cgit 1.4.1 From b57c5d44569e236edbc142c0f95772fca2bb6dad Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 18 Nov 2020 12:13:11 -0500 Subject: python: Use `makeScopeWithSplicing` Now non-`buildInputs` that are python packages should be resolved correctly. --- .../interpreters/python/cpython/2.7/default.nix | 11 +++- .../interpreters/python/cpython/default.nix | 12 +++- pkgs/development/interpreters/python/default.nix | 70 +++++++++++++++++++--- .../interpreters/python/pypy/default.nix | 8 ++- pkgs/top-level/python-packages.nix | 13 ++-- 5 files changed, 95 insertions(+), 19 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 2cfaa69a4c8..26bd8a8f360 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -19,6 +19,10 @@ # For the Python package set , packageOverrides ? (self: super: {}) , buildPackages +, pkgsBuildBuild +, pkgsBuildTarget +, pkgsHostHost +, pkgsTargetTarget , sourceVersion , sha256 , passthruFun @@ -35,7 +39,8 @@ with stdenv.lib; let - pythonForBuild = buildPackages.${"python${sourceVersion.major}${sourceVersion.minor}"}; + pythonAttr = "python${sourceVersion.major}${sourceVersion.minor}"; + pythonForBuild = buildPackages.${pythonAttr}; passthru = passthruFun rec { inherit self sourceVersion packageOverrides; @@ -45,6 +50,10 @@ let pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; inherit hasDistutilsCxxPatch pythonForBuild; + pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; + pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; + pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; + pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; } // { inherit ucsEncoding; }; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 77512c02d55..02777063a77 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -20,7 +20,11 @@ # For the Python package set , packageOverrides ? (self: super: {}) , buildPackages -, pythonForBuild ? buildPackages.${"python${sourceVersion.major}${sourceVersion.minor}"} +, pkgsBuildBuild +, pkgsBuildTarget +, pkgsHostHost +, pkgsTargetTarget +, pythonForBuild ? buildPackages.${pythonAttr} , sourceVersion , sha256 , passthruFun @@ -36,6 +40,7 @@ # Not using optimizations on Darwin # configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found. , enableOptimizations ? (!stdenv.isDarwin) +, pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}" }: # Note: this package is used for bootstrapping fetchurl, and thus @@ -54,6 +59,7 @@ with stdenv.lib; let + passthru = passthruFun rec { inherit self sourceVersion packageOverrides; implementation = "cpython"; @@ -62,6 +68,10 @@ let pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; inherit hasDistutilsCxxPatch pythonForBuild; + pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; + pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; + pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; + pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; }; version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index ae666d44f57..19a7f44de36 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -14,13 +14,70 @@ with pkgs; , packageOverrides , sitePackages , hasDistutilsCxxPatch - , pythonForBuild - , self + , pythonPackagesBuildBuild + , pythonForBuild # provides pythonPackagesBuildHost + , pythonPackagesBuildTarget + , pythonPackagesHostHost + , self # is pythonPackagesHostTarget + , pythonPackagesTargetTarget }: let - pythonPackages = callPackage ../../../top-level/python-packages.nix { - python = self; - overrides = packageOverrides; - }; + pythonPackages = callPackage + ({ pkgs, stdenv, python, overrides }: let + pythonPackagesFun = import ../../../top-level/python-packages.nix { + inherit stdenv pkgs; + python = self; + }; + otherSplices = { + selfBuildBuild = pythonPackagesBuildBuild; + selfBuildHost = pythonForBuild.pkgs; + selfBuildTarget = pythonPackagesBuildTarget; + selfHostHost = pythonPackagesHostHost; + selfTargetTarget = pythonPackagesTargetTarget; + }; + keep = self: { + # TODO maybe only define these here so nothing is needed to be kept in sync. + inherit (self) + isPy27 isPy35 isPy36 isPy37 isPy38 isPy39 isPy3k isPyPy pythonAtLeast pythonOlder + python bootstrapped-pip buildPythonPackage buildPythonApplication + fetchPypi + hasPythonModule requiredPythonModules makePythonPath disabledIf + toPythonModule toPythonApplication + buildSetupcfg + + eggUnpackHook + eggBuildHook + eggInstallHook + flitBuildHook + pipBuildHook + pipInstallHook + pytestCheckHook + pythonCatchConflictsHook + pythonImportsCheckHook + pythonNamespacesHook + pythonRecompileBytecodeHook + pythonRemoveBinBytecodeHook + pythonRemoveTestsDirHook + setuptoolsBuildHook + setuptoolsCheckHook + venvShellHook + wheelUnpackHook + + wrapPython + + pythonPackages + + recursivePthLoader + ; + }; + in lib.makeScopeWithSplicing + pkgs.splicePackages + pkgs.newScope + otherSplices + keep + (lib.extends overrides pythonPackagesFun)) + { + overrides = packageOverrides; + }; in rec { isPy27 = pythonVersion == "2.7"; isPy35 = pythonVersion == "3.5"; @@ -48,7 +105,6 @@ with pkgs; python = self; }; }; - in { python27 = callPackage ./cpython/2.7 { diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index 482ba5df54c..0647ce87864 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -22,9 +22,15 @@ let implementation = "pypy"; libPrefix = "pypy${pythonVersion}"; executable = "pypy${if isPy3k then "3" else ""}"; - pythonForBuild = self; # No cross-compiling for now. sitePackages = "site-packages"; hasDistutilsCxxPatch = false; + + # No cross-compiling for now. + pythonForBuild = self; + pythonPackagesBuildBuild = {}; + pythonPackagesBuildTarget = {}; + pythonPackagesHostHost = {}; + pythonPackagesTargetTarget = {}; }; pname = passthru.executable; version = with sourceVersion; "${major}.${minor}.${patch}"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ae79ca29f69..909cd5cfe0a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -9,19 +9,16 @@ { pkgs , stdenv , python -, overrides ? (self: super: {}) }: with pkgs.lib; -let - packages = ( self: +self: let + inherit (self) callPackage; inherit (python.passthru) isPy27 isPy35 isPy36 isPy37 isPy38 isPy39 isPy3k isPyPy pythonAtLeast pythonOlder; - callPackage = pkgs.newScope self; - namePrefix = python.libPrefix + "-"; bootstrapped-pip = callPackage ../development/python-modules/bootstrapped-pip { }; @@ -102,7 +99,7 @@ in { inherit (python.passthru) isPy27 isPy35 isPy36 isPy37 isPy38 isPy39 isPy3k isPyPy pythonAtLeast pythonOlder; inherit python bootstrapped-pip buildPythonPackage buildPythonApplication; - inherit fetchPypi callPackage; + inherit fetchPypi; inherit hasPythonModule requiredPythonModules makePythonPath disabledIf; inherit toPythonModule toPythonApplication; inherit buildSetupcfg; @@ -7960,6 +7957,4 @@ in { zxcvbn = callPackage ../development/python-modules/zxcvbn { }; -}); - -in fix' (extends overrides packages) +} -- cgit 1.4.1 From cce2fd547be73f6a709d86751b67e9ae798f5d46 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Fri, 27 Nov 2020 16:24:42 +0100 Subject: Python: use pythonPackagesBuildHost instead of pythonForBuild Follow-up to #104201, related to #105113. --- .../interpreters/python/cpython/2.7/default.nix | 11 ++++++----- .../development/interpreters/python/cpython/default.nix | 11 +++++------ pkgs/development/interpreters/python/default.nix | 8 ++++---- pkgs/development/interpreters/python/pypy/default.nix | 17 +++++++++++------ 4 files changed, 26 insertions(+), 21 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 26bd8a8f360..d7bc5094859 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -18,8 +18,8 @@ , ucsEncoding ? 4 # For the Python package set , packageOverrides ? (self: super: {}) -, buildPackages , pkgsBuildBuild +, pkgsBuildHost , pkgsBuildTarget , pkgsHostHost , pkgsTargetTarget @@ -28,6 +28,7 @@ , passthruFun , static ? false , enableOptimizations ? (!stdenv.isDarwin) +, pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}" }: assert x11Support -> tcl != null @@ -38,9 +39,8 @@ assert x11Support -> tcl != null with stdenv.lib; let - - pythonAttr = "python${sourceVersion.major}${sourceVersion.minor}"; - pythonForBuild = buildPackages.${pythonAttr}; + buildPackages = pkgsBuildHost; + inherit (passthru) pythonForBuild; passthru = passthruFun rec { inherit self sourceVersion packageOverrides; @@ -49,8 +49,9 @@ let executable = libPrefix; pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; - inherit hasDistutilsCxxPatch pythonForBuild; + inherit hasDistutilsCxxPatch; pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; + pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 02777063a77..5e7668deea3 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -19,12 +19,11 @@ , nukeReferences # For the Python package set , packageOverrides ? (self: super: {}) -, buildPackages , pkgsBuildBuild +, pkgsBuildHost , pkgsBuildTarget , pkgsHostHost , pkgsTargetTarget -, pythonForBuild ? buildPackages.${pythonAttr} , sourceVersion , sha256 , passthruFun @@ -58,7 +57,8 @@ assert bluezSupport -> bluez != null; with stdenv.lib; let - + buildPackages = pkgsBuildHost; + inherit (passthru) pythonForBuild; passthru = passthruFun rec { inherit self sourceVersion packageOverrides; @@ -67,8 +67,9 @@ let executable = libPrefix; pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; - inherit hasDistutilsCxxPatch pythonForBuild; + inherit hasDistutilsCxxPatch; pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; + pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; @@ -95,8 +96,6 @@ let hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false); - inherit pythonForBuild; - pythonForBuildInterpreter = if stdenv.hostPlatform == stdenv.buildPlatform then "$out/bin/python" else pythonForBuild.interpreter; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 19a7f44de36..876cfd20fb9 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -15,7 +15,7 @@ with pkgs; , sitePackages , hasDistutilsCxxPatch , pythonPackagesBuildBuild - , pythonForBuild # provides pythonPackagesBuildHost + , pythonPackagesBuildHost , pythonPackagesBuildTarget , pythonPackagesHostHost , self # is pythonPackagesHostTarget @@ -29,7 +29,7 @@ with pkgs; }; otherSplices = { selfBuildBuild = pythonPackagesBuildBuild; - selfBuildHost = pythonForBuild.pkgs; + selfBuildHost = pythonPackagesBuildHost; selfBuildTarget = pythonPackagesBuildTarget; selfHostHost = pythonPackagesHostHost; selfTargetTarget = pythonPackagesTargetTarget; @@ -99,7 +99,8 @@ with pkgs; inherit sourceVersion; pythonAtLeast = lib.versionAtLeast pythonVersion; pythonOlder = lib.versionOlder pythonVersion; - inherit hasDistutilsCxxPatch pythonForBuild; + inherit hasDistutilsCxxPatch; + pythonForBuild = pythonPackagesBuildHost; tests = callPackage ./tests.nix { python = self; @@ -188,7 +189,6 @@ in { # Minimal versions of Python (built without optional dependencies) python3Minimal = (python38.override { self = python3Minimal; - pythonForBuild = pkgs.buildPackages.python3Minimal; # strip down that python version as much as possible openssl = null; readline = null; diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index 0647ce87864..b941750eb4e 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -5,10 +5,16 @@ , python-setup-hook # For the Python package set , packageOverrides ? (self: super: {}) +, pkgsBuildBuild +, pkgsBuildHost +, pkgsBuildTarget +, pkgsHostHost +, pkgsTargetTarget , sourceVersion , pythonVersion , sha256 , passthruFun +, pythonAttr ? "pypy${stdenv.lib.substring 0 1 pythonVersion}${stdenv.lib.substring 2 3 pythonVersion}" }: assert zlibSupport -> zlib != null; @@ -25,12 +31,11 @@ let sitePackages = "site-packages"; hasDistutilsCxxPatch = false; - # No cross-compiling for now. - pythonForBuild = self; - pythonPackagesBuildBuild = {}; - pythonPackagesBuildTarget = {}; - pythonPackagesHostHost = {}; - pythonPackagesTargetTarget = {}; + pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; + pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; + pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; + pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; + pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; }; pname = passthru.executable; version = with sourceVersion; "${major}.${minor}.${patch}"; -- cgit 1.4.1 From 6cf25f9dbdef12c36748f322f7414a1d04c8dcd7 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 28 Nov 2020 16:56:51 +0100 Subject: Python: rename parameters and arguments passed to passthru As part of the splicing the build/host/target combinations of the interpreter need to be passed around internally. The chosen names were not very clear, implying they were package sets whereas actually there were derivations. --- .../interpreters/python/cpython/2.7/default.nix | 10 ++++----- .../interpreters/python/cpython/default.nix | 10 ++++----- pkgs/development/interpreters/python/default.nix | 24 +++++++++++----------- .../interpreters/python/pypy/default.nix | 10 ++++----- 4 files changed, 27 insertions(+), 27 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index d7bc5094859..e6ab1f21879 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -50,11 +50,11 @@ let pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; inherit hasDistutilsCxxPatch; - pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; - pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; - pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; - pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; - pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; + pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr}; + pythonOnBuildForHost = pkgsBuildHost.${pythonAttr}; + pythonOnBuildForTarget = pkgsBuildTarget.${pythonAttr}; + pythonOnHostForHost = pkgsHostHost.${pythonAttr}; + pythonOnTargetForTarget = pkgsTargetTarget.${pythonAttr} or {}; } // { inherit ucsEncoding; }; diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 5e7668deea3..cd06c2b6367 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -68,11 +68,11 @@ let pythonVersion = with sourceVersion; "${major}.${minor}"; sitePackages = "lib/${libPrefix}/site-packages"; inherit hasDistutilsCxxPatch; - pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; - pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; - pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; - pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; - pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; + pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr}; + pythonOnBuildForHost = pkgsBuildHost.${pythonAttr}; + pythonOnBuildForTarget = pkgsBuildTarget.${pythonAttr}; + pythonOnHostForHost = pkgsHostHost.${pythonAttr}; + pythonOnTargetForTarget = pkgsTargetTarget.${pythonAttr} or {}; }; version = with sourceVersion; "${major}.${minor}.${patch}${suffix}"; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 876cfd20fb9..91a464ea463 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -14,12 +14,12 @@ with pkgs; , packageOverrides , sitePackages , hasDistutilsCxxPatch - , pythonPackagesBuildBuild - , pythonPackagesBuildHost - , pythonPackagesBuildTarget - , pythonPackagesHostHost - , self # is pythonPackagesHostTarget - , pythonPackagesTargetTarget + , pythonOnBuildForBuild + , pythonOnBuildForHost + , pythonOnBuildForTarget + , pythonOnHostForHost + , pythonOnTargetForTarget + , self # is pythonOnHostForTarget }: let pythonPackages = callPackage ({ pkgs, stdenv, python, overrides }: let @@ -28,11 +28,11 @@ with pkgs; python = self; }; otherSplices = { - selfBuildBuild = pythonPackagesBuildBuild; - selfBuildHost = pythonPackagesBuildHost; - selfBuildTarget = pythonPackagesBuildTarget; - selfHostHost = pythonPackagesHostHost; - selfTargetTarget = pythonPackagesTargetTarget; + selfBuildBuild = pythonOnBuildForBuild; + selfBuildHost = pythonOnBuildForHost; + selfBuildTarget = pythonOnBuildForTarget; + selfHostHost = pythonOnHostForHost; + selfTargetTarget = pythonOnTargetForTarget; }; keep = self: { # TODO maybe only define these here so nothing is needed to be kept in sync. @@ -100,7 +100,7 @@ with pkgs; pythonAtLeast = lib.versionAtLeast pythonVersion; pythonOlder = lib.versionOlder pythonVersion; inherit hasDistutilsCxxPatch; - pythonForBuild = pythonPackagesBuildHost; + pythonForBuild = pythonOnBuildForHost; tests = callPackage ./tests.nix { python = self; diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index b941750eb4e..8feeb3c51bf 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -31,11 +31,11 @@ let sitePackages = "site-packages"; hasDistutilsCxxPatch = false; - pythonPackagesBuildBuild = pkgsBuildBuild.${pythonAttr}; - pythonPackagesBuildHost = pkgsBuildHost.${pythonAttr}; - pythonPackagesBuildTarget = pkgsBuildTarget.${pythonAttr}; - pythonPackagesHostHost = pkgsHostHost.${pythonAttr}; - pythonPackagesTargetTarget = pkgsTargetTarget.${pythonAttr} or {}; + pythonOnBuildForBuild = pkgsBuildBuild.${pythonAttr}; + pythonOnBuildForHost = pkgsBuildHost.${pythonAttr}; + pythonOnBuildForTarget = pkgsBuildTarget.${pythonAttr}; + pythonOnHostForHost = pkgsHostHost.${pythonAttr}; + pythonOnTargetForTarget = pkgsTargetTarget.${pythonAttr} or {}; }; pname = passthru.executable; version = with sourceVersion; "${major}.${minor}.${patch}"; -- cgit 1.4.1 From 5804c8a7f5f0db0ebefb4aa612cc7a254debd57a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 28 Nov 2020 17:06:08 +0100 Subject: Python splicing: splice package sets, not Python derivation In the original commit the various builds of Python were added to `otherSplices`, instead of the intended Python package sets. --- pkgs/development/interpreters/python/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 91a464ea463..e98cb89b77d 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -28,11 +28,11 @@ with pkgs; python = self; }; otherSplices = { - selfBuildBuild = pythonOnBuildForBuild; - selfBuildHost = pythonOnBuildForHost; - selfBuildTarget = pythonOnBuildForTarget; - selfHostHost = pythonOnHostForHost; - selfTargetTarget = pythonOnTargetForTarget; + selfBuildBuild = pythonOnBuildForBuild.pkgs; + selfBuildHost = pythonOnBuildForHost.pkgs; + selfBuildTarget = pythonOnBuildForTarget.pkgs; + selfHostHost = pythonOnHostForHost.pkgs; + selfTargetTarget = pythonOnTargetForTarget.pkgs or {}; # There is no Python TargetTarget. }; keep = self: { # TODO maybe only define these here so nothing is needed to be kept in sync. -- cgit 1.4.1 From 455774e5466681a90f864125424871bfe2a504d2 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 28 Nov 2020 17:33:28 +0100 Subject: Python: add todo note regarding pythonForBuild --- pkgs/development/interpreters/python/default.nix | 2 ++ 1 file changed, 2 insertions(+) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index e98cb89b77d..2f350738238 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -100,6 +100,8 @@ with pkgs; pythonAtLeast = lib.versionAtLeast pythonVersion; pythonOlder = lib.versionOlder pythonVersion; inherit hasDistutilsCxxPatch; + # TODO: rename to pythonOnBuild + # Not done immediately because its likely used outside Nixpkgs. pythonForBuild = pythonOnBuildForHost; tests = callPackage ./tests.nix { -- cgit 1.4.1 From 49b8738a5fd4e73286bba95012f519f365a86600 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 30 Nov 2020 11:12:59 +0100 Subject: python: Propagate packageOverrides to pythonForBuild When overriding versions of build tools injected via hooks `packageOverrides` was not taken into account and 2 incompatible versions of the same package (`wheel` in this case) ended up in the closure, causing the builds to fail. --- pkgs/development/interpreters/python/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 2f350738238..7c3f94dcd16 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -102,7 +102,7 @@ with pkgs; inherit hasDistutilsCxxPatch; # TODO: rename to pythonOnBuild # Not done immediately because its likely used outside Nixpkgs. - pythonForBuild = pythonOnBuildForHost; + pythonForBuild = pythonOnBuildForHost.override { inherit packageOverrides; self = pythonForBuild; }; tests = callPackage ./tests.nix { python = self; -- cgit 1.4.1 From 42d28c2a77ae2370daeaa6ec82046e3b53c6210a Mon Sep 17 00:00:00 2001 From: Greg Roodt Date: Fri, 11 Dec 2020 14:04:26 +1100 Subject: python: 3.9.0 -> 3.9.1 --- .../python/cpython/3.9/no-ldconfig.patch | 44 ++++++++++++---------- pkgs/development/interpreters/python/default.nix | 4 +- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.9/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.9/no-ldconfig.patch index a1f9d68eb16..41d3ab52345 100644 --- a/pkgs/development/interpreters/python/cpython/3.9/no-ldconfig.patch +++ b/pkgs/development/interpreters/python/cpython/3.9/no-ldconfig.patch @@ -1,19 +1,19 @@ -From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 -From: Frederik Rietdijk -Date: Mon, 28 Aug 2017 09:24:06 +0200 +From 66f492d2eda94bd64db833839a325caf6ba0fed5 Mon Sep 17 00:00:00 2001 +From: Greg Roodt +Date: Wed, 9 Dec 2020 17:59:24 +1100 Subject: [PATCH] Don't use ldconfig --- - Lib/ctypes/util.py | 70 ++---------------------------------------------------- - 1 file changed, 2 insertions(+), 68 deletions(-) + Lib/ctypes/util.py | 77 ++-------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 5e8b31a854..7b45ce6c15 100644 +index 0c2510e161..7fb98af308 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -94,46 +94,7 @@ elif os.name == "posix": - import re, tempfile - +@@ -100,53 +100,7 @@ elif os.name == "posix": + return thefile.read(4) == elf_header + def _findLib_gcc(name): - # Run GCC's linker with the -t (aka --trace) option and examine the - # library name it prints out. The GCC command will fail because we @@ -51,17 +51,24 @@ index 5e8b31a854..7b45ce6c15 100644 - # Raised if the file was already removed, which is the normal - # behaviour of GCC if linking fails - pass -- res = re.search(expr, trace) +- res = re.findall(expr, trace) - if not res: - return None -- return os.fsdecode(res.group(0)) +- +- for file in res: +- # Check if the given file is an elf file: gcc can report +- # some files that are linker scripts and not actual +- # shared objects. See bpo-41976 for more details +- if not _is_elf(file): +- continue +- return os.fsdecode(file) + return None - - + + if sys.platform == "sunos5": -@@ -255,34 +216,7 @@ elif os.name == "posix": +@@ -268,34 +222,7 @@ elif os.name == "posix": else: - + def _findSoname_ldconfig(name): - import struct - if struct.calcsize('l') == 4: @@ -92,9 +99,8 @@ index 5e8b31a854..7b45ce6c15 100644 - except OSError: - pass + return None - + def _findLib_ld(name): # See issue #9998 for why this is needed --- -2.15.0 - +-- +2.24.3 (Apple Git-128) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 7c3f94dcd16..0117d847e5e 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -167,10 +167,10 @@ in { sourceVersion = { major = "3"; minor = "9"; - patch = "0"; + patch = "1"; suffix = ""; }; - sha256 = "0m18z05nlmqm1zjw9s0ifgrn1jvjn3jwjg0bpswhjmw5k4yfcwww"; + sha256 = "1zq3k4ymify5ig739zyvx9s2ainvchxb1zpy139z74krr653y74r"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 222fafa02bb09611438490ac028721bab2383dda Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 8 Dec 2020 16:30:03 -0800 Subject: python310: 3.10.0a2 -> 3.10.0a3 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 7c3f94dcd16..1a178940fe6 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -181,9 +181,9 @@ in { major = "3"; minor = "10"; patch = "0"; - suffix = "a2"; + suffix = "a3"; }; - sha256 = "0zl5h61s8n2w2v1n40af0mwaw7lqh5fl1ys7kyjgcph60vb9wzjr"; + sha256 = "sha256-sJjJdAdxOUfX7W7VioSGdxlgp2lyMOPZjg42MCd/JYY="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 507efdb11fcdbf59199b2fe4717d6799ff623a2a Mon Sep 17 00:00:00 2001 From: Drew Hess Date: Sun, 27 Dec 2020 02:57:44 +0000 Subject: python: 3.8.6 -> 3.8.7. --- .../python/cpython/3.8/no-ldconfig.patch | 44 ++++++++++++---------- pkgs/development/interpreters/python/default.nix | 4 +- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch index a1f9d68eb16..41d3ab52345 100644 --- a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch +++ b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch @@ -1,19 +1,19 @@ -From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 -From: Frederik Rietdijk -Date: Mon, 28 Aug 2017 09:24:06 +0200 +From 66f492d2eda94bd64db833839a325caf6ba0fed5 Mon Sep 17 00:00:00 2001 +From: Greg Roodt +Date: Wed, 9 Dec 2020 17:59:24 +1100 Subject: [PATCH] Don't use ldconfig --- - Lib/ctypes/util.py | 70 ++---------------------------------------------------- - 1 file changed, 2 insertions(+), 68 deletions(-) + Lib/ctypes/util.py | 77 ++-------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 5e8b31a854..7b45ce6c15 100644 +index 0c2510e161..7fb98af308 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -94,46 +94,7 @@ elif os.name == "posix": - import re, tempfile - +@@ -100,53 +100,7 @@ elif os.name == "posix": + return thefile.read(4) == elf_header + def _findLib_gcc(name): - # Run GCC's linker with the -t (aka --trace) option and examine the - # library name it prints out. The GCC command will fail because we @@ -51,17 +51,24 @@ index 5e8b31a854..7b45ce6c15 100644 - # Raised if the file was already removed, which is the normal - # behaviour of GCC if linking fails - pass -- res = re.search(expr, trace) +- res = re.findall(expr, trace) - if not res: - return None -- return os.fsdecode(res.group(0)) +- +- for file in res: +- # Check if the given file is an elf file: gcc can report +- # some files that are linker scripts and not actual +- # shared objects. See bpo-41976 for more details +- if not _is_elf(file): +- continue +- return os.fsdecode(file) + return None - - + + if sys.platform == "sunos5": -@@ -255,34 +216,7 @@ elif os.name == "posix": +@@ -268,34 +222,7 @@ elif os.name == "posix": else: - + def _findSoname_ldconfig(name): - import struct - if struct.calcsize('l') == 4: @@ -92,9 +99,8 @@ index 5e8b31a854..7b45ce6c15 100644 - except OSError: - pass + return None - + def _findLib_ld(name): # See issue #9998 for why this is needed --- -2.15.0 - +-- +2.24.3 (Apple Git-128) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index a217f62986d..70a4731ea6d 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -154,10 +154,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "6"; + patch = "7"; suffix = ""; }; - sha256 = "qeC3nSeqBW65zOjWOkJ7X5urFGXe4/lC3P2yWoL0q4o="; + sha256 = "sha256-3cwd8Wu1uHqkLsXSCluQLy0IjKommyjgFZD5enmOxQo="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From e1ed9b3b0851b95d3e82fb1085a121531c32a42a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 4 Jan 2021 20:58:21 +0100 Subject: Revert "python: 3.8.6 -> 3.8.7." Need to fix a patch first. Next iteration. This reverts commit 507efdb11fcdbf59199b2fe4717d6799ff623a2a. --- .../python/cpython/3.8/no-ldconfig.patch | 44 ++++++++++------------ pkgs/development/interpreters/python/default.nix | 4 +- 2 files changed, 21 insertions(+), 27 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch index 41d3ab52345..a1f9d68eb16 100644 --- a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch +++ b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch @@ -1,19 +1,19 @@ -From 66f492d2eda94bd64db833839a325caf6ba0fed5 Mon Sep 17 00:00:00 2001 -From: Greg Roodt -Date: Wed, 9 Dec 2020 17:59:24 +1100 +From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk +Date: Mon, 28 Aug 2017 09:24:06 +0200 Subject: [PATCH] Don't use ldconfig --- - Lib/ctypes/util.py | 77 ++-------------------------------------------- - 1 file changed, 2 insertions(+), 75 deletions(-) + Lib/ctypes/util.py | 70 ++---------------------------------------------------- + 1 file changed, 2 insertions(+), 68 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 0c2510e161..7fb98af308 100644 +index 5e8b31a854..7b45ce6c15 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -100,53 +100,7 @@ elif os.name == "posix": - return thefile.read(4) == elf_header - +@@ -94,46 +94,7 @@ elif os.name == "posix": + import re, tempfile + def _findLib_gcc(name): - # Run GCC's linker with the -t (aka --trace) option and examine the - # library name it prints out. The GCC command will fail because we @@ -51,24 +51,17 @@ index 0c2510e161..7fb98af308 100644 - # Raised if the file was already removed, which is the normal - # behaviour of GCC if linking fails - pass -- res = re.findall(expr, trace) +- res = re.search(expr, trace) - if not res: - return None -- -- for file in res: -- # Check if the given file is an elf file: gcc can report -- # some files that are linker scripts and not actual -- # shared objects. See bpo-41976 for more details -- if not _is_elf(file): -- continue -- return os.fsdecode(file) +- return os.fsdecode(res.group(0)) + return None - - + + if sys.platform == "sunos5": -@@ -268,34 +222,7 @@ elif os.name == "posix": +@@ -255,34 +216,7 @@ elif os.name == "posix": else: - + def _findSoname_ldconfig(name): - import struct - if struct.calcsize('l') == 4: @@ -99,8 +92,9 @@ index 0c2510e161..7fb98af308 100644 - except OSError: - pass + return None - + def _findLib_ld(name): # See issue #9998 for why this is needed --- -2.24.3 (Apple Git-128) +-- +2.15.0 + diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 70a4731ea6d..a217f62986d 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -154,10 +154,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "7"; + patch = "6"; suffix = ""; }; - sha256 = "sha256-3cwd8Wu1uHqkLsXSCluQLy0IjKommyjgFZD5enmOxQo="; + sha256 = "qeC3nSeqBW65zOjWOkJ7X5urFGXe4/lC3P2yWoL0q4o="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 7c61ecbefd03ead36318b5b7d22c7b75e5db481e Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 9 Jan 2021 08:52:29 +0100 Subject: Revert "Revert "python: 3.8.6 -> 3.8.7."" This was originally reverted because of an invalid patch. This has been fixed and now we want this update again. This reverts commit e1ed9b3b0851b95d3e82fb1085a121531c32a42a. --- .../python/cpython/3.8/no-ldconfig.patch | 44 ++++++++++++---------- pkgs/development/interpreters/python/default.nix | 4 +- 2 files changed, 27 insertions(+), 21 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch index a1f9d68eb16..41d3ab52345 100644 --- a/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch +++ b/pkgs/development/interpreters/python/cpython/3.8/no-ldconfig.patch @@ -1,19 +1,19 @@ -From 597e73f2a4b2f0b508127931b36d5540d6941823 Mon Sep 17 00:00:00 2001 -From: Frederik Rietdijk -Date: Mon, 28 Aug 2017 09:24:06 +0200 +From 66f492d2eda94bd64db833839a325caf6ba0fed5 Mon Sep 17 00:00:00 2001 +From: Greg Roodt +Date: Wed, 9 Dec 2020 17:59:24 +1100 Subject: [PATCH] Don't use ldconfig --- - Lib/ctypes/util.py | 70 ++---------------------------------------------------- - 1 file changed, 2 insertions(+), 68 deletions(-) + Lib/ctypes/util.py | 77 ++-------------------------------------------- + 1 file changed, 2 insertions(+), 75 deletions(-) diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py -index 5e8b31a854..7b45ce6c15 100644 +index 0c2510e161..7fb98af308 100644 --- a/Lib/ctypes/util.py +++ b/Lib/ctypes/util.py -@@ -94,46 +94,7 @@ elif os.name == "posix": - import re, tempfile - +@@ -100,53 +100,7 @@ elif os.name == "posix": + return thefile.read(4) == elf_header + def _findLib_gcc(name): - # Run GCC's linker with the -t (aka --trace) option and examine the - # library name it prints out. The GCC command will fail because we @@ -51,17 +51,24 @@ index 5e8b31a854..7b45ce6c15 100644 - # Raised if the file was already removed, which is the normal - # behaviour of GCC if linking fails - pass -- res = re.search(expr, trace) +- res = re.findall(expr, trace) - if not res: - return None -- return os.fsdecode(res.group(0)) +- +- for file in res: +- # Check if the given file is an elf file: gcc can report +- # some files that are linker scripts and not actual +- # shared objects. See bpo-41976 for more details +- if not _is_elf(file): +- continue +- return os.fsdecode(file) + return None - - + + if sys.platform == "sunos5": -@@ -255,34 +216,7 @@ elif os.name == "posix": +@@ -268,34 +222,7 @@ elif os.name == "posix": else: - + def _findSoname_ldconfig(name): - import struct - if struct.calcsize('l') == 4: @@ -92,9 +99,8 @@ index 5e8b31a854..7b45ce6c15 100644 - except OSError: - pass + return None - + def _findLib_ld(name): # See issue #9998 for why this is needed --- -2.15.0 - +-- +2.24.3 (Apple Git-128) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index a217f62986d..70a4731ea6d 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -154,10 +154,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "6"; + patch = "7"; suffix = ""; }; - sha256 = "qeC3nSeqBW65zOjWOkJ7X5urFGXe4/lC3P2yWoL0q4o="; + sha256 = "sha256-3cwd8Wu1uHqkLsXSCluQLy0IjKommyjgFZD5enmOxQo="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 2497553b233694b20b07f2fc85b3b3f7bed53a39 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 10 Jan 2021 12:03:59 +0100 Subject: toplevel: stdenv.lib -> lib The library does not depend on stdenv, that `stdenv` exposes `lib` is an artifact of the ancient origins of nixpkgs. --- pkgs/development/interpreters/python/default.nix | 2 +- pkgs/top-level/aliases.nix | 2 +- pkgs/top-level/all-packages.nix | 52 +++++++-------- pkgs/top-level/dotnet-packages.nix | 81 ++++++++++++------------ pkgs/top-level/emscripten-packages.nix | 2 +- pkgs/top-level/haxe-packages.nix | 14 ++-- pkgs/top-level/lua-packages.nix | 6 +- pkgs/top-level/python-packages.nix | 5 +- 8 files changed, 83 insertions(+), 81 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index a217f62986d..c1a61fb6a8b 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -24,7 +24,7 @@ with pkgs; pythonPackages = callPackage ({ pkgs, stdenv, python, overrides }: let pythonPackagesFun = import ../../../top-level/python-packages.nix { - inherit stdenv pkgs; + inherit stdenv pkgs lib; python = self; }; otherSplices = { diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 5b5a91c116a..f95c6e8bc51 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -284,7 +284,7 @@ mapAliases ({ libgnome_keyring3 = libgnome-keyring3; # added 2018-02-25 libgumbo = gumbo; # added 2018-01-21 libGL_driver = mesa.drivers; # added 2019-05-28 - libintlOrEmpty = stdenv.lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # added 2018-03-14 + libintlOrEmpty = lib.optional (!stdenv.isLinux || stdenv.hostPlatform.libc != "glibc") gettext; # added 2018-03-14 libjpeg_drop = libjpeg_original; # added 2020-06-05 libjson_rpc_cpp = libjson-rpc-cpp; # added 2017-02-28 liblapackWithoutAtlas = lapack-reference; # added 2018-11-05 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 966d8fa08b1..ff922ccd2d1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6721,11 +6721,11 @@ in libcap = if stdenv.isDarwin then null else libcap; }; - pinentry-curses = (stdenv.lib.getOutput "curses" pinentry); - pinentry-emacs = (stdenv.lib.getOutput "emacs" pinentry); - pinentry-gtk2 = (stdenv.lib.getOutput "gtk2" pinentry); - pinentry-qt = (stdenv.lib.getOutput "qt" pinentry); - pinentry-gnome = (stdenv.lib.getOutput "gnome3" pinentry); + pinentry-curses = (lib.getOutput "curses" pinentry); + pinentry-emacs = (lib.getOutput "emacs" pinentry); + pinentry-gtk2 = (lib.getOutput "gtk2" pinentry); + pinentry-qt = (lib.getOutput "qt" pinentry); + pinentry-gnome = (lib.getOutput "gnome3" pinentry); pinentry_mac = callPackage ../tools/security/pinentry/mac.nix { inherit (darwin.apple_sdk.frameworks) Cocoa; @@ -9185,7 +9185,7 @@ in mkdir -p "$rsrc/lib" ln -s "${cc}/lib" "$rsrc/include" echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags - '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' + '' + lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) '' echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags ''; }; @@ -10070,7 +10070,7 @@ in inherit (stdenvAdapters) overrideCC; buildLlvmTools = buildPackages.llvmPackages_11.tools; targetLlvmLibraries = targetPackages.llvmPackages_11.libraries; - } // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) { + } // lib.optionalAttrs (stdenv.hostPlatform.isi686 && buildPackages.stdenv.cc.isGNU) { stdenv = gcc7Stdenv; }); @@ -10535,7 +10535,7 @@ in # want the C++ library to be explicitly chosen by the caller, and null by # default. libcxx ? null - , extraPackages ? stdenv.lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross + , extraPackages ? lib.optional (cc.isGNU or false && stdenv.targetPlatform.isMinGW) threadsCross , ... } @ extraArgs: callPackage ../build-support/cc-wrapper (let self = { @@ -11031,7 +11031,7 @@ in spidermonkey_1_8_5 = callPackage ../development/interpreters/spidermonkey/1.8.5.nix { }; spidermonkey_38 = callPackage ../development/interpreters/spidermonkey/38.nix ({ inherit (darwin) libobjc; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); spidermonkey_60 = callPackage ../development/interpreters/spidermonkey/60.nix { }; @@ -12618,7 +12618,7 @@ in arrayfire = callPackage ../development/libraries/arrayfire {}; arrow-cpp = callPackage ../development/libraries/arrow-cpp ({ - } // stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = overrideCC stdenv buildPackages.gcc6; # hidden symbol `__divmoddi4' }); @@ -13757,42 +13757,42 @@ in icu58 = callPackage (import ../development/libraries/icu/58.nix fetchurl) ({ nativeBuildRoot = buildPackages.icu58.override { buildRootOnly = true; }; } // - (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu59 = callPackage ../development/libraries/icu/59.nix ({ nativeBuildRoot = buildPackages.icu59.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu60 = callPackage ../development/libraries/icu/60.nix ({ nativeBuildRoot = buildPackages.icu60.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu63 = callPackage ../development/libraries/icu/63.nix ({ nativeBuildRoot = buildPackages.icu63.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu64 = callPackage ../development/libraries/icu/64.nix ({ nativeBuildRoot = buildPackages.icu64.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu65 = callPackage ../development/libraries/icu/65.nix ({ nativeBuildRoot = buildPackages.icu65.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu66 = callPackage ../development/libraries/icu/66.nix ({ nativeBuildRoot = buildPackages.icu66.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); icu67 = callPackage ../development/libraries/icu/67.nix ({ nativeBuildRoot = buildPackages.icu67.override { buildRootOnly = true; }; - } // (stdenv.lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { + } // (lib.optionalAttrs (stdenv.hostPlatform.isi686 && stdenv.cc.isGNU) { stdenv = gcc6Stdenv; # with gcc-7: undefined reference to `__divmoddi4' })); @@ -17654,7 +17654,7 @@ in pulseaudio = callPackage ../servers/pulseaudio ({ inherit (darwin.apple_sdk.frameworks) CoreServices AudioUnit Cocoa; - } // stdenv.lib.optionalAttrs stdenv.isDarwin { + } // lib.optionalAttrs stdenv.isDarwin { # Default autoreconfHook (2.70) fails on darwin, # with "configure: error: *** Compiler does not support -std=gnu11" autoreconfHook = buildPackages.autoreconfHook269; @@ -18840,9 +18840,9 @@ in hyperv-daemons = callPackage ../os-specific/linux/hyperv-daemons { }; - e1000e = if stdenv.lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null; + e1000e = if lib.versionOlder kernel.version "4.10" then callPackage ../os-specific/linux/e1000e {} else null; - intel-speed-select = if stdenv.lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null; + intel-speed-select = if lib.versionAtLeast kernel.version "5.3" then callPackage ../os-specific/linux/intel-speed-select { } else null; ixgbevf = callPackage ../os-specific/linux/ixgbevf {}; @@ -18923,14 +18923,14 @@ in netatop = callPackage ../os-specific/linux/netatop { }; - oci-seccomp-bpf-hook = if stdenv.lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/oci-seccomp-bpf-hook { } else null; + oci-seccomp-bpf-hook = if lib.versionAtLeast kernel.version "5.4" then callPackage ../os-specific/linux/oci-seccomp-bpf-hook { } else null; perf = callPackage ../os-specific/linux/kernel/perf.nix { }; - phc-intel = if stdenv.lib.versionAtLeast kernel.version "4.10" then callPackage ../os-specific/linux/phc-intel { } else null; + phc-intel = if lib.versionAtLeast kernel.version "4.10" then callPackage ../os-specific/linux/phc-intel { } else null; # Disable for kernels 4.15 and above due to compatibility issues - prl-tools = if stdenv.lib.versionOlder kernel.version "4.15" then callPackage ../os-specific/linux/prl-tools { } else null; + prl-tools = if lib.versionOlder kernel.version "4.15" then callPackage ../os-specific/linux/prl-tools { } else null; sch_cake = callPackage ../os-specific/linux/sch_cake { }; @@ -21158,7 +21158,7 @@ in dablin = callPackage ../applications/radio/dablin { }; darcs = haskell.lib.overrideCabal (haskell.lib.justStaticExecutables haskellPackages.darcs) (drv: { - configureFlags = (stdenv.lib.remove "-flibrary" drv.configureFlags or []) ++ ["-f-library"]; + configureFlags = (lib.remove "-flibrary" drv.configureFlags or []) ++ ["-f-library"]; }); darktable = callPackage ../applications/graphics/darktable { @@ -27536,7 +27536,7 @@ in ifstat-legacy = callPackage ../tools/networking/ifstat-legacy { }; isabelle = callPackage ../applications/science/logic/isabelle { - polyml = stdenv.lib.overrideDerivation polyml (attrs: { + polyml = lib.overrideDerivation polyml (attrs: { configureFlags = [ "--enable-intinf-as-int" "--with-gmp" "--disable-shared" ]; }); diff --git a/pkgs/top-level/dotnet-packages.nix b/pkgs/top-level/dotnet-packages.nix index 9c659e655e9..91c1549a3b0 100644 --- a/pkgs/top-level/dotnet-packages.nix +++ b/pkgs/top-level/dotnet-packages.nix @@ -1,4 +1,5 @@ { stdenv +, lib , pkgs , buildDotnetPackage , fetchurl @@ -363,7 +364,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { echo 'au BufRead,BufNewFile *.bpl set filetype=boogie' > $vimdir/ftdetect/bpl.vim ''; - meta = with stdenv.lib; { + meta = with lib; { description = "An intermediate verification language"; homepage = "https://github.com/boogie-org/boogie"; longDescription = '' @@ -437,7 +438,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { rm -f $out/lib/dotnet/${baseName}/dafny{,-server} ''; - meta = with stdenv.lib; { + meta = with lib; { description = "A programming language with built-in specification constructs"; homepage = "https://research.microsoft.com/dafny"; maintainers = with maintainers; [ layus ]; @@ -477,9 +478,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "Excel-DNA is an independent project to integrate .NET into Excel"; homepage = "https://excel-dna.net/"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -506,9 +507,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "This library implements helper functions to assist and modify the Excel-DNA function registration"; homepage = "https://github.com/Excel-DNA/Registration"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -540,9 +541,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "ExtCore is an extended core library for F#"; homepage = "https://github.com/jack-pappas/ExtCore"; - license = stdenv.lib.licenses.asl20; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; broken = true; }; }; @@ -576,9 +577,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { service for rich editing or 'intellisense' features for editors. ''; homepage = "https://github.com/fsharp/FSharp.AutoComplete"; - license = stdenv.lib.licenses.asl20; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -603,9 +604,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "The F# compiler services package is a component derived from the F# compiler source code that exposes additional functionality for implementing F# language bindings"; homepage = "https://fsharp.github.io/FSharp.Compiler.Service/"; - license = stdenv.lib.licenses.asl20; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -647,9 +648,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "F# Data: Library for Data Access"; homepage = "https://fsharp.github.io/FSharp.Data/"; - license = stdenv.lib.licenses.asl20; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -679,9 +680,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { # meta = { # description = "FSharpx.Extras is a collection of libraries and tools for use with F#"; # homepage = "https://fsprojects.github.io/FSharpx.Extras/"; - # license = stdenv.lib.licenses.asl20; - # maintainers = with stdenv.lib.maintainers; [ obadz ]; - # platforms = with stdenv.lib.platforms; linux; + # license = lib.licenses.asl20; + # maintainers = with lib.maintainers; [ obadz ]; + # platforms = with lib.platforms; linux; # }; # }; @@ -724,7 +725,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { outputFiles = [ "GitVersionTree/bin/Release/*" ]; exeFiles = [ "GitVersionTree.exe" ]; - meta = with stdenv.lib; { + meta = with lib; { description = "A tool to help visualize git revisions and branches"; homepage = "https://github.com/crc8/GitVersionTree"; license = licenses.gpl2; @@ -751,9 +752,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "Math.NET Numerics is an opensource numerical library for .Net, Silverlight and Mono"; homepage = "https://numerics.mathdotnet.com/"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -785,7 +786,7 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { A generic framework for creating extensible applications, and for creating libraries which extend those applications. ''; - license = stdenv.lib.licenses.mit; + license = lib.licenses.mit; }; }; @@ -840,9 +841,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { # meta = { # description = "F# addin for MonoDevelop 5.9"; # homepage = "https://github.com/fsharp/fsharpbinding/tree/5.9"; - # license = stdenv.lib.licenses.asl20; - # maintainers = with stdenv.lib.maintainers; [ obadz ]; - # platforms = with stdenv.lib.platforms; linux; + # license = lib.licenses.asl20; + # maintainers = with lib.maintainers; [ obadz ]; + # platforms = with lib.platforms; linux; # }; # }; @@ -872,9 +873,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "A callback-based program option parser for C#"; homepage = "http://www.ndesk.org/Options"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -939,9 +940,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "A command-line tool for manipulating F# project files"; homepage = "https://github.com/kjnilsson/projekt"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; @@ -967,9 +968,9 @@ let self = dotnetPackages // overrides; dotnetPackages = with self; { meta = { description = "A declarative CLI argument/XML configuration parser for F# applications"; homepage = "https://nessos.github.io/UnionArgParser/"; - license = stdenv.lib.licenses.mit; - maintainers = with stdenv.lib.maintainers; [ obadz ]; - platforms = with stdenv.lib.platforms; linux; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ obadz ]; + platforms = with lib.platforms; linux; }; }; diff --git a/pkgs/top-level/emscripten-packages.nix b/pkgs/top-level/emscripten-packages.nix index ceb2d5e16f7..ff636097004 100644 --- a/pkgs/top-level/emscripten-packages.nix +++ b/pkgs/top-level/emscripten-packages.nix @@ -178,7 +178,7 @@ rec { echo "================= /testing zlib using node =================" ''; - postPatch = pkgs.stdenv.lib.optionalString pkgs.stdenv.isDarwin '' + postPatch = pkgs.lib.optionalString pkgs.stdenv.isDarwin '' substituteInPlace configure \ --replace '/usr/bin/libtool' 'ar' \ --replace 'AR="libtool"' 'AR="ar"' \ diff --git a/pkgs/top-level/haxe-packages.nix b/pkgs/top-level/haxe-packages.nix index a3b4fd33256..66faa6f7cdb 100644 --- a/pkgs/top-level/haxe-packages.nix +++ b/pkgs/top-level/haxe-packages.nix @@ -1,10 +1,10 @@ -{ stdenv, fetchzip, fetchFromGitHub, haxe, neko, jdk, mono }: +{ stdenv, lib, fetchzip, fetchFromGitHub, haxe, neko, jdk, mono }: let self = haxePackages; haxePackages = with self; { - withCommas = stdenv.lib.replaceChars ["."] [","]; + withCommas = lib.replaceChars ["."] [","]; # simulate "haxelib dev $libname ." simulateHaxelibDev = libname: '' @@ -53,8 +53,8 @@ let meta = { homepage = "http://lib.haxe.org/p/${libname}"; - license = stdenv.lib.licenses.bsd2; - platforms = stdenv.lib.platforms.all; + license = lib.licenses.bsd2; + platforms = lib.platforms.all; description = throw "please write meta.description"; } // attrs.meta; }); @@ -67,7 +67,7 @@ let for f in $out/lib/haxe/${withCommas libname}/${withCommas version}/{,project/libs/nekoapi/}bin/Linux{,64}/*; do chmod +w "$f" patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) "$f" || true - patchelf --set-rpath ${ stdenv.lib.makeLibraryPath [ stdenv.cc.cc ] } "$f" || true + patchelf --set-rpath ${ lib.makeLibraryPath [ stdenv.cc.cc ] } "$f" || true done ''; meta.description = "Runtime support library for the Haxe C++ backend"; @@ -110,8 +110,8 @@ let installPhase = installLibHaxe { inherit libname version; }; meta = { homepage = "http://lib.haxe.org/p/${libname}"; - license = stdenv.lib.licenses.bsd2; - platforms = stdenv.lib.platforms.all; + license = lib.licenses.bsd2; + platforms = lib.platforms.all; description = "Extern definitions for node.js 6.9"; }; }; diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/top-level/lua-packages.nix index d2410e2eef3..550c5bbd63b 100644 --- a/pkgs/top-level/lua-packages.nix +++ b/pkgs/top-level/lua-packages.nix @@ -32,7 +32,7 @@ let callPackage = pkgs.newScope self; - requiredLuaModules = drvs: with stdenv.lib; let + requiredLuaModules = drvs: with lib; let modules = filter hasLuaModule drvs; in unique ([lua] ++ modules ++ concatLists (catAttrs "requiredLuaModules" modules)); @@ -123,7 +123,7 @@ with self; { ); ''; - meta = with stdenv.lib; { + meta = with lib; { description = "Lightweight UNIX I/O and POSIX binding for Lua"; homepage = "https://www.gitano.org.uk/luxio/"; license = licenses.mit; @@ -151,7 +151,7 @@ with self; { printf "package.path = '$out/lib/lua/${lua.luaversion}/?/init.lua;' .. package.path\nreturn require((...) .. '.init')\n" > $out/lib/lua/${lua.luaversion}/vicious.lua ''; - meta = with stdenv.lib; { + meta = with lib; { description = "A modular widget library for the awesome window manager"; homepage = "https://github.com/Mic92/vicious"; license = licenses.gpl2; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 9dac5041b2a..14cbdcea856 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8,10 +8,11 @@ { pkgs , stdenv +, lib , python }: -with pkgs.lib; +with lib; self: @@ -64,7 +65,7 @@ let # Create a PYTHONPATH from a list of derivations. This function recurses into the items to find derivations # providing Python modules. - makePythonPath = drvs: stdenv.lib.makeSearchPath python.sitePackages (requiredPythonModules drvs); + makePythonPath = drvs: lib.makeSearchPath python.sitePackages (requiredPythonModules drvs); removePythonPrefix = name: removePrefix namePrefix name; -- cgit 1.4.1 From 0389d5b148940055af8be2fc01caea2b5b841cd6 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Fri, 22 Jan 2021 00:02:29 -0800 Subject: python310: 3.10.0a3 -> 3.10.0a4 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index c1d78f6fa93..1133ad2009a 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -181,9 +181,9 @@ in { major = "3"; minor = "10"; patch = "0"; - suffix = "a3"; + suffix = "a4"; }; - sha256 = "sha256-sJjJdAdxOUfX7W7VioSGdxlgp2lyMOPZjg42MCd/JYY="; + sha256 = "sha256-McHBl7IZuOH96je/izkxur0Edirn+igVkQU/pbek73M="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 4a8b6c0317d2bb0c399c3089e9409b0dffd2ee3f Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 14 Feb 2021 09:49:59 -0800 Subject: pypy, pypy3: 7.3.2 → 7.3.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- pkgs/development/interpreters/python/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index d6030a4bf1d..c87cfc32bbd 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -218,9 +218,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "2"; + patch = "3"; }; - sha256 = "1l98b7s9sf16a5w8y0fdn7a489l3gpykjasws1j67bahhc6li2c1"; + sha256 = "0di3dr5ry4r0hwxh4fbqjhyl5im948wdby0bhijzsxx83c2qhd7n"; pythonVersion = "2.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; @@ -234,9 +234,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "2"; + patch = "3"; }; - sha256 = "03f1fdw6yk2mypa9pbmgk26r8y1hhmw801l6g36zry9zsvz7aqgx"; + sha256 = "1bq5i2mqgjjfc4rhxgxm6ihwa76vn2qapd7l59ri7xp01p522gd2"; pythonVersion = "3.6"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; @@ -251,9 +251,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "2"; + patch = "3"; }; - sha256 = "0fx1kp13cgx3rijd0zf8rdjbai6mfhc9is4xfc7kl5cpd88hhkwd"; # linux64 + sha256 = "1cfpdyvbvzwc0ynjr7248jhwgcpl7073wlp7w3g2v4fnrh1bc4pl"; # linux64 pythonVersion = "2.7"; inherit passthruFun; }; @@ -264,9 +264,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "2"; + patch = "3"; }; - sha256 = "10xdx7q04fzy4v4rbj9bbdw8g9y68qgaih7z2n0s5aknj0bizafp"; # linux64 + sha256 = "02lys9bjky9bqg6ggv8djirbd3zzcsq7755v4yvwm0k4a7fmzf2g"; # linux64 pythonVersion = "3.6"; inherit passthruFun; }; -- cgit 1.4.1 From a39b5b5c949db43ec7cf1cdf0b175ac3d7571b8d Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 20 Feb 2021 08:41:48 +0100 Subject: python39: 3.9.1 -> 3.9.2 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index d6030a4bf1d..5272f8c64de 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -167,10 +167,10 @@ in { sourceVersion = { major = "3"; minor = "9"; - patch = "1"; + patch = "2"; suffix = ""; }; - sha256 = "1zq3k4ymify5ig739zyvx9s2ainvchxb1zpy139z74krr653y74r"; + sha256 = "PCA0xU+BFEj1FmaNzgnSQAigcWw6eU3YY5tTiMveJH0="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 84edcadb4abbcb6a2715b1b77510b62d30a50ae6 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 20 Feb 2021 08:42:08 +0100 Subject: python38: 3.8.7 -> 3.8.8 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 5272f8c64de..4995939fba1 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -154,10 +154,10 @@ in { sourceVersion = { major = "3"; minor = "8"; - patch = "7"; + patch = "8"; suffix = ""; }; - sha256 = "sha256-3cwd8Wu1uHqkLsXSCluQLy0IjKommyjgFZD5enmOxQo="; + sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 2cbc212983bf6a4163721b5fe41324d197c15fee Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 20 Feb 2021 08:42:24 +0100 Subject: python37: 3.7.9 -> 3.7.10 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 4995939fba1..551676f5b35 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -141,10 +141,10 @@ in { sourceVersion = { major = "3"; minor = "7"; - patch = "9"; + patch = "10"; suffix = ""; }; - sha256 = "008v6g1jkrjrdmiqlgjlq6msbbj848bvkws6ppwva1ahn03k14li"; + sha256 = "+NgudXLIbsnVXIYnquUEAST9IgOvQAw4PIIbmAMG7ms="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 8ab9914a8c6f5f80f06e493bbff220e5e8a64a92 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 20 Feb 2021 09:28:44 +0100 Subject: python36: 3.6.12 -> 3.6.13 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 551676f5b35..3033908a184 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -128,10 +128,10 @@ in { sourceVersion = { major = "3"; minor = "6"; - patch = "12"; + patch = "13"; suffix = ""; }; - sha256 = "cJU6m11okdkuZdGEw1EhJqFYFL7hXh7/LdzOBDNOmpk="; + sha256 = "pHpDpTq7QihqLBGWU0P/VnEbnmTo0RvyxnAaT7jOGg8="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 04f436940c85b68a5dc6b69d93a9aa542cf3bf6c Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 20 Feb 2021 09:28:59 +0100 Subject: python310: 3.10.0a4 -> 3.10.0a5 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 3033908a184..4cf245f26a9 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -181,9 +181,9 @@ in { major = "3"; minor = "10"; patch = "0"; - suffix = "a4"; + suffix = "a5"; }; - sha256 = "sha256-McHBl7IZuOH96je/izkxur0Edirn+igVkQU/pbek73M="; + sha256 = "BBjlfnA24hnx5rYwOyHnEfZM/Q/dsIlNjxnzev/8XU0="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 0dc64d5d7197dead209aff7bffc4ddbf6da2cb31 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 27 Feb 2021 08:55:38 +0100 Subject: python: fix full builds by referring to the correct interpreter The package set is an attribute of the interpreter. The function to build an environment (`buildEnv`/`withPackages`) is part of the interpreter. The interpreter is passed to itself, and needs to be updated when overridden. For cross-compilation we splice the package set, and for that the various `build/host` interpreters and sets need to be available. We select these currently through `pkgs.${pythonAttr}`. The `pythonAttr` attribute was not fixed for `pythonFull`. https://github.com/NixOS/rfcs/pull/83 https://github.com/NixOS/nixpkgs/pull/104201 We need a better solution for this because this is very brittle. --- pkgs/development/interpreters/python/default.nix | 1 + pkgs/top-level/all-packages.nix | 8 ++++++++ 2 files changed, 9 insertions(+) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 4cf245f26a9..c212e37a484 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -191,6 +191,7 @@ in { # Minimal versions of Python (built without optional dependencies) python3Minimal = (python38.override { self = python3Minimal; + pythonAttr = "python3Minimal"; # strip down that python version as much as possible openssl = null; readline = null; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e481487617a..063205a3f17 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -11431,38 +11431,46 @@ in # These are for compatibility and should not be used inside Nixpkgs. pythonFull = python.override { self = pythonFull; + pythonAttr = "pythonFull"; x11Support = true; }; python2Full = python2.override { self = python2Full; + pythonAttr = "python2Full"; x11Support = true; }; python27Full = python27.override { self = python27Full; + pythonAttr = "python27Full"; x11Support = true; }; python3Full = python3.override { self = python3Full; + pythonAttr = "python3Full"; bluezSupport = true; x11Support = true; }; python36Full = python36.override { self = python36Full; + pythonAttr = "python36Full"; bluezSupport = true; x11Support = true; }; python37Full = python37.override { self = python37Full; + pythonAttr = "python37Full"; bluezSupport = true; x11Support = true; }; python38Full = python38.override { self = python38Full; + pythonAttr = "python38Full"; bluezSupport = true; x11Support = true; }; python39Full = python39.override { self = python39Full; + pythonAttr = "python39Full"; bluezSupport = true; x11Support = true; }; -- cgit 1.4.1 From 7617b03403acd7d74f8e4f21ed791543ad14bfe9 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 16 Nov 2020 21:34:33 +0100 Subject: python39: hardcode path to tzdata Python 3.9 has a new module `zoneinfo` which requires tzdata. By default it searches TZPATH for folders containing `zoneinfo`. This commit makes the dependency on tzdata pure. --- pkgs/development/interpreters/python/cpython/default.nix | 12 +++++++++--- pkgs/development/interpreters/python/default.nix | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index 6cfe2ad93b5..51043a884eb 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -11,6 +11,7 @@ , tcl ? null, tk ? null, tix ? null, libX11 ? null, xorgproto ? null, x11Support ? false , bluez ? null, bluezSupport ? false , zlib +, tzdata ? null , self , configd , autoreconfHook @@ -68,6 +69,8 @@ let buildPackages = pkgsBuildHost; inherit (passthru) pythonForBuild; + tzdataSupport = tzdata != null && passthru.pythonAtLeast "3.9"; + passthru = passthruFun rec { inherit self sourceVersion packageOverrides; implementation = "cpython"; @@ -100,7 +103,8 @@ let zlib bzip2 expat lzma libffi gdbm sqlite readline ncurses openssl ] ++ optionals x11Support [ tcl tk libX11 xorgproto ] ++ optionals (bluezSupport && stdenv.isLinux) [ bluez ] - ++ optionals stdenv.isDarwin [ configd ]); + ++ optionals stdenv.isDarwin [ configd ]) + ++ optionals tzdataSupport [ tzdata ]; # `zoneinfo` module hasDistutilsCxxPatch = !(stdenv.cc.isGNU or false); @@ -293,6 +297,8 @@ in with passthru; stdenv.mkDerivation { # Never even try to use lchmod on linux, # don't rely on detecting glibc-isms. "ac_cv_func_lchmod=no" + ] ++ optionals tzdataSupport [ + "--with-tzpath=${tzdata}/share/zoneinfo" ] ++ optional static "LDFLAGS=-static"; preConfigure = '' @@ -348,8 +354,8 @@ in with passthru; stdenv.mkDerivation { done # Further get rid of references. https://github.com/NixOS/nixpkgs/issues/51668 - find $out/lib/python*/config-* -type f -print -exec nuke-refs -e $out '{}' + - find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out '{}' + + find $out/lib/python*/config-* -type f -print -exec nuke-refs -e $out ${optionalString tzdataSupport "-e ${tzdata}"} '{}' + + find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out ${optionalString tzdataSupport "-e ${tzdata}"} '{}' + # Make the sysconfigdata module accessible on PYTHONPATH # This allows build Python to import host Python's sysconfigdata diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 2a4ffeb4215..3334e378ed1 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -199,6 +199,7 @@ in { gdbm = null; sqlite = null; configd = null; + tzdata = null; stripConfig = true; stripIdlelib = true; stripTests = true; -- cgit 1.4.1 From 5b1abe5dd2f4ababb8e0ccd3bddfb0e821e0a60a Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 14 Mar 2021 13:00:44 +0100 Subject: python3: mimetypesSupport is optional --- pkgs/development/interpreters/python/cpython/default.nix | 6 +++++- pkgs/development/interpreters/python/default.nix | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index d796e45dc06..a98950eeb3e 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -4,7 +4,7 @@ , libffi , gdbm , lzma -, mime-types +, mime-types ? null, mimetypesSupport ? true , ncurses , openssl , readline @@ -55,6 +55,8 @@ assert x11Support -> tcl != null assert bluezSupport -> bluez != null; +assert mimetypesSupport -> mime-types != null; + assert lib.assertMsg (enableOptimizations -> (!stdenv.cc.isClang)) "Optimizations with clang are not supported. configure: error: llvm-profdata is required for a --enable-optimizations build but could not be found."; @@ -188,6 +190,7 @@ in with passthru; stdenv.mkDerivation { # (since it will do a futile invocation of gcc (!) to find # libuuid, slowing down program startup a lot). (./. + "/${sourceVersion.major}.${sourceVersion.minor}/no-ldconfig.patch") + ] ++ optionals mimetypesSupport [ # Make the mimetypes module refer to the right file ./mimetypes.patch ] ++ optionals (isPy35 || isPy36) [ @@ -250,6 +253,7 @@ in with passthru; stdenv.mkDerivation { postPatch = '' substituteInPlace Lib/subprocess.py \ --replace "'/bin/sh'" "'${bash}/bin/sh'" + '' + optionalString mimetypesSupport '' substituteInPlace Lib/mimetypes.py \ --replace "@mime-types@" "${mime-types}" '' + optionalString (x11Support && (tix != null)) '' diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 3334e378ed1..56496979dc4 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -208,6 +208,7 @@ in { stripBytecode = true; includeSiteCustomize = false; enableOptimizations = false; + mimetypesSupport = false; }).overrideAttrs(old: { pname = "python3-minimal"; meta = old.meta // { -- cgit 1.4.1 From 0c1aa67215a3b165a6036f2a6302e01dd6938752 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sun, 14 Mar 2021 15:43:38 +0100 Subject: python3Minimal and python3: don't override python3 This reduces the amount of packages that are required to use builtins.fetchurl to fetch. Without this change, mime-types would not be able to use fetchzip when mime-types support is added to python3. --- pkgs/development/interpreters/python/default.nix | 29 +++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 56496979dc4..39e27ec9944 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -108,6 +108,19 @@ with pkgs; python = self; }; }; + + sources = { + "python38" = { + sourceVersion = { + major = "3"; + minor = "8"; + patch = "8"; + suffix = ""; + }; + sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; + }; + }; + in { python27 = callPackage ./cpython/2.7 { @@ -149,18 +162,11 @@ in { inherit passthruFun; }; - python38 = callPackage ./cpython { + python38 = callPackage ./cpython ({ self = python38; - sourceVersion = { - major = "3"; - minor = "8"; - patch = "8"; - suffix = ""; - }; - sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; inherit (darwin) configd; inherit passthruFun; - }; + } // sources.python38); python39 = callPackage ./cpython { self = python39; @@ -189,8 +195,9 @@ in { }; # Minimal versions of Python (built without optional dependencies) - python3Minimal = (python38.override { + python3Minimal = (callPackage ./cpython ({ self = python3Minimal; + inherit passthruFun; pythonAttr = "python3Minimal"; # strip down that python version as much as possible openssl = null; @@ -209,7 +216,7 @@ in { includeSiteCustomize = false; enableOptimizations = false; mimetypesSupport = false; - }).overrideAttrs(old: { + } // sources.python38)).overrideAttrs(old: { pname = "python3-minimal"; meta = old.meta // { maintainers = []; -- cgit 1.4.1 From d754c20366597965115f690970abfdea5a91dbc8 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 3 Apr 2021 09:25:45 +0200 Subject: python38: 3.8.8 -> 3.8.9 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 39e27ec9944..8825ae55312 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -114,10 +114,10 @@ with pkgs; sourceVersion = { major = "3"; minor = "8"; - patch = "8"; + patch = "9"; suffix = ""; }; - sha256 = "fGZCSf935EPW6g5M8OWH6ukYyjxI0IHRkV/iofG8xcw="; + sha256 = "XjkfPsRdopVEGcqwvq79i+OIlepc4zV3w+wUlAxLlXI="; }; }; -- cgit 1.4.1 From 9e83f91bb1b81f0ed172f75a3a6e2f03f33efe6b Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 3 Apr 2021 09:25:56 +0200 Subject: python39: 3.9.2 -> 3.9.3 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 8825ae55312..dcccaf1f2b7 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -173,10 +173,10 @@ in { sourceVersion = { major = "3"; minor = "9"; - patch = "2"; + patch = "3"; suffix = ""; }; - sha256 = "PCA0xU+BFEj1FmaNzgnSQAigcWw6eU3YY5tTiMveJH0="; + sha256 = "MIEQOcZeBMFPxpjkI5R+Rk+TFuaftEYQvThEYEa7grU="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 4f02e12f8a7e869234d5e98b15aa4a5a08e7a7dd Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 24 Mar 2021 12:12:48 +0100 Subject: python2Packages: separate extension --- pkgs/development/interpreters/python/default.nix | 5 ++++- pkgs/top-level/python2-packages.nix | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 pkgs/top-level/python2-packages.nix (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index dcccaf1f2b7..07d52a532fb 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -69,12 +69,15 @@ with pkgs; recursivePthLoader ; }; + optionalExtensions = cond: as: if cond then as else []; + python2Extension = import ../../../top-level/python2-packages.nix; + extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]); in lib.makeScopeWithSplicing pkgs.splicePackages pkgs.newScope otherSplices keep - (lib.extends overrides pythonPackagesFun)) + (lib.extends extensions pythonPackagesFun)) { overrides = packageOverrides; }; diff --git a/pkgs/top-level/python2-packages.nix b/pkgs/top-level/python2-packages.nix new file mode 100644 index 00000000000..7934861f097 --- /dev/null +++ b/pkgs/top-level/python2-packages.nix @@ -0,0 +1,7 @@ +# Extension with Python 2 packages that is overlayed on top +# of the Python 3 packages set. This way, Python 2+3 compatible +# packages can still be used. + +self: super: { + +} -- cgit 1.4.1 From f310134deca455fe21d96e85993f1e6c86a0304e Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Mon, 5 Apr 2021 10:54:26 +0200 Subject: python39: 3.9.3 -> 3.9.4 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 07d52a532fb..d74e017d830 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -176,10 +176,10 @@ in { sourceVersion = { major = "3"; minor = "9"; - patch = "3"; + patch = "4"; suffix = ""; }; - sha256 = "MIEQOcZeBMFPxpjkI5R+Rk+TFuaftEYQvThEYEa7grU="; + sha256 = "Sw5mRKdvjfhkriSsUApRu/aL0Jj2oXPifTthzcqaoTQ="; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 470640e7fe53ab57396cff6698125f5bf137b4de Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 4 May 2021 00:08:20 -0400 Subject: treewide: Do a number of no-op cleanups for cross and darwin I am taking the non-invasive parts of #110914 to hopefully help out with #111988. In particular: - Use `lib.makeScopeWithSplicing` to make the `darwin` package set have a proper `callPackage`. - Adjust Darwin `stdenv`'s overlays keeping things from the previous stage to not stick around too much. - Expose `binutilsNoLibc` / `darwin.binutilsNoLibc` to hopefully get us closer to a unified LLVM and GCC bootstrap. --- lib/customisation.nix | 8 ++- pkgs/development/interpreters/python/default.nix | 2 + .../darwin/apple-source-releases/default.nix | 49 +++++++++------- pkgs/stdenv/darwin/default.nix | 44 +++++++------- pkgs/top-level/all-packages.nix | 22 +++---- pkgs/top-level/darwin-packages.nix | 67 ++++++++++++++-------- pkgs/top-level/static.nix | 2 +- 7 files changed, 111 insertions(+), 83 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/lib/customisation.nix b/lib/customisation.nix index 37a7951896b..c17cb0d0f8e 100644 --- a/lib/customisation.nix +++ b/lib/customisation.nix @@ -219,16 +219,17 @@ rec { /* Like the above, but aims to support cross compilation. It's still ugly, but hopefully it helps a little bit. */ - makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: f: + makeScopeWithSplicing = splicePackages: newScope: otherSplices: keep: extra: f: let - spliced = splicePackages { + spliced0 = splicePackages { pkgsBuildBuild = otherSplices.selfBuildBuild; pkgsBuildHost = otherSplices.selfBuildHost; pkgsBuildTarget = otherSplices.selfBuildTarget; pkgsHostHost = otherSplices.selfHostHost; pkgsHostTarget = self; # Not `otherSplices.selfHostTarget`; pkgsTargetTarget = otherSplices.selfTargetTarget; - } // keep self; + }; + spliced = extra spliced0 // spliced0 // keep self; self = f self // { newScope = scope: newScope (spliced // scope); callPackage = newScope spliced; # == self.newScope {}; @@ -239,6 +240,7 @@ rec { newScope otherSplices keep + extra (lib.fixedPoints.extends g f); packages = f; }; diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index d74e017d830..5f13418aa58 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -69,6 +69,7 @@ with pkgs; recursivePthLoader ; }; + extra = _: {}; optionalExtensions = cond: as: if cond then as else []; python2Extension = import ../../../top-level/python2-packages.nix; extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]); @@ -77,6 +78,7 @@ with pkgs; pkgs.newScope otherSplices keep + extra (lib.extends extensions pythonPackagesFun)) { overrides = packageOverrides; diff --git a/pkgs/os-specific/darwin/apple-source-releases/default.nix b/pkgs/os-specific/darwin/apple-source-releases/default.nix index 23434931542..3e431810f20 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/default.nix @@ -1,9 +1,6 @@ -{ lib, stdenv, fetchurl, fetchzip, pkgs }: +{ lib, stdenv, stdenvNoCC, fetchurl, fetchzip, pkgs }: let - macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; }; - developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; }; - # This attrset can in theory be computed automatically, but for that to work nicely we need # import-from-derivation to work properly. Currently it's rather ugly when we try to bootstrap # a stdenv out of something like this. With some care we can probably get rid of this, but for @@ -190,17 +187,6 @@ let }) // (attrs.meta or {}); }); - applePackage' = namePath: version: sdkName: sha256: let - pname = builtins.head (lib.splitString "/" namePath); - appleDerivation = appleDerivation' pname version sdkName sha256; - callPackage = pkgs.newScope (packages // pkgs.darwin // { inherit appleDerivation; }); - in callPackage (./. + "/${namePath}"); - - applePackage = namePath: sdkName: sha256: let - pname = builtins.head (lib.splitString "/" namePath); - version = versions.${sdkName}.${pname}; - in applePackage' namePath version sdkName sha256; - IOKitSpecs = { IOAudioFamily = fetchApple "osx-10.10.5" "0ggq7za3iq8g02j16rj67prqhrw828jsw3ah3bxq8a1cvr55aqnq"; IOFireWireFamily = fetchApple "osx-10.10.5" "059qa1m668kwvchl90cqcx35b31zaqdg61zi11y1imn5s389y2g1"; @@ -225,11 +211,35 @@ let IOKitSrcs = lib.mapAttrs (name: value: if lib.isFunction value then value name else value) IOKitSpecs; +in + +# darwin package set +self: + +let + macosPackages_11_0_1 = import ./macos-11.0.1.nix { inherit applePackage'; }; + developerToolsPackages_11_3_1 = import ./developer-tools-11.3.1.nix { inherit applePackage'; }; + + applePackage' = namePath: version: sdkName: sha256: + let + pname = builtins.head (lib.splitString "/" namePath); + appleDerivation = appleDerivation' pname version sdkName sha256; + callPackage = self.newScope { inherit appleDerivation; }; + in callPackage (./. + "/${namePath}"); + + applePackage = namePath: sdkName: sha256: let + pname = builtins.head (lib.splitString "/" namePath); + version = versions.${sdkName}.${pname}; + in applePackage' namePath version sdkName sha256; + # Only used for bootstrapping. It’s convenient because it was the last version to come with a real makefile. adv_cmds-boot = applePackage "adv_cmds/boot.nix" "osx-10.5.8" "102ssayxbg9wb35mdmhswbnw0bg7js3pfd8fcbic83c5q3bqa6c6" {}; - # TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here. - stubPackages = { +in + +developerToolsPackages_11_3_1 // macosPackages_11_0_1 // { + # TODO: shorten this list, we should cut down to a minimum set of bootstrap or necessary packages here. + inherit (adv_cmds-boot) ps locale; architecture = applePackage "architecture" "osx-10.11.6" "1pbpjcd7is69hn8y29i98ci0byik826if8gnp824ha92h90w0fq3" {}; bsdmake = applePackage "bsdmake" "dev-tools-3.2.6" "11a9kkhz5bfgi1i8kpdkis78lhc6b5vxmhd598fcdgra1jw4iac2" {}; @@ -290,7 +300,4 @@ let # TODO(matthewbauer): # To be removed, once I figure out how to build a newer Security version. Security = applePackage "Security/boot.nix" "osx-10.9.5" "1nv0dczf67dhk17hscx52izgdcyacgyy12ag0jh6nl5hmfzsn8yy" {}; - }; - - packages = developerToolsPackages_11_3_1 // macosPackages_11_0_1 // stubPackages; -in packages +} diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index 227f53b02cc..fcfab9bff5d 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -176,13 +176,13 @@ in rec { ''; }; - darwin = super.darwin // { + darwin = super.darwin.overrideScope (selfDarwin: superDarwin: { Libsystem = stdenv.mkDerivation { name = "bootstrap-stage0-Libsystem"; buildCommand = '' mkdir -p $out - cp -r ${self.darwin.darwin-stubs}/usr/lib $out/lib + cp -r ${selfDarwin.darwin-stubs}/usr/lib $out/lib chmod -R +w $out/lib substituteInPlace $out/lib/libSystem.B.tbd --replace /usr/lib/system $out/lib/system @@ -201,7 +201,7 @@ in rec { ''; }; - darwin-stubs = super.darwin.darwin-stubs.override { inherit (self) stdenv fetchurl; }; + darwin-stubs = superDarwin.darwin-stubs.override { inherit (self) stdenv fetchurl; }; dyld = { name = "bootstrap-stage0-dyld"; @@ -220,10 +220,10 @@ in rec { nativeTools = false; nativeLibc = false; inherit (self) buildPackages coreutils gnugrep; - libc = self.pkgs.darwin.Libsystem; + libc = selfDarwin.Libsystem; bintools = { name = "bootstrap-stage0-binutils"; outPath = bootstrapTools; }; }; - }; + }); llvmPackages_7 = { clang-unwrapped = stdenv.mkDerivation { @@ -291,12 +291,12 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (selfDarwin: _: { binutils = darwin.binutils.override { coreutils = self.coreutils; - libc = self.darwin.Libsystem; + libc = selfDarwin.Libsystem; }; - }; + }); }; in with prevStage; stageFun 1 prevStage { extraPreHook = "export NIX_CFLAGS_COMPILE+=\" -F${bootstrapTools}/Library/Frameworks\""; @@ -337,11 +337,11 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) binutils dyld Libsystem xnu configd ICU libdispatch libclosure launchd CF darwin-stubs; - }; + }); }; in with prevStage; stageFun 2 prevStage { extraPreHook = '' @@ -382,11 +382,11 @@ in rec { }); in { inherit libraries; } // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) dyld Libsystem xnu configd libdispatch libclosure launchd libiconv locale darwin-stubs; - }; + }); }; in with prevStage; stageFun 3 prevStage { shell = "${pkgs.bash}/bin/bash"; @@ -442,14 +442,14 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // rec { + darwin = super.darwin.overrideScope (_: superDarwin: { inherit (darwin) dyld Libsystem libiconv locale darwin-stubs; - CF = super.darwin.CF.override { + CF = superDarwin.CF.override { inherit libxml2; python3 = prevStage.python3; }; - }; + }); }; in with prevStage; stageFun 4 prevStage { shell = "${pkgs.bash}/bin/bash"; @@ -480,11 +480,11 @@ in rec { }); in { inherit tools libraries; } // tools // libraries); - darwin = super.darwin // { + darwin = super.darwin.overrideScope (_: _: { inherit (darwin) dyld ICU Libsystem libiconv; } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { inherit (darwin) binutils binutils-unwrapped cctools; - }; + }); } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { # Need to get rid of these when cross-compiling. inherit binutils binutils-unwrapped; @@ -537,14 +537,14 @@ in rec { ]); overrides = lib.composeExtensions persistent (self: super: { + darwin = super.darwin.overrideScope (_: superDarwin: { + inherit (prevStage.darwin) CF darwin-stubs; + xnu = superDarwin.xnu.override { inherit (prevStage) python3; }; + }); + } // lib.optionalAttrs (super.stdenv.targetPlatform == localSystem) { clang = cc; llvmPackages = super.llvmPackages // { clang = cc; }; inherit cc; - - darwin = super.darwin // { - inherit (prevStage.darwin) CF darwin-stubs; - xnu = super.darwin.xnu.override { inherit (prevStage) python3; }; - }; }); }; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 63de087f73f..e2fc45fe5c4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10395,15 +10395,7 @@ in # The GCC used to build libc for the target platform. Normal gccs will be # built with, and use, that cross-compiled libc. gccCrossStageStatic = assert stdenv.targetPlatform != stdenv.hostPlatform; let - libcCross1 = - if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers - else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode - else if stdenv.targetPlatform.libc == "nblibc" then netbsd.headers - else null; - binutils1 = wrapBintoolsWith { - bintools = binutils-unwrapped; - libc = libcCross1; - }; + libcCross1 = binutilsNoLibc.libc; in wrapCCWith { cc = gccFun { # copy-pasted @@ -10416,10 +10408,10 @@ in crossStageStatic = true; langCC = false; libcCross = libcCross1; - targetPackages.stdenv.cc.bintools = binutils1; + targetPackages.stdenv.cc.bintools = binutilsNoLibc; enableShared = false; }; - bintools = binutils1; + bintools = binutilsNoLibc; libc = libcCross1; extraPackages = []; }; @@ -12532,6 +12524,14 @@ in gold = false; }; }); + binutilsNoLibc = wrapBintoolsWith { + bintools = binutils-unwrapped; + libc = + /**/ if stdenv.targetPlatform.libc == "msvcrt" then targetPackages.windows.mingw_w64_headers + else if stdenv.targetPlatform.libc == "libSystem" then darwin.xcode + else if stdenv.targetPlatform.libc == "nblibc" then targetPackages.netbsdCross.headers + else null; + }; bison = callPackage ../development/tools/parsing/bison { }; diff --git a/pkgs/top-level/darwin-packages.nix b/pkgs/top-level/darwin-packages.nix index 3ece95c5845..5275a6f3123 100644 --- a/pkgs/top-level/darwin-packages.nix +++ b/pkgs/top-level/darwin-packages.nix @@ -1,27 +1,44 @@ -{ buildPackages, pkgs, targetPackages -, darwin, stdenv, callPackage, callPackages, newScope +{ lib +, buildPackages, pkgs, targetPackages +, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, pkgsHostHost, pkgsTargetTarget +, stdenv, splicePackages, newScope }: let - apple-source-releases = callPackage ../os-specific/darwin/apple-source-releases { }; + otherSplices = { + selfBuildBuild = pkgsBuildBuild.darwin; + selfBuildHost = pkgsBuildHost.darwin; + selfBuildTarget = pkgsBuildTarget.darwin; + selfHostHost = pkgsHostHost.darwin; + selfTargetTarget = pkgsTargetTarget.darwin or {}; # might be missing + }; - impure-cmds = callPackage ../os-specific/darwin/impure-cmds { }; in -(impure-cmds // apple-source-releases // { +lib.makeScopeWithSplicing splicePackages newScope otherSplices (_: {}) (spliced: spliced.apple_sdk.frameworks) (self: let + inherit (self) mkDerivation callPackage; - callPackage = newScope (darwin.apple_sdk.frameworks // darwin); + # Must use pkgs.callPackage to avoid infinite recursion. - stdenvNoCF = stdenv.override { - extraBuildInputs = []; + apple-source-releases = pkgs.callPackage ../os-specific/darwin/apple-source-releases { } self; + + impure-cmds = pkgs.callPackage ../os-specific/darwin/impure-cmds { }; + + apple_sdk = pkgs.callPackage ../os-specific/darwin/apple-sdk { + inherit (buildPackages.darwin) print-reexports; + inherit (self) darwin-stubs; }; +in + +impure-cmds // apple-source-releases // { - apple_sdk = callPackage ../os-specific/darwin/apple-sdk { - inherit (darwin) darwin-stubs print-reexports; + inherit apple_sdk; + + stdenvNoCF = stdenv.override { + extraBuildInputs = []; }; binutils-unwrapped = callPackage ../os-specific/darwin/binutils { - inherit (darwin) cctools; inherit (pkgs) binutils-unwrapped; inherit (pkgs.llvmPackages_7) llvm clang-unwrapped; }; @@ -31,17 +48,21 @@ in if stdenv.targetPlatform != stdenv.hostPlatform then pkgs.libcCross else pkgs.stdenv.cc.libc; - bintools = darwin.binutils-unwrapped; + bintools = self.binutils-unwrapped; + }; + + binutilsNoLibc = pkgs.wrapBintoolsWith { + libc = null; + bintools = self.binutils-unwrapped; }; cctools = callPackage ../os-specific/darwin/cctools/port.nix { - inherit (darwin) libobjc maloader libtapi; stdenv = if stdenv.isDarwin then stdenv else pkgs.libcxxStdenv; libcxxabi = pkgs.libcxxabi; }; # TODO: remove alias. - cf-private = darwin.apple_sdk.frameworks.CoreFoundation; + cf-private = self.apple_sdk.frameworks.CoreFoundation; DarwinTools = callPackage ../os-specific/darwin/DarwinTools { }; @@ -50,15 +71,13 @@ in print-reexports = callPackage ../os-specific/darwin/apple-sdk/print-reexports { }; maloader = callPackage ../os-specific/darwin/maloader { - inherit (darwin) opencflite; }; insert_dylib = callPackage ../os-specific/darwin/insert_dylib { }; - iosSdkPkgs = darwin.callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix { + iosSdkPkgs = callPackage ../os-specific/darwin/xcode/sdk-pkgs.nix { buildIosSdk = buildPackages.darwin.iosSdkPkgs.sdk; targetIosSdkPkgs = targetPackages.darwin.iosSdkPkgs; - xcode = darwin.xcode; inherit (pkgs.llvmPackages) clang-unwrapped; }; @@ -70,13 +89,13 @@ in opencflite = callPackage ../os-specific/darwin/opencflite { }; - stubs = callPackages ../os-specific/darwin/stubs { }; + stubs = pkgs.callPackages ../os-specific/darwin/stubs { }; - trash = darwin.callPackage ../os-specific/darwin/trash { }; + trash = callPackage ../os-specific/darwin/trash { }; usr-include = callPackage ../os-specific/darwin/usr-include { }; - inherit (callPackages ../os-specific/darwin/xcode { }) + inherit (pkgs.callPackages ../os-specific/darwin/xcode { }) xcode_8_1 xcode_8_2 xcode_9_1 xcode_9_2 xcode_9_4 xcode_9_4_1 xcode_10_2 xcode_10_2_1 xcode_10_3 @@ -85,10 +104,10 @@ in CoreSymbolication = callPackage ../os-specific/darwin/CoreSymbolication { }; - CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { inherit (darwin) objc4 ICU; }; + CF = callPackage ../os-specific/darwin/swift-corelibs/corefoundation.nix { }; # As the name says, this is broken, but I don't want to lose it since it's a direction we want to go in - # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { inherit (darwin) apple_sdk_sierra xnu; }; + # libdispatch-broken = callPackage ../os-specific/darwin/swift-corelibs/libdispatch.nix { }; darling = callPackage ../os-specific/darwin/darling/default.nix { }; @@ -96,8 +115,6 @@ in ios-deploy = callPackage ../os-specific/darwin/ios-deploy {}; - discrete-scroll = callPackage ../os-specific/darwin/discrete-scroll { - inherit (darwin.apple_sdk.frameworks) Cocoa; - }; + discrete-scroll = callPackage ../os-specific/darwin/discrete-scroll { }; }) diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index e73eba8e142..32559c0e799 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -25,7 +25,7 @@ self: super: let }; in stdenv // { mkDerivation = args: stdenv.mkDerivation (args // { NIX_CFLAGS_LINK = toString (args.NIX_CFLAGS_LINK or "") - + optionalString stdenv.cc.isGNU " -static-libgcc"; + + optionalString (stdenv_.cc.isGNU or false) " -static-libgcc"; nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ (makeSetupHook { substitutions = { libsystem = "${stdenv.cc.libc}/lib/libSystem.B.dylib"; -- cgit 1.4.1 From 0197f1dc4198e79efed554a901d9fdf81551abb8 Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Mon, 15 Mar 2021 01:00:14 +0100 Subject: pythonPackages: Add aliases :tada: --- pkgs/development/interpreters/python/default.nix | 3 +- pkgs/top-level/python-aliases.nix | 37 ++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 pkgs/top-level/python-aliases.nix (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 5f13418aa58..328ed715bae 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -73,13 +73,14 @@ with pkgs; optionalExtensions = cond: as: if cond then as else []; python2Extension = import ../../../top-level/python2-packages.nix; extensions = lib.composeManyExtensions ((optionalExtensions (!self.isPy3k) [python2Extension]) ++ [ overrides ]); + aliases = self: super: lib.optionalAttrs (config.allowAliases or true) (import ../../../top-level/python-aliases.nix lib self super); in lib.makeScopeWithSplicing pkgs.splicePackages pkgs.newScope otherSplices keep extra - (lib.extends extensions pythonPackagesFun)) + (lib.extends (lib.composeExtensions aliases extensions) pythonPackagesFun)) { overrides = packageOverrides; }; diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix new file mode 100644 index 00000000000..761b187033f --- /dev/null +++ b/pkgs/top-level/python-aliases.nix @@ -0,0 +1,37 @@ +lib: self: super: + +with self; + +let + # Removing recurseForDerivation prevents derivations of aliased attribute + # set to appear while listing all the packages available. + removeRecurseForDerivations = alias: with lib; + if alias.recurseForDerivations or false then + removeAttrs alias ["recurseForDerivations"] + else alias; + + # Disabling distribution prevents top-level aliases for non-recursed package + # sets from building on Hydra. + removeDistribute = alias: with lib; + if isDerivation alias then + dontDistribute alias + else alias; + + # Make sure that we are not shadowing something from + # python-packages.nix. + checkInPkgs = n: alias: if builtins.hasAttr n super + then throw "Alias ${n} is still in python-packages.nix" + else alias; + + mapAliases = aliases: + lib.mapAttrs (n: alias: removeDistribute + (removeRecurseForDerivations + (checkInPkgs n alias))) + aliases; +in + + ### Deprecated aliases - for backward compatibility + +mapAliases ({ + smart_open = smart-open; # added 2021-03-14 +}) -- cgit 1.4.1 From 6c0b85cf3abefb59502093f4183cbf49a2f774a0 Mon Sep 17 00:00:00 2001 From: DavHau Date: Sun, 16 May 2021 15:13:39 +0700 Subject: buildPythonPackage: add support for conda --- .github/CODEOWNERS | 14 +++++---- .../interpreters/python/conda/default.nix | 25 ++++++++++++++++ pkgs/development/interpreters/python/default.nix | 2 ++ .../python/hooks/conda-install-hook.sh | 27 +++++++++++++++++ .../interpreters/python/hooks/conda-unpack-hook.sh | 18 +++++++++++ .../interpreters/python/hooks/default.nix | 15 ++++++++++ pkgs/development/interpreters/python/tests.nix | 35 +++++++++++++++++++++- pkgs/top-level/all-packages.nix | 2 ++ pkgs/top-level/python-packages.nix | 2 ++ 9 files changed, 133 insertions(+), 7 deletions(-) create mode 100644 pkgs/development/interpreters/python/conda/default.nix create mode 100644 pkgs/development/interpreters/python/hooks/conda-install-hook.sh create mode 100644 pkgs/development/interpreters/python/hooks/conda-unpack-hook.sh (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index d7c01b8986b..be54040ca2e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -72,12 +72,14 @@ /pkgs/common-updater/scripts/update-source-version @jtojnar # Python-related code and docs -/maintainers/scripts/update-python-libraries @FRidh -/pkgs/top-level/python-packages.nix @FRidh @jonringer -/pkgs/development/interpreters/python @FRidh -/pkgs/development/python-modules @FRidh @jonringer -/doc/languages-frameworks/python.section.md @FRidh -/pkgs/development/tools/poetry2nix @adisbladis +/maintainers/scripts/update-python-libraries @FRidh +/pkgs/top-level/python-packages.nix @FRidh @jonringer +/pkgs/development/interpreters/python @FRidh +/pkgs/development/python-modules @FRidh @jonringer +/doc/languages-frameworks/python.section.md @FRidh +/pkgs/development/tools/poetry2nix @adisbladis +/pkgs/development/interpreters/python/hooks @FRidh @jonringer @DavHau +/pkgs/development/interpreters/python/conda @DavHau # Haskell /doc/languages-frameworks/haskell.section.md @cdepillabout @sternenseemann @maralorn diff --git a/pkgs/development/interpreters/python/conda/default.nix b/pkgs/development/interpreters/python/conda/default.nix new file mode 100644 index 00000000000..5249ccce0d9 --- /dev/null +++ b/pkgs/development/interpreters/python/conda/default.nix @@ -0,0 +1,25 @@ +{ pkgs }: { + + # List of libraries that are needed for conda binary packages. + # When installing a conda binary package, just extend + # the `buildInputs` with `condaAutopatchLibs`. + condaPatchelfLibs = builtins.map (p: p.lib or p) ([ + pkgs.alsaLib + pkgs.cups + pkgs.gcc-unwrapped + pkgs.libGL + ] ++ (with pkgs.xorg; [ + libSM + libICE + libX11 + libXau + libXdamage + libXi + libXrender + libXrandr + libXcomposite + libXcursor + libXtst + libXScrnSaver]) + ); +} diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 328ed715bae..30134a05628 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -44,6 +44,8 @@ with pkgs; toPythonModule toPythonApplication buildSetupcfg + condaInstallHook + condaUnpackHook eggUnpackHook eggBuildHook eggInstallHook diff --git a/pkgs/development/interpreters/python/hooks/conda-install-hook.sh b/pkgs/development/interpreters/python/hooks/conda-install-hook.sh new file mode 100644 index 00000000000..af9ed60a038 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/conda-install-hook.sh @@ -0,0 +1,27 @@ +# Setup hook to use in case a conda binary package is installed +echo "Sourcing conda install hook" + +condaInstallPhase(){ + echo "Executing condaInstallPhase" + runHook preInstall + + # There are two different formats of conda packages. + # It either contains only a site-packages directory + # or multiple top level directories. + siteDir=@pythonSitePackages@ + if [ -e ./site-packages ]; then + mkdir -p $out/$siteDir + cp -r ./site-packages/* $out/$siteDir + else + cp -r . $out + rm $out/env-vars + fi + + runHook postInstall + echo "Finished executing condaInstallPhase" +} + +if [ -z "${installPhase-}" ]; then + echo "Using condaInstallPhase" + installPhase=condaInstallPhase +fi diff --git a/pkgs/development/interpreters/python/hooks/conda-unpack-hook.sh b/pkgs/development/interpreters/python/hooks/conda-unpack-hook.sh new file mode 100644 index 00000000000..6204c13b722 --- /dev/null +++ b/pkgs/development/interpreters/python/hooks/conda-unpack-hook.sh @@ -0,0 +1,18 @@ +# Setup hook to use in case a conda binary package is fetched +echo "Sourcing conda unpack hook" + +condaUnpackPhase(){ + echo "Executing condaUnpackPhase" + runHook preUnpack + + # use lbzip2 for parallel decompression (bz2 is slow) + lbzip2 -dc -n $NIX_BUILD_CORES $src | tar --exclude='info' -x + + # runHook postUnpack # Calls find...? + echo "Finished executing condaUnpackPhase" +} + +if [ -z "${unpackPhase-}" ]; then + echo "Using condaUnpackPhase" + unpackPhase=condaUnpackPhase +fi diff --git a/pkgs/development/interpreters/python/hooks/default.nix b/pkgs/development/interpreters/python/hooks/default.nix index 1a64c79232b..1a0618225a3 100644 --- a/pkgs/development/interpreters/python/hooks/default.nix +++ b/pkgs/development/interpreters/python/hooks/default.nix @@ -16,6 +16,21 @@ let setuppy = ../run_setup.py; in rec { + condaInstallHook = callPackage ({ gnutar, lbzip2 }: + makeSetupHook { + name = "conda-install-hook"; + deps = [ gnutar lbzip2 ]; + substitutions = { + inherit pythonSitePackages; + }; + } ./conda-install-hook.sh) {}; + + condaUnpackHook = callPackage ({}: + makeSetupHook { + name = "conda-unpack-hook"; + deps = []; + } ./conda-unpack-hook.sh) {}; + eggBuildHook = callPackage ({ }: makeSetupHook { name = "egg-build-hook.sh"; diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix index cfba04da938..872123338f8 100644 --- a/pkgs/development/interpreters/python/tests.nix +++ b/pkgs/development/interpreters/python/tests.nix @@ -121,4 +121,37 @@ let # in assert myPackages.foobar == myPackages.numpy; myPackages.python.withPackages(ps: with ps; [ foobar ]); }; -in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests // overrideTests) + condaTests = let + requests = callPackage ({ + autoPatchelfHook, + fetchurl, + pythonCondaPackages, + }: + python.pkgs.buildPythonPackage { + pname = "requests"; + version = "2.24.0"; + format = "other"; + src = fetchurl { + url = "https://repo.anaconda.com/pkgs/main/noarch/requests-2.24.0-py_0.tar.bz2"; + sha256 = "02qzaf6gwsqbcs69pix1fnjxzgnngwzvrsy65h1d521g750mjvvp"; + }; + nativeBuildInputs = [ autoPatchelfHook ] ++ (with python.pkgs; [ + condaUnpackHook condaInstallHook + ]); + buildInputs = [ + pythonCondaPackages.condaPatchelfLibs + ]; + propagatedBuildInputs = with python.pkgs; [ + chardet idna urllib3 certifi + ]; + } + ) {}; + pythonWithRequests = requests.pythonModule.withPackages (ps: [ requests ]); + in + { + condaExamplePackage = runCommand "import-requests" {} '' + ${pythonWithRequests.interpreter} -c "import requests" > $out + ''; + }; + +in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests // overrideTests // condaTests) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 7ef62643fbc..9dee838bb66 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12336,6 +12336,8 @@ in pythonManylinuxPackages = callPackage ./../development/interpreters/python/manylinux { }; + pythonCondaPackages = callPackage ./../development/interpreters/python/conda { }; + update-python-libraries = callPackage ../development/interpreters/python/update-python-libraries { }; # Should eventually be moved inside Python interpreters. diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 05c322bb932..91ef14b2f78 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -112,6 +112,8 @@ in { inherit buildSetupcfg; inherit (callPackage ../development/interpreters/python/hooks { }) + condaInstallHook + condaUnpackHook eggUnpackHook eggBuildHook eggInstallHook -- cgit 1.4.1 From 3898eb189762f5e83ed4b617c58711ceae29e9fa Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 17 Jun 2021 05:00:44 +0200 Subject: python38: 3.8.9 -> 3.8.10 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 30134a05628..1830ce301b6 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -122,10 +122,10 @@ with pkgs; sourceVersion = { major = "3"; minor = "8"; - patch = "9"; + patch = "10"; suffix = ""; }; - sha256 = "XjkfPsRdopVEGcqwvq79i+OIlepc4zV3w+wUlAxLlXI="; + sha256 = "1n8rjb3jn0j8dvi1qn94rxayc9rh982d8wgkrjy41n1x15k4mwka"; }; }; -- cgit 1.4.1 From 7ca18ab93f802dead800d76e3913eda1a8bbc705 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 17 Jun 2021 05:01:07 +0200 Subject: python39: 3.9.4 -> 3.9.5 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 1830ce301b6..414a1870a3c 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -181,10 +181,10 @@ in { sourceVersion = { major = "3"; minor = "9"; - patch = "4"; + patch = "5"; suffix = ""; }; - sha256 = "Sw5mRKdvjfhkriSsUApRu/aL0Jj2oXPifTthzcqaoTQ="; + sha256 = "10vdf46q5ldnzkprm8pldvr5a9hrdpxjv7mpzgdw6vj3cl318nhc"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From bb696403b0334d1fd3dee195751f99f9e2b0270f Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 17 Jun 2021 05:01:49 +0200 Subject: python310: 3.10.0a5 -> 3.10.0b3 --- pkgs/development/interpreters/python/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 414a1870a3c..507ad8d36cf 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -195,9 +195,9 @@ in { major = "3"; minor = "10"; patch = "0"; - suffix = "a5"; + suffix = "b3"; }; - sha256 = "BBjlfnA24hnx5rYwOyHnEfZM/Q/dsIlNjxnzev/8XU0="; + sha256 = "05fc4mp2ysb372bzkwbn1b1z01bfldnaqig6rxmif58hs3aawrr2"; inherit (darwin) configd; inherit passthruFun; }; -- cgit 1.4.1 From 94cd70bae26efc34350d53894992fbaf1b1f3c6f Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 13 Mar 2021 15:31:22 +0100 Subject: python3: 3.8 -> 3.9 --- doc/languages-frameworks/python.section.md | 2 +- pkgs/development/interpreters/python/default.nix | 24 +++++++++++++----------- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 15 insertions(+), 13 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/doc/languages-frameworks/python.section.md b/doc/languages-frameworks/python.section.md index 847a41cf23c..cd34fb38ce0 100644 --- a/doc/languages-frameworks/python.section.md +++ b/doc/languages-frameworks/python.section.md @@ -8,7 +8,7 @@ Several versions of the Python interpreter are available on Nix, as well as a high amount of packages. The attribute `python3` refers to the default -interpreter, which is currently CPython 3.8. The attribute `python` refers to +interpreter, which is currently CPython 3.9. The attribute `python` refers to CPython 2.7 for backwards-compatibility. It is also possible to refer to specific versions, e.g. `python38` refers to CPython 3.8, and `pypy` refers to the default PyPy interpreter. diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 507ad8d36cf..176f8db4bff 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -118,7 +118,7 @@ with pkgs; }; sources = { - "python38" = { + python38 = { sourceVersion = { major = "3"; minor = "8"; @@ -127,6 +127,15 @@ with pkgs; }; sha256 = "1n8rjb3jn0j8dvi1qn94rxayc9rh982d8wgkrjy41n1x15k4mwka"; }; + python39 = { + sourceVersion = { + major = "3"; + minor = "9"; + patch = "5"; + suffix = ""; + }; + sha256 = "10vdf46q5ldnzkprm8pldvr5a9hrdpxjv7mpzgdw6vj3cl318nhc"; + }; }; in { @@ -176,18 +185,11 @@ in { inherit passthruFun; } // sources.python38); - python39 = callPackage ./cpython { + python39 = callPackage ./cpython ({ self = python39; - sourceVersion = { - major = "3"; - minor = "9"; - patch = "5"; - suffix = ""; - }; - sha256 = "10vdf46q5ldnzkprm8pldvr5a9hrdpxjv7mpzgdw6vj3cl318nhc"; inherit (darwin) configd; inherit passthruFun; - }; + } // sources.python39); python310 = callPackage ./cpython { self = python310; @@ -224,7 +226,7 @@ in { includeSiteCustomize = false; enableOptimizations = false; mimetypesSupport = false; - } // sources.python38)).overrideAttrs(old: { + } // sources.python39)).overrideAttrs(old: { pname = "python3-minimal"; meta = old.meta // { maintainers = []; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c728c453b43..340a475cdb9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12500,7 +12500,7 @@ in # When switching these sets, please update docs at ../../doc/languages-frameworks/python.md python = python2; python2 = python27; - python3 = python38; + python3 = python39; pypy = pypy2; pypy2 = pypy27; pypy3 = pypy36; -- cgit 1.4.1 From 1e47dd9cb847f57ec859c071d6c697270a53d1e7 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Tue, 25 May 2021 20:30:28 +0200 Subject: cpython: Enable LTO on all builds as it doesn't break reproducibility LTO allows us to optimise the binaries we are shipping a bit further than just with the regular -Ox and other compiler flags. It also is deterministic and doesn't harm our reproducibility efforts while providing us with up to 10% performance gain (and sometimes slightly slower). See the table below for a comparsion of this version with the Python 3.9 build that sets -fno-semantic-interposition. +-------------------------+--------------------+------------------------+--------------+------------------------+ | Benchmark | py39-nsip.nix.json | py39-nsip-lto.nix.json | Change | Significance | +=========================+====================+========================+==============+========================+ | 2to3 | 642 ms | 620 ms | 1.03x faster | Significant (t=12.04) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | chameleon | 14.6 ms | 14.4 ms | 1.02x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | chaos | 182 ms | 182 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | crypto_pyaes | 175 ms | 172 ms | 1.02x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | deltablue | 11.2 ms | 11.2 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | django_template | 82.0 ms | 81.4 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | dulwich_log | 101 ms | 99.8 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | fannkuch | 634 ms | 638 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | float | 176 ms | 189 ms | 1.08x slower | Significant (t=-4.30) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | go | 366 ms | 365 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | hexiom | 14.9 ms | 15.1 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | json_dumps | 18.7 ms | 18.5 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | json_loads | 37.9 us | 37.3 us | 1.02x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | logging_format | 14.2 us | 14.3 us | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | logging_silent | 305 ns | 313 ns | 1.02x slower | Significant (t=-3.91) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | logging_simple | 13.0 us | 13.2 us | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | mako | 24.7 ms | 23.3 ms | 1.06x faster | Significant (t=10.74) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | meteor_contest | 130 ms | 128 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | nbody | 201 ms | 201 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | nqueens | 152 ms | 154 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pathlib | 26.3 ms | 26.2 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pickle | 13.1 us | 13.7 us | 1.05x slower | Significant (t=-10.36) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pickle_dict | 26.6 us | 27.1 us | 1.02x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pickle_list | 4.34 us | 4.31 us | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pickle_pure_python | 738 us | 759 us | 1.03x slower | Significant (t=-5.26) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pidigits | 181 ms | 181 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | pyflate | 959 ms | 974 ms | 1.02x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | python_startup | 34.0 ms | 31.4 ms | 1.08x faster | Significant (t=29.75) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | python_startup_no_site | 15.3 ms | 14.5 ms | 1.06x faster | Significant (t=17.58) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | raytrace | 849 ms | 846 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | regex_compile | 261 ms | 261 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | regex_dna | 187 ms | 221 ms | 1.18x slower | Significant (t=-46.94) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | regex_effbot | 3.66 ms | 3.98 ms | 1.09x slower | Significant (t=-18.55) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | regex_v8 | 29.7 ms | 29.3 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | richards | 113 ms | 110 ms | 1.03x faster | Significant (t=3.47) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | scimark_fft | 592 ms | 590 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | scimark_lu | 253 ms | 265 ms | 1.05x slower | Significant (t=-8.97) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | scimark_monte_carlo | 170 ms | 177 ms | 1.04x slower | Significant (t=-4.96) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | scimark_sor | 310 ms | 315 ms | 1.02x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | scimark_sparse_mat_mult | 8.36 ms | 8.33 ms | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | spectral_norm | 232 ms | 229 ms | 1.02x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sqlalchemy_declarative | 185 ms | 183 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sqlalchemy_imperative | 27.4 ms | 27.6 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sqlite_synth | 4.73 us | 4.73 us | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sympy_expand | 813 ms | 819 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sympy_integrate | 31.6 ms | 31.8 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sympy_str | 477 ms | 479 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | sympy_sum | 245 ms | 247 ms | 1.01x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | telco | 11.3 ms | 11.4 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | tornado_http | 172 ms | 172 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | unpack_sequence | 56.2 ns | 51.2 ns | 1.10x faster | Significant (t=2.50) | +-------------------------+--------------------+------------------------+--------------+------------------------+ | unpickle | 19.8 us | 19.5 us | 1.02x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | unpickle_list | 5.75 us | 5.75 us | 1.00x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | unpickle_pure_python | 524 us | 522 us | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | xml_etree_generate | 148 ms | 148 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | xml_etree_iterparse | 129 ms | 131 ms | 1.02x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | xml_etree_parse | 179 ms | 177 ms | 1.01x faster | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ | xml_etree_process | 118 ms | 119 ms | 1.00x slower | Not significant | +-------------------------+--------------------+------------------------+--------------+------------------------+ --- pkgs/development/interpreters/python/cpython/default.nix | 6 ++++++ pkgs/development/interpreters/python/default.nix | 1 + 2 files changed, 7 insertions(+) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index e0b941e009d..4ee67a452fe 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -41,6 +41,8 @@ , enableOptimizations ? false # enableNoSemanticInterposition is a subset of the enableOptimizations flag that doesn't harm reproducibility. , enableNoSemanticInterposition ? true +# enableLTO is a subset of the enableOptimizations flag that doesn't harm reproducibility. +, enableLTO ? true , reproducibleBuild ? true , pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}" }: @@ -102,6 +104,8 @@ let ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc pythonForBuild + ] ++ optionals (stdenv.cc.isClang && enableLTO) [ + stdenv.cc.cc.libllvm.out ]; buildInputs = filter (p: p != null) ([ @@ -280,6 +284,8 @@ in with passthru; stdenv.mkDerivation { "--with-system-ffi" ] ++ optionals enableOptimizations [ "--enable-optimizations" + ] ++ optionals enableLTO [ + "--with-lto" ] ++ optionals (pythonOlder "3.7") [ # This is unconditionally true starting in CPython 3.7. "--with-threads" diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 176f8db4bff..be0d6ce1e43 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -225,6 +225,7 @@ in { stripBytecode = true; includeSiteCustomize = false; enableOptimizations = false; + enableLTO = false; mimetypesSupport = false; } // sources.python39)).overrideAttrs(old: { pname = "python3-minimal"; -- cgit 1.4.1 From c168edeeb93fd551e8d0eb50387cc44addce7aef Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 14 Jul 2021 23:37:23 -0400 Subject: pypy3: change pythonVersion to 3.7 --- pkgs/development/interpreters/python/default.nix | 8 ++++---- pkgs/top-level/all-packages.nix | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 30134a05628..2c89fdd4219 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -247,15 +247,15 @@ in { inherit (darwin.apple_sdk.frameworks) Security; }; - pypy36 = callPackage ./pypy { - self = pypy36; + pypy37 = callPackage ./pypy { + self = pypy37; sourceVersion = { major = "7"; minor = "3"; patch = "3"; }; - sha256 = "1bq5i2mqgjjfc4rhxgxm6ihwa76vn2qapd7l59ri7xp01p522gd2"; - pythonVersion = "3.6"; + sha256 = "sha256-9slkAfdjMeR0zKLRRDfrOy9ooPJyIKbcvFN0Rf6dW3g="; + pythonVersion = "3.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; inherit passthruFun; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b9f9561022..bb960c3e0ae 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12569,7 +12569,7 @@ in python3 = python38; pypy = pypy2; pypy2 = pypy27; - pypy3 = pypy36; + pypy3 = pypy37; # Python interpreter that is build with all modules, including tkinter. # These are for compatibility and should not be used inside Nixpkgs. @@ -12625,7 +12625,7 @@ in python3Packages = python3.pkgs; pythonInterpreters = callPackage ./../development/interpreters/python { }; - inherit (pythonInterpreters) python27 python36 python37 python38 python39 python310 python3Minimal pypy27 pypy36; + inherit (pythonInterpreters) python27 python36 python37 python38 python39 python310 python3Minimal pypy27 pypy37; # Python package sets. python27Packages = python27.pkgs; -- cgit 1.4.1 From 3d68137c6e5094ac738745ac41ec980af725590b Mon Sep 17 00:00:00 2001 From: Dmitry Kalinkin Date: Wed, 14 Jul 2021 19:37:37 -0400 Subject: pypy: 7.3.3 -> 7.3.5 --- pkgs/development/interpreters/python/default.nix | 8 ++++---- pkgs/development/interpreters/python/pypy/default.nix | 7 +++++-- pkgs/development/interpreters/python/pypy/sqlite_paths.patch | 12 ++++++++++++ 3 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 pkgs/development/interpreters/python/pypy/sqlite_paths.patch (limited to 'pkgs/development/interpreters/python/default.nix') diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 2c89fdd4219..f700eb163a9 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -236,9 +236,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "3"; + patch = "5"; }; - sha256 = "0di3dr5ry4r0hwxh4fbqjhyl5im948wdby0bhijzsxx83c2qhd7n"; + sha256 = "sha256-wERP2YcwWMHA2Z4TqTTpIoXLBZksmWi/Ujwyv5vsCp0="; pythonVersion = "2.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; @@ -252,9 +252,9 @@ in { sourceVersion = { major = "7"; minor = "3"; - patch = "3"; + patch = "5"; }; - sha256 = "sha256-9slkAfdjMeR0zKLRRDfrOy9ooPJyIKbcvFN0Rf6dW3g="; + sha256 = "sha256-2SD+QJqeytnQdKqFaMpfPtNYG+ZvZuXYmIt+xm5tmaI="; pythonVersion = "3.7"; db = db.override { dbmSupport = !stdenv.isDarwin; }; python = python27; diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index e4e95ad4c57..668a4e24b39 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -83,6 +83,11 @@ in with passthru; stdenv.mkDerivation rec { tk_libprefix = tk.libPrefix; tcl_libprefix = tcl.libPrefix; }) + + (substituteAll { + src = ./sqlite_paths.patch; + inherit (sqlite) out dev; + }) ]; postPatch = '' @@ -90,8 +95,6 @@ in with passthru; stdenv.mkDerivation rec { --replace "multiprocessing.cpu_count()" "$NIX_BUILD_CORES" substituteInPlace "lib-python/${if isPy3k then "3/tkinter/tix.py" else "2.7/lib-tk/Tix.py"}" --replace "os.environ.get('TIX_LIBRARY')" "os.environ.get('TIX_LIBRARY') or '${tix}/lib'" - - sed -i "s@libraries=\['sqlite3'\]\$@libraries=['sqlite3'], include_dirs=['${sqlite.dev}/include'], library_dirs=['${sqlite.out}/lib']@" lib_pypy/_sqlite3_build.py ''; buildPhase = '' diff --git a/pkgs/development/interpreters/python/pypy/sqlite_paths.patch b/pkgs/development/interpreters/python/pypy/sqlite_paths.patch new file mode 100644 index 00000000000..42de7efb3ea --- /dev/null +++ b/pkgs/development/interpreters/python/pypy/sqlite_paths.patch @@ -0,0 +1,12 @@ +diff -ur a/lib_pypy/_sqlite3_build.py b/lib_pypy/_sqlite3_build.py +--- a/lib_pypy/_sqlite3_build.py 2021-04-12 01:11:48.000000000 -0400 ++++ b/lib_pypy/_sqlite3_build.py 2021-07-14 18:08:33.000000000 -0400 +@@ -301,6 +301,8 @@ + else: + extra_args = dict( + libraries=libraries, ++ include_dirs=['@dev@/include'], ++ library_dirs=['@out@/lib'] + ) + + SOURCE = """ -- cgit 1.4.1