From 0e94271c4b8358cf51c20d597f78c58eb1d44a1c Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 16 Jul 2021 17:25:55 -0300 Subject: [PATCH 1/5] python3Packages.memory-allocator: init at 0.1.0 --- .../memory-allocator/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/memory-allocator/default.nix diff --git a/pkgs/development/python-modules/memory-allocator/default.nix b/pkgs/development/python-modules/memory-allocator/default.nix new file mode 100644 index 000000000000..dba1d5677d37 --- /dev/null +++ b/pkgs/development/python-modules/memory-allocator/default.nix @@ -0,0 +1,27 @@ +{ lib +, fetchPypi +, buildPythonPackage +, cython +}: + +buildPythonPackage rec { + pname = "memory-allocator"; + version = "0.1.0"; + + src = fetchPypi { + inherit version; + pname = "memory_allocator"; + sha256 = "sha256-UUcR71e3eAQIQpmWM+AVQxVtgHvrNjaIlHo5pURUln0="; + }; + + propagatedBuildInputs = [ + cython + ]; + + meta = with lib; { + description = "An extension class to allocate memory easily with cython"; + homepage = "https://github.com/sagemath/memory_allocator/"; + maintainers = teams.sage.members; + license = licenses.lgpl3Plus; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 431d4a9959e3..f115bc55e8aa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -4469,6 +4469,8 @@ in { memcached = callPackage ../development/python-modules/memcached { }; + memory-allocator = callPackage ../development/python-modules/memory-allocator { }; + memory_profiler = callPackage ../development/python-modules/memory_profiler { }; mercantile = callPackage ../development/python-modules/mercantile { }; From b565d30c478517db18fdafb03bd3c1b8bfb07a75 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 16 Jul 2021 18:13:03 -0300 Subject: [PATCH 2/5] maxima: 5.44.0 -> 5.45.0 --- pkgs/applications/science/math/maxima/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix index 7edbeaee085c..2b82a8f81705 100644 --- a/pkgs/applications/science/math/maxima/default.nix +++ b/pkgs/applications/science/math/maxima/default.nix @@ -4,7 +4,7 @@ let name = "maxima"; - version = "5.44.0"; + version = "5.45.0"; lisp-compiler = if ecl-fasl then ecl else sbcl; @@ -18,7 +18,7 @@ stdenv.mkDerivation ({ src = fetchurl { url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz"; - sha256 = "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr"; + sha256 = "sha256-x2MfMmRIBc67e6/vOrUzHEus0sJ+OE/YgyO1A5pg0Ng="; }; nativeBuildInputs = [ From 9be264795c3840701b0bd94bd114678c2fc8b904 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 19 Jul 2021 00:38:20 -0300 Subject: [PATCH 3/5] pynac: import segfault fix --- pkgs/applications/science/math/pynac/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/applications/science/math/pynac/default.nix b/pkgs/applications/science/math/pynac/default.nix index 138c97d73be1..88515b92beaf 100644 --- a/pkgs/applications/science/math/pynac/default.nix +++ b/pkgs/applications/science/math/pynac/default.nix @@ -1,4 +1,5 @@ { lib, stdenv +, fetchpatch , fetchFromGitHub , autoreconfHook , pkg-config @@ -20,6 +21,16 @@ stdenv.mkDerivation rec { sha256 = "sha256-ocR7emXtKs+Xe2f6dh4xEDAacgiolY8mtlLnWnNBS8A="; }; + patches = [ + # the patch below is included in sage 9.4 and should be included + # in a future pynac release. see https://trac.sagemath.org/ticket/28357 + (fetchpatch { + name = "realpartloop.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/realpartloop.patch?h=9.4.beta5"; + sha256 = "sha256-1nj0xtlFN5fZKEiRLD+tiW/ZtxMQre1ziEGA0OVUGE4="; + }) + ]; + buildInputs = [ flint gmp From 46c3703ec1fe45767a8781e290ed874704d5d18e Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Fri, 16 Jul 2021 17:13:01 -0300 Subject: [PATCH 4/5] sage: 9.3 -> 9.4 --- .../patches/do-not-test-find-library.patch | 18 +++--- .../sage/patches/ignore-cmp-deprecation.patch | 24 -------- .../science/math/sage/sage-src.nix | 61 +------------------ .../science/math/sage/sagelib.nix | 2 + 4 files changed, 14 insertions(+), 91 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch diff --git a/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch b/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch index 0dbfba642e82..178cef3e54ea 100644 --- a/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch +++ b/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch @@ -1,8 +1,8 @@ diff --git a/src/sage/env.py b/src/sage/env.py -index 2908f5d04f..81dfd75c0d 100644 +index 95980cc2df..37107a30e1 100644 --- a/src/sage/env.py +++ b/src/sage/env.py -@@ -218,93 +218,12 @@ NTL_LIBDIR = var("NTL_LIBDIR") +@@ -227,93 +227,12 @@ OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "") SAGE_BANNER = var("SAGE_BANNER", "") SAGE_IMPORTALL = var("SAGE_IMPORTALL", "yes") @@ -51,10 +51,9 @@ index 2908f5d04f..81dfd75c0d 100644 - if sys.platform == 'cygwin': - # Later down we take the first matching DLL found, so search - # SAGE_LOCAL first so that it takes precedence -- search_directories = [ -- Path(SAGE_LOCAL) / 'bin', -- Path(sysconfig.get_config_var('BINDIR')), -- ] +- if SAGE_LOCAL: +- search_directories.append(Path(SAGE_LOCAL) / 'bin') +- search_directories.append(Path(sysconfig.get_config_var('BINDIR'))) - # Note: The following is not very robust, since if there are multible - # versions for the same library this just selects one more or less - # at arbitrary. However, practically speaking, on Cygwin, there @@ -66,14 +65,15 @@ index 2908f5d04f..81dfd75c0d 100644 - else: - ext = 'so' - -- search_directories = [Path(SAGE_LOCAL) / 'lib'] +- if SAGE_LOCAL: +- search_directories.append(Path(SAGE_LOCAL) / 'lib') - libdir = sysconfig.get_config_var('LIBDIR') - if libdir is not None: - libdir = Path(libdir) - search_directories.append(libdir) - - multiarchlib = sysconfig.get_config_var('MULTIARCH') -- if multiarchlib is not None: +- if multiarchlib is not None: - search_directories.append(libdir / multiarchlib), - - patterns = [f'lib{libname}.{ext}'] @@ -97,4 +97,4 @@ index 2908f5d04f..81dfd75c0d 100644 +GAP_SO = var("GAP_SO", '/default') # post process - if ' ' in DOT_SAGE: + if DOT_SAGE is not None and ' ' in DOT_SAGE: diff --git a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch deleted file mode 100644 index a91ee319b8f0..000000000000 --- a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py -index 6e034dcb5a..8ec60ec72b 100644 ---- a/src/sage/tests/cmdline.py -+++ b/src/sage/tests/cmdline.py -@@ -660,8 +660,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False - sage: with open(input, 'w') as F: - ....: _ = F.write(s) - sage: L = ["sage", "--rst2ipynb", input, output] -- sage: test_executable(L) # optional - rst2ipynb -- ('', '', 0) -+ sage: test_executable(L)[2] # optional - rst2ipynb -+ 0 - sage: import json # optional - rst2ipynb - sage: d = json.load(open(output,'r')) # optional - rst2ipynb - sage: type(d) # optional - rst2ipynb -@@ -757,8 +757,6 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False - /// - 4 - }}} -- sage: err # py2 # optional -- sagenb -- '' - sage: ret # py2 # optional -- sagenb - 0 - diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 218ab920a872..1e1fd0a42616 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -29,14 +29,14 @@ let ); in stdenv.mkDerivation rec { - version = "9.3"; + version = "9.4"; pname = "sage-src"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - sha256 = "sha256-l9DX8jcDdKA7GJ6xU+nBsmlZxrcZ9ZUAJju621ooBEo="; + sha256 = "sha256-jqkr4meG02KbTCMsGvyr1UbosS4ZuUJhPXU/InuS+9A="; }; # Patches needed because of particularities of nix or the way this is packaged. @@ -77,64 +77,9 @@ stdenv.mkDerivation rec { # be empty since dependencies update all the time. packageUpgradePatches = [ # After updating smypow to (https://trac.sagemath.org/ticket/3360) we can - # now set the cache dir to be withing the .sage directory. This is not + # now set the cache dir to be within the .sage directory. This is not # strictly necessary, but keeps us from littering in the user's HOME. ./patches/sympow-cache.patch - - # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests - ./patches/ignore-cmp-deprecation.patch - - # remove use of matplotlib function deprecated in 3.4 - # https://trac.sagemath.org/ticket/31827 - (fetchSageDiff { - base = "9.3"; - name = "remove-matplotlib-deprecated-function.patch"; - rev = "32b2bcaefddc4fa3d2aee6fa690ce1466cbb5948"; - sha256 = "sha256-SXcUGBMOoE9HpuBzgKC3P6cUmM5MiktXbe/7dVdrfWo="; - }) - - # pari 2.13 update - # https://trac.sagemath.org/ticket/30801 - # - # the last commit in that ticket is - # c78b1470fccd915e2fa93f95f2fefba6220fb1f7, but commits after - # 10a4531721d2700fd717e2b3a1364508ffd971c3 only deal with 32-bit - # and post-26635 breakage, none of which is relevant to us. since - # there are post-9.4.beta0 rebases after that, we just skip later - # commits. - (fetchSageDiff { - base = "9.3"; - name = "pari-2.13.1.patch"; - rev = "10a4531721d2700fd717e2b3a1364508ffd971c3"; - sha256 = "sha256-gffWKK9CMREaNOb5zb63iZUgON4FvsPrMQNqe+5ZU9E="; - }) - - # sympy 1.8 update - # https://trac.sagemath.org/ticket/31647 - (fetchSageDiff { - base = "9.4.beta0"; - name = "sympy-1.8.patch"; - rev = "fa864b36e15696450c36d54215b1e68183b29d25"; - sha256 = "sha256-fj/9QEZlVF0fw9NpWflkTuBSKpGjCE6b96ECBgdn77o="; - }) - - # sphinx 4 update - # https://trac.sagemath.org/ticket/31696 - (fetchSageDiff { - base = "9.4.beta3"; - name = "sphinx-4.patch"; - rev = "bc84af8c795b7da433d2000afc3626ee65ba28b8"; - sha256 = "sha256-5Kvs9jarC8xRIU1rdmvIWxQLC25ehiTLJpg5skh8WNM="; - }) - - # eclib 20210625 update - # https://trac.sagemath.org/ticket/31443 - (fetchSageDiff { - base = "9.4.beta3"; - name = "eclib-20210625.patch"; - rev = "789550ca04c94acfb1e803251538996a34962038"; - sha256 = "sha256-VlyEn5hg3joG8t/GwiRfq9TzJ54AoHxLolsNQ3shc2c="; - }) ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index f60cb64d2e8d..b9c98ed64d01 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -27,6 +27,7 @@ , linbox , m4ri , m4rie +, memory-allocator , libmpc , mpfi , ntl @@ -107,6 +108,7 @@ buildPythonPackage rec { lrcalc m4ri m4rie + memory-allocator mpfi ntl blas From 1a5be74ddddcbef25314f3162ab00c7c4ff7116d Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Sun, 22 Aug 2021 14:16:35 -0300 Subject: [PATCH 5/5] python3Packages.memory-allocator: add pythonImportsCheck --- .../development/python-modules/memory-allocator/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/memory-allocator/default.nix b/pkgs/development/python-modules/memory-allocator/default.nix index dba1d5677d37..cbb521ea985a 100644 --- a/pkgs/development/python-modules/memory-allocator/default.nix +++ b/pkgs/development/python-modules/memory-allocator/default.nix @@ -14,9 +14,9 @@ buildPythonPackage rec { sha256 = "sha256-UUcR71e3eAQIQpmWM+AVQxVtgHvrNjaIlHo5pURUln0="; }; - propagatedBuildInputs = [ - cython - ]; + propagatedBuildInputs = [ cython ]; + + pythonImportsCheck = [ "memory_allocator" ]; meta = with lib; { description = "An extension class to allocate memory easily with cython";