From d1d1650e19b9c7dad39656ec2b2976ef4e4b0dd1 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 17 Jul 2021 18:25:03 +0200 Subject: [PATCH 1/3] python3Packages.beniget: 0.3.0 -> 0.4.0 --- pkgs/development/python-modules/beniget/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/beniget/default.nix b/pkgs/development/python-modules/beniget/default.nix index c5508fb33032..f8733eeed626 100644 --- a/pkgs/development/python-modules/beniget/default.nix +++ b/pkgs/development/python-modules/beniget/default.nix @@ -6,11 +6,11 @@ buildPythonPackage rec { pname = "beniget"; - version = "0.3.0"; + version = "0.4.0"; src = fetchPypi { inherit pname version; - sha256 = "062c893be9cdf87c3144fb15041cce4d81c67107c1591952cd45fdce789a0ff1"; + sha256 = "72bbd47b1ae93690f5fb2ad3902ce1ae61dcd868ce6cfbf33e9bad71f9ed8749"; }; propagatedBuildInputs = [ From 848145ee26c0e50e3cf1558aa94e30986868a4c1 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 17 Jul 2021 18:26:08 +0200 Subject: [PATCH 2/3] python3Packages.gast: 0.4.0 -> 0.5.0 --- pkgs/development/python-modules/gast/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/gast/default.nix b/pkgs/development/python-modules/gast/default.nix index 38334d5cc6b4..7e8d9f8d4ac5 100644 --- a/pkgs/development/python-modules/gast/default.nix +++ b/pkgs/development/python-modules/gast/default.nix @@ -2,10 +2,10 @@ buildPythonPackage rec { pname = "gast"; - version = "0.4.0"; + version = "0.5.0"; src = fetchPypi { inherit pname version; - sha256 = "40feb7b8b8434785585ab224d1568b857edb18297e5a3047f1ba012bc83b42c1"; + sha256 = "8109cbe7aa0f7bf7e4348379da05b8137ea1f059f073332c3c1cedd57db8541f"; }; checkInputs = [ astunparse ] ; meta = with lib; { From 1d505e4906259d453d7ae41205e367048c0c7900 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Sat, 17 Jul 2021 18:22:11 +0200 Subject: [PATCH 3/3] python3Packages.pythran: 0.9.8post3 -> 0.9.12 --- .../0001-hardcode-path-to-libgomp.patch | 64 +++++++++++++++++++ .../python-modules/pythran/default.nix | 21 ++++-- 2 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 pkgs/development/python-modules/pythran/0001-hardcode-path-to-libgomp.patch diff --git a/pkgs/development/python-modules/pythran/0001-hardcode-path-to-libgomp.patch b/pkgs/development/python-modules/pythran/0001-hardcode-path-to-libgomp.patch new file mode 100644 index 000000000000..14d2c2fbfd29 --- /dev/null +++ b/pkgs/development/python-modules/pythran/0001-hardcode-path-to-libgomp.patch @@ -0,0 +1,64 @@ +From 208fe98f10c580a5a2fb6a8cfdd56de109073925 Mon Sep 17 00:00:00 2001 +From: Frederik Rietdijk +Date: Sat, 17 Jul 2021 18:36:27 +0200 +Subject: [PATCH] hardcode path to libgomp + +--- + omp/__init__.py | 40 ++++------------------------------------ + 1 file changed, 4 insertions(+), 36 deletions(-) + +diff --git a/omp/__init__.py b/omp/__init__.py +index bddae3063..9ba3678d8 100644 +--- a/omp/__init__.py ++++ b/omp/__init__.py +@@ -69,43 +69,11 @@ class OpenMP(object): + + def init_not_msvc(self): + """ Find OpenMP library and try to load if using ctype interface. """ +- # find_library() does not search automatically LD_LIBRARY_PATH +- paths = os.environ.get('LD_LIBRARY_PATH', '').split(':') ++ libgomp_path = "@gomp@" + +- for libomp_name in self.get_libomp_names(): +- if cxx is None or sys.platform == 'win32': +- # Note: Clang supports -print-file-name, but not yet for +- # clang-cl as of v12.0.0 (April '21) +- continue +- +- cmd = [cxx, '-print-file-name=' + libomp_name] +- # the subprocess can fail in various ways in that case just give up +- try: +- path = os.path.dirname(check_output(cmd).decode().strip()) +- if path: +- paths.append(path) +- except (OSError, CalledProcessError): +- pass +- +- # Try to load find libgomp shared library using loader search dirs +- libgomp_path = find_library("gomp") +- +- # Try to use custom paths if lookup failed +- for path in paths: +- if libgomp_path: +- break +- path = path.strip() +- if os.path.isdir(path): +- libgomp_path = find_library(os.path.join(str(path), "libgomp")) +- +- if not libgomp_path: +- raise ImportError("I can't find a shared library for libgomp," +- " you may need to install it or adjust the " +- "LD_LIBRARY_PATH environment variable.") +- else: +- # Load the library (shouldn't fail with an absolute path right?) +- self.libomp = ctypes.CDLL(libgomp_path) +- self.version = 45 ++ # Load the library (shouldn't fail with an absolute path right?) ++ self.libomp = ctypes.CDLL(libgomp_path) ++ self.version = 45 + + def __getattr__(self, name): + """ +-- +2.32.0 + diff --git a/pkgs/development/python-modules/pythran/default.nix b/pkgs/development/python-modules/pythran/default.nix index 864234a37e27..10dc9f305724 100644 --- a/pkgs/development/python-modules/pythran/default.nix +++ b/pkgs/development/python-modules/pythran/default.nix @@ -1,4 +1,5 @@ { lib +, python , buildPythonPackage , fetchFromGitHub , pytestrunner @@ -12,19 +13,31 @@ , pytestCheckHook , scipy , isPy3k +, substituteAll }: -buildPythonPackage rec { +let + inherit (python) stdenv; + +in buildPythonPackage rec { pname = "pythran"; - version = "0.9.8post3"; + version = "0.9.12"; src = fetchFromGitHub { owner = "serge-sans-paille"; repo = "pythran"; rev = version; - sha256 = "sha256-GCWjJlf7zpFzELR6wTF8FoJzJ3F/WdT1hHjY5A5h/+4="; + sha256 = "sha256-lQbVq4K/Q8RzlFhE+l3HPCmUGmauXawcKe31kfbUHsI="; }; + patches = [ + # Hardcode path to mp library + (substituteAll { + src = ./0001-hardcode-path-to-libgomp.patch; + gomp = "${stdenv.cc.cc.lib}/lib/libgomp${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) + ]; + nativeBuildInputs = [ pytestrunner ]; @@ -62,7 +75,7 @@ buildPythonPackage rec { meta = { description = "Ahead of Time compiler for numeric kernels"; - homepage = https://github.com/serge-sans-paille/pythran; + homepage = "https://github.com/serge-sans-paille/pythran"; license = lib.licenses.bsd3; };