From 842ad7258a133aa1b9f5ac0d23b8c7752143cd28 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Sat, 4 Apr 2020 17:29:01 +0200 Subject: [PATCH 01/22] icecream: init at 2020-04-15 --- pkgs/servers/icecream/default.nix | 25 +++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 27 insertions(+) create mode 100644 pkgs/servers/icecream/default.nix diff --git a/pkgs/servers/icecream/default.nix b/pkgs/servers/icecream/default.nix new file mode 100644 index 00000000000..1800700b040 --- /dev/null +++ b/pkgs/servers/icecream/default.nix @@ -0,0 +1,25 @@ +{ stdenv, fetchFromGitHub, autoreconfHook, docbook2x, libarchive, libcap_ng, lzo, zstd, docbook_xml_dtd_45 }: + +stdenv.mkDerivation rec { + pname = "icecream"; + version = "2020-04-15"; + + src = fetchFromGitHub { + owner = "icecc"; + repo = pname; + rev = "c370c4d701d05e1872d44d1c1642a774a7f25807"; + sha256 = "0ld2ihd39irlk4wshpbw7inmgyl3x0gbkgsy10izcm1wwfc0x2ac"; + }; + enableParallelBuilding = true; + + nativeBuildInputs = [ autoreconfHook docbook2x ]; + buildInputs = [ libarchive libcap_ng lzo zstd docbook_xml_dtd_45 ]; + + meta = with stdenv.lib; { + description = "Distributed compiler with a central scheduler to share build load"; + inherit (src.meta) homepage; + license = licenses.gpl2; + maintainers = with maintainers; [ emantor ]; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c74f2249fc8..df74d5aa9ba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16574,6 +16574,8 @@ in hydron = callPackage ../servers/hydron { }; + icecream = callPackage ../servers/icecream { }; + icingaweb2 = callPackage ../servers/icingaweb2 { }; icingaweb2Modules = { theme-april = callPackage ../servers/icingaweb2/theme-april { }; From e50baf22df4cd61b78f2231c7c8cec8b2c6a0071 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Sat, 4 Apr 2020 17:29:18 +0200 Subject: [PATCH 02/22] icemon: init at v3.3 --- .../networking/icemon/default.nix | 24 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/applications/networking/icemon/default.nix diff --git a/pkgs/applications/networking/icemon/default.nix b/pkgs/applications/networking/icemon/default.nix new file mode 100644 index 00000000000..b757445eb08 --- /dev/null +++ b/pkgs/applications/networking/icemon/default.nix @@ -0,0 +1,24 @@ +{ lib, fetchFromGitHub, mkDerivation, qtbase, cmake, extra-cmake-modules, icecream, libcap_ng, lzo, zstd, libarchive, wrapQtAppsHook }: + +mkDerivation rec { + pname = "icemon"; + version = "3.3"; + + src = fetchFromGitHub { + owner = "icecc"; + repo = pname; + rev = "v${version}"; + sha256 = "09jnipr67dhawbxfn69yh7mmjrkylgiqmd0gmc2limd3z15d7pgc"; + }; + + nativeBuildInputs = [ cmake extra-cmake-modules wrapQtAppsHook ]; + buildInputs = [ icecream qtbase libcap_ng lzo zstd libarchive ]; + + meta = with lib; { + description = "Icecream GUI Monitor"; + inherit (src.meta) homepage; + license = licenses.gpl2; + maintainers = with maintainers; [ emantor ]; + platforms = with platforms; linux ++ darwin; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index df74d5aa9ba..7bf165fc615 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4536,6 +4536,8 @@ in icecast = callPackage ../servers/icecast { }; + icemon = libsForQt5.callPackage ../applications/networking/icemon { }; + icepeak = haskell.lib.justStaticExecutables haskellPackages.icepeak; iceshelf = callPackage ../tools/backup/iceshelf { }; From 733181d7664c3b71798e97a922ad3296b4201089 Mon Sep 17 00:00:00 2001 From: Rouven Czerwinski Date: Sat, 4 Apr 2020 19:15:49 +0200 Subject: [PATCH 03/22] nixos/icecream: add modules This adds modules for the icecream scheduler and daemon. Icecream can be used for distributed compilation, especially in environments with diverse toolchains, since it sends the complete build environment to the daemon. Unfortunatley the daemon can't be run with DynamicUser = true, since the daemon requires to be started as root in order to accept other build environments, see [1]. [1]: https://github.com/icecc/icecream#using-icecream-in-heterogeneous-environments --- nixos/modules/module-list.nix | 2 + .../services/networking/icecream/daemon.nix | 155 ++++++++++++++++++ .../networking/icecream/scheduler.nix | 101 ++++++++++++ 3 files changed, 258 insertions(+) create mode 100644 nixos/modules/services/networking/icecream/daemon.nix create mode 100644 nixos/modules/services/networking/icecream/scheduler.nix diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix index ed6201237b3..710e60c0712 100644 --- a/nixos/modules/module-list.nix +++ b/nixos/modules/module-list.nix @@ -649,6 +649,8 @@ ./services/networking/hylafax/default.nix ./services/networking/i2pd.nix ./services/networking/i2p.nix + ./services/networking/icecream/scheduler.nix + ./services/networking/icecream/daemon.nix ./services/networking/iodine.nix ./services/networking/iperf3.nix ./services/networking/ircd-hybrid/default.nix diff --git a/nixos/modules/services/networking/icecream/daemon.nix b/nixos/modules/services/networking/icecream/daemon.nix new file mode 100644 index 00000000000..2975696f9c2 --- /dev/null +++ b/nixos/modules/services/networking/icecream/daemon.nix @@ -0,0 +1,155 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.icecream.daemon; +in { + + ###### interface + + options = { + + services.icecream.daemon = { + + enable = mkEnableOption "Icecream Daemon"; + + openFirewall = mkOption { + type = types.bool; + description = '' + Whether to automatically open receive port in the firewall. + ''; + }; + + openBroadcast = mkOption { + type = types.bool; + description = '' + Whether to automatically open the firewall for scheduler discovery. + ''; + }; + + cacheLimit = mkOption { + type = types.ints.u16; + default = 256; + description = '' + Maximum size in Megabytes of cache used to store compile environments of compile clients. + ''; + }; + + netName = mkOption { + type = types.str; + default = "ICECREAM"; + description = '' + Network name to connect to. A scheduler with the same name needs to be running. + ''; + }; + + noRemote = mkOption { + type = types.bool; + default = false; + description = '' + Prevent jobs from other nodes being scheduled on this daemon. + ''; + }; + + schedulerHost = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Explicit scheduler hostname, useful in firewalled environments. + + Uses scheduler autodiscovery via broadcast if set to null. + ''; + }; + + maxProcesses = mkOption { + type = types.nullOr types.ints.u16; + default = null; + description = '' + Maximum number of compile jobs started in parallel for this daemon. + + Uses the number of CPUs if set to null. + ''; + }; + + nice = mkOption { + type = types.int; + default = 5; + description = '' + The level of niceness to use. + ''; + }; + + hostname = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Hostname of the daemon in the icecream infrastructure. + + Uses the hostname retrieved via uname if set to null. + ''; + }; + + user = mkOption { + type = types.str; + default = "icecc"; + description = '' + User to run the icecream daemon as. Set to root to enable receive of + remote compile environments. + ''; + }; + + package = mkOption { + default = pkgs.icecream; + defaultText = "pkgs.icecream"; + type = types.package; + description = "Icecream package to use."; + }; + + extraArgs = mkOption { + type = types.listOf types.str; + default = []; + description = "Additional command line parameters."; + example = [ "-v" ]; + }; + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + networking.firewall.allowedTCPPorts = mkIf cfg.openFirewall [ 10245 ]; + networking.firewall.allowedUDPPorts = mkIf cfg.openBroadcast [ 8765 ]; + + systemd.services.icecc-daemon = { + description = "Icecream compile daemon"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = escapeShellArgs ([ + "${getBin cfg.package}/bin/iceccd" + "-b" "$STATE_DIRECTORY" + "-u" "icecc" + (toString cfg.nice) + ] + ++ optionals (cfg.schedulerHost != null) ["-s" cfg.schedulerHost] + ++ optionals (cfg.netName != null) [ "-n" cfg.netName ] + ++ optionals (cfg.cacheLimit != null) [ "--cache-limit" (toString cfg.cacheLimit) ] + ++ optionals (cfg.maxProcesses != null) [ "-m" (toString cfg.maxProcesses) ] + ++ optionals (cfg.hostname != null) [ "-N" (cfg.hostname) ] + ++ optional cfg.noRemote "--no-remote" + ++ cfg.extraArgs); + DynamicUser = true; + User = "icecc"; + Group = "icecc"; + StateDirectory = "icecc"; + RuntimeDirectory = "icecc"; + AmbientCapabilities = "CAP_SYS_CHROOT"; + CapabilityBoundingSet = "CAP_SYS_CHROOT"; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ emantor ]; +} diff --git a/nixos/modules/services/networking/icecream/scheduler.nix b/nixos/modules/services/networking/icecream/scheduler.nix new file mode 100644 index 00000000000..4ccbf27015d --- /dev/null +++ b/nixos/modules/services/networking/icecream/scheduler.nix @@ -0,0 +1,101 @@ +{ config, lib, pkgs, ... }: + +with lib; + +let + cfg = config.services.icecream.scheduler; +in { + + ###### interface + + options = { + + services.icecream.scheduler = { + enable = mkEnableOption "Icecream Scheduler"; + + netName = mkOption { + type = types.nullOr types.str; + default = null; + description = '' + Network name for the icecream scheduler. + + Uses the default ICECREAM if null. + ''; + }; + + port = mkOption { + type = types.port; + default = 8765; + description = '' + Server port to listen for icecream daemon requests. + ''; + }; + + openFirewall = mkOption { + type = types.bool; + description = '' + Whether to automatically open the daemon port in the firewall. + ''; + }; + + openTelnet = mkOption { + type = types.bool; + default = false; + description = '' + Whether to open the telnet TCP port on 8766. + ''; + }; + + persistentClientConnection = mkOption { + type = types.bool; + default = false; + description = '' + Whether to prevent clients from connecting to a better scheduler. + ''; + }; + + package = mkOption { + default = pkgs.icecream; + defaultText = "pkgs.icecream"; + type = types.package; + description = "Icecream package to use."; + }; + + extraArgs = mkOption { + type = types.listOf types.str; + default = []; + description = "Additional command line parameters"; + example = [ "-v" ]; + }; + }; + }; + + ###### implementation + + config = mkIf cfg.enable { + networking.firewall.allowedTCPPorts = mkMerge [ + (mkIf cfg.openFirewall [ cfg.port ]) + (mkIf cfg.openTelnet [ 8766 ]) + ]; + + systemd.services.icecc-scheduler = { + description = "Icecream scheduling server"; + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + + serviceConfig = { + ExecStart = escapeShellArgs ([ + "${getBin cfg.package}/bin/icecc-scheduler" + "-p" (toString cfg.port) + ] + ++ optionals (cfg.netName != null) [ "-n" (toString cfg.netName) ] + ++ optional cfg.persistentClientConnection "-r" + ++ cfg.extraArgs); + + DynamicUser = true; + }; + }; + }; + + meta.maintainers = with lib.maintainers; [ emantor ]; +} From 5c4136daf7c182b631ab0f298d30464d88086f40 Mon Sep 17 00:00:00 2001 From: Masanori Ogino <167209+omasanori@users.noreply.github.com> Date: Thu, 22 Oct 2020 17:20:17 +0900 Subject: [PATCH 04/22] sage: 8.9 -> 9.2 --- .../science/math/sage/default.nix | 33 +-------- .../science/math/sage/flask-oldsessions.nix | 36 --------- .../science/math/sage/flask-openid.nix | 28 ------- ...3-optional-tests-when-all-of-sage-is.patch | 21 ++---- .../patches/do-not-test-find-library.patch | 33 ++++++--- .../math/sage/patches/docutils-0.15.patch | 24 ------ .../sage/patches/ignore-cmp-deprecation.patch | 30 ++++---- ...-werkzeug-immutable-dict-deprecation.patch | 12 --- .../math/sage/patches/pari-stackwarn.patch | 20 ----- .../sage/patches/python-5755-hotpatch.patch | 28 ------- .../sage/patches/sagenb-cmp-deprecation.patch | 13 ---- .../math/sage/patches/sympow-cache.patch | 14 ++-- .../science/math/sage/pybrial.nix | 25 ------- .../science/math/sage/python-openid.nix | 40 ---------- .../science/math/sage/sage-src.nix | 74 +------------------ .../science/math/sage/sage-with-env.nix | 6 +- pkgs/applications/science/math/sage/sage.nix | 1 - .../science/math/sage/sagedoc.nix | 2 - .../science/math/sage/sagelib.nix | 6 ++ .../applications/science/math/sage/sagenb.nix | 57 -------------- 20 files changed, 66 insertions(+), 437 deletions(-) delete mode 100644 pkgs/applications/science/math/sage/flask-oldsessions.nix delete mode 100644 pkgs/applications/science/math/sage/flask-openid.nix delete mode 100644 pkgs/applications/science/math/sage/patches/docutils-0.15.patch delete mode 100644 pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch delete mode 100644 pkgs/applications/science/math/sage/patches/pari-stackwarn.patch delete mode 100644 pkgs/applications/science/math/sage/patches/python-5755-hotpatch.patch delete mode 100644 pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch delete mode 100644 pkgs/applications/science/math/sage/pybrial.nix delete mode 100644 pkgs/applications/science/math/sage/python-openid.nix delete mode 100644 pkgs/applications/science/math/sage/sagenb.nix diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix index caf51c3da25..2a95e9a5985 100644 --- a/pkgs/applications/science/math/sage/default.nix +++ b/pkgs/applications/science/math/sage/default.nix @@ -9,30 +9,11 @@ let inherit (pkgs) symlinkJoin callPackage nodePackages; - # https://trac.sagemath.org/ticket/15980 for tracking of python3 support - python = pkgs.python2.override { + python = pkgs.python3.override { packageOverrides = self: super: { - # python packages that appear unmaintained and were not accepted into the nixpkgs - # tree because of that. These packages are only dependencies of the more-or-less - # deprecated sagenb. However sagenb is still a default dependency and the doctests - # depend on it. - # See https://github.com/NixOS/nixpkgs/pull/38787 for a discussion. - # The dependency on the sage notebook (and therefore these packages) will be - # removed in the future: - # https://trac.sagemath.org/ticket/25837 - flask-oldsessions = self.callPackage ./flask-oldsessions.nix {}; - flask-openid = self.callPackage ./flask-openid.nix {}; - python-openid = self.callPackage ./python-openid.nix {}; - sagenb = self.callPackage ./sagenb.nix { - mathjax = nodePackages.mathjax; - }; - - # Package with a cyclic dependency with sage - pybrial = self.callPackage ./pybrial.nix {}; - # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies sagelib = self.callPackage ./sagelib.nix { - inherit flint ecl arb; + inherit flint arb; inherit sage-src env-locations pynac singular; linbox = pkgs.linbox.override { withSage = true; }; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig @@ -59,7 +40,7 @@ let # A bash script setting various environment variables to tell sage where # the files its looking fore are located. Also see `sage-env`. env-locations = callPackage ./env-locations.nix { - inherit pari_data ecl; + inherit pari_data; inherit singular maxima-ecl; cysignals = python.pkgs.cysignals; three = nodePackages.three; @@ -71,7 +52,7 @@ let sage-env = callPackage ./sage-env.nix { sagelib = python.pkgs.sagelib; inherit env-locations; - inherit python ecl singular palp flint pynac pythonEnv maxima-ecl; + inherit python singular palp flint pynac pythonEnv maxima-ecl; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig }; @@ -102,8 +83,6 @@ let pythonRuntimeDeps = with python.pkgs; [ sagelib - pybrial - sagenb cvxopt networkx service-identity @@ -129,7 +108,6 @@ let singular = pkgs.singular.override { inherit flint; }; - # https://trac.sagemath.org/ticket/26625 maxima-ecl = pkgs.maxima-ecl; # *not* to confuse with the python package "pynac" @@ -161,9 +139,6 @@ let pari-seadata-small ]; }; - - # https://trac.sagemath.org/ticket/22191 - ecl = pkgs.ecl_16_1_2; in # A wrapper around sage that makes sure sage finds its docs (if they were build). callPackage ./sage.nix { diff --git a/pkgs/applications/science/math/sage/flask-oldsessions.nix b/pkgs/applications/science/math/sage/flask-oldsessions.nix deleted file mode 100644 index 86fe9912c19..00000000000 --- a/pkgs/applications/science/math/sage/flask-oldsessions.nix +++ /dev/null @@ -1,36 +0,0 @@ -{ stdenv -, buildPythonPackage -, fetchFromGitHub -, python -, flask -}: - -buildPythonPackage rec { - pname = "Flask-OldSessions"; - version = "0.10"; - - # no artifact on pypi: https://github.com/mitsuhiko/flask-oldsessions/issues/1 - src = fetchFromGitHub { - owner = "mitsuhiko"; - repo = "flask-oldsessions"; - rev = version; - sha256 = "04b5m8njjiwld9a0zw55iqwvyjgwcpdbhz1cic8nyhgcmypbicqn"; - }; - - propagatedBuildInputs = [ - flask - ]; - - # missing module flask.testsuite, probably assumes an old version of flask - doCheck = false; - checkPhase = '' - ${python.interpreter} run-tests.py - ''; - - meta = with stdenv.lib; { - description = "Provides a session class that works like the one in Flask before 0.10."; - license = licenses.bsd2; - maintainers = teams.sage.members; - homepage = "https://github.com/mitsuhiko/flask-oldsessions"; - }; -} diff --git a/pkgs/applications/science/math/sage/flask-openid.nix b/pkgs/applications/science/math/sage/flask-openid.nix deleted file mode 100644 index 900b033429e..00000000000 --- a/pkgs/applications/science/math/sage/flask-openid.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ stdenv -, buildPythonPackage -, fetchPypi -, flask -, python-openid -}: - -buildPythonPackage rec { - pname = "Flask-OpenID"; - version = "1.2.5"; - - src = fetchPypi { - inherit pname version; - sha256 = "1aycwmwi7ilcaa5ab8hm0bp6323zl8z25q9ha0gwrl8aihfgx3ss"; - }; - - propagatedBuildInputs = [ - flask - python-openid - ]; - - meta = with stdenv.lib; { - description = "Adds openid support to flask applications"; - license = licenses.bsd2; - maintainers = teams.sage.members; - homepage = "https://pythonhosted.org/Flask-OpenID/"; - }; -} diff --git a/pkgs/applications/science/math/sage/patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch b/pkgs/applications/science/math/sage/patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch index 8cd80281d0e..d5c19a54fd9 100644 --- a/pkgs/applications/science/math/sage/patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch +++ b/pkgs/applications/science/math/sage/patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch @@ -1,17 +1,17 @@ -From 8218bd4fdeb4c92de8af0d3aabec55980fc4fb3d Mon Sep 17 00:00:00 2001 +From f5ea42a7aaed7611fb55b65897b9fcf2b7bcf97e Mon Sep 17 00:00:00 2001 From: Timo Kaufmann Date: Sun, 21 Oct 2018 17:52:40 +0200 Subject: [PATCH] Only test py2/py3 optional tests when all of sage is tested --- - src/sage/doctest/control.py | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) + src/sage/doctest/control.py | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py -index bf18df8b2b..935c67abf7 100644 +index 2d93841e50..6d156e29a1 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py -@@ -362,7 +362,8 @@ class DocTestController(SageObject): +@@ -375,7 +375,8 @@ class DocTestController(SageObject): if not optionaltag_regex.search(o): raise ValueError('invalid optional tag {!r}'.format(o)) @@ -21,15 +21,6 @@ index bf18df8b2b..935c67abf7 100644 self.options = options -@@ -765,7 +766,7 @@ class DocTestController(SageObject): - sage: DC = DocTestController(DD, [dirname]) - sage: DC.expand_files_into_sources() - sage: sorted(DC.sources[0].options.optional) # abs tol 1 -- ['guava', 'magma', 'py2'] -+ ['guava', 'magma'] - - We check that files are skipped appropriately:: - -- -2.18.1 +2.28.0 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 3f844e1b1ef..98175920238 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,17 +1,17 @@ diff --git a/src/sage/env.py b/src/sage/env.py -index 061b94f3f1..67cd091540 100644 +index 1ddfc7cfb9..45033d6328 100644 --- a/src/sage/env.py +++ b/src/sage/env.py -@@ -189,88 +189,13 @@ var('MAXIMA_FAS') +@@ -203,97 +203,13 @@ var('ARB_LIBRARY', 'arb') var('SAGE_BANNER', '') var('SAGE_IMPORTALL', 'yes') - -def _get_shared_lib_filename(libname, *additional_libnames): - """ -- Return the full path to a shared library file installed in the standard -- location for the system within the ``LIBDIR`` prefix (or -- ``$SAGE_LOCAL/lib`` in the case of manual build of Sage). +- Return the full path to a shared library file installed in +- ``$SAGE_LOCAL/lib`` or the directories associated with the +- Python sysconfig. - - This can also be passed more than one library name (e.g. for cases where - some library may have multiple names depending on the platform) in which @@ -25,7 +25,7 @@ index 061b94f3f1..67cd091540 100644 - For distributions like Debian that use a multiarch layout, we also try the - multiarch lib paths (i.e. ``/usr/lib//``). - -- Returns ``None`` if the file does not exist. +- This returns ``None`` if the file does not exist. - - EXAMPLES:: - @@ -48,11 +48,17 @@ index 061b94f3f1..67cd091540 100644 - - for libname in (libname,) + additional_libnames: - if sys.platform == 'cygwin': -- bindir = sysconfig.get_config_var('BINDIR') +- # Later down we take the last matching DLL found, so search +- # SAGE_LOCAL second so that it takes precedence +- bindirs = [ +- sysconfig.get_config_var('BINDIR'), +- os.path.join(SAGE_LOCAL, 'bin') +- ] - pats = ['cyg{}.dll'.format(libname), 'cyg{}-*.dll'.format(libname)] - filenames = [] -- for pat in pats: -- filenames += glob.glob(os.path.join(bindir, pat)) +- for bindir in bindirs: +- for pat in pats: +- filenames += glob.glob(os.path.join(bindir, pat)) - - # Note: This is not very robust, since if there are multi DLL - # versions for the same library this just selects one more or less @@ -66,10 +72,13 @@ index 061b94f3f1..67cd091540 100644 - else: - ext = 'so' - -- libdirs = [sysconfig.get_config_var('LIBDIR')] +- libdirs = [ +- os.path.join(SAGE_LOCAL, 'lib'), +- sysconfig.get_config_var('LIBDIR') +- ] - multilib = sysconfig.get_config_var('MULTILIB') - if multilib: -- libdirs.insert(0, os.path.join(libdirs[0], multilib)) +- libdirs.insert(1, os.path.join(libdirs[0], multilib)) - - for libdir in libdirs: - basename = 'lib{}.{}'.format(libname, ext) @@ -89,7 +98,7 @@ index 061b94f3f1..67cd091540 100644 # locate libgap shared object -GAP_SO= _get_shared_lib_filename('gap','') -+GAP_SO= '/default' ++GAP_SO = '/default' var('GAP_SO', GAP_SO) # post process diff --git a/pkgs/applications/science/math/sage/patches/docutils-0.15.patch b/pkgs/applications/science/math/sage/patches/docutils-0.15.patch deleted file mode 100644 index 63f5d2e146d..00000000000 --- a/pkgs/applications/science/math/sage/patches/docutils-0.15.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py -index 4849c2bffa..76b7bc8602 100644 ---- a/src/sage/misc/sphinxify.py -+++ b/src/sage/misc/sphinxify.py -@@ -25,6 +25,7 @@ from __future__ import absolute_import, print_function - import os - import re - import shutil -+import warnings - from tempfile import mkdtemp - from sphinx.application import Sphinx - -@@ -120,7 +121,10 @@ smart_quotes = no""") - # buildername, confoverrides, status, warning, freshenv). - sphinx_app = Sphinx(srcdir, confdir, outdir, doctreedir, format, - confoverrides, None, None, True) -- sphinx_app.build(None, [rst_name]) -+ with warnings.catch_warnings(): -+ # Quick and dirty workaround for https://trac.sagemath.org/ticket/28856#comment:19 -+ warnings.simplefilter("ignore") -+ sphinx_app.build(None, [rst_name]) - sys.path = old_sys_path - - # We need to remove "_" from __builtin__ that the gettext module installs diff --git a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch index 11ca7481961..a91ee319b8f 100644 --- a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch +++ b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch @@ -1,24 +1,24 @@ diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py -index bd6b76ab82..ccf1203dec 100644 +index 6e034dcb5a..8ec60ec72b 100644 --- a/src/sage/tests/cmdline.py +++ b/src/sage/tests/cmdline.py -@@ -837,8 +837,6 @@ def test_executable(args, input="", timeout=100.0, **kwds): +@@ -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 +- sage: err # py2 # optional -- sagenb - '' - sage: ret + sage: ret # py2 # optional -- sagenb 0 -@@ -871,8 +869,8 @@ def test_executable(args, input="", timeout=100.0, **kwds): - sage: output = tmp_filename(ext='.sws') - sage: with open(input, 'w') as F: - ....: _ = F.write(s) -- sage: test_executable(["sage", "--rst2sws", input, output]) # py2 -- ('', '', 0) -+ sage: test_executable(["sage", "--rst2sws", input, output])[2] # py2 -+ 0 - sage: import tarfile # py2 - sage: f = tarfile.open(output, 'r') # py2 - sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2 diff --git a/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch deleted file mode 100644 index c5f95b498d5..00000000000 --- a/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/sage/all.py b/src/sage/all.py -index c87c9372e9..862fca4fcc 100644 ---- a/src/sage/all.py -+++ b/src/sage/all.py -@@ -306,6 +306,7 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0)) - # Ignore all deprecations from IPython etc. - warnings.filterwarnings('ignore', category=DeprecationWarning, - module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)') -+warnings.filterwarnings('ignore', category=DeprecationWarning, message=r".*The import 'werkzeug.ImmutableDict' is deprecated") - # Ignore collections.abc warnings, there are a lot of them but they are - # harmless. - warnings.filterwarnings('ignore', category=DeprecationWarning, diff --git a/pkgs/applications/science/math/sage/patches/pari-stackwarn.patch b/pkgs/applications/science/math/sage/patches/pari-stackwarn.patch deleted file mode 100644 index 49cdfd189b9..00000000000 --- a/pkgs/applications/science/math/sage/patches/pari-stackwarn.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff --git a/src/sage/doctest/parsing.py b/src/sage/doctest/parsing.py -index 6bdc9a0..31fc780 100644 ---- a/src/sage/doctest/parsing.py -+++ b/src/sage/doctest/parsing.py -@@ -40,6 +40,7 @@ from .external import available_software - - float_regex = re.compile('\s*([+-]?\s*((\d*\.?\d+)|(\d+\.?))([eE][+-]?\d+)?)') - optional_regex = re.compile(r'(py2|py3|long time|not implemented|not tested|known bug)|([^ a-z]\s*optional\s*[:-]*((\s|\w)*))') -+pari_stack_warning_regex = re.compile(r'\s*\*\*\*.*(Warning: increasing stack size to )\d+\.') - find_sage_prompt = re.compile(r"^(\s*)sage: ", re.M) - find_sage_continuation = re.compile(r"^(\s*)\.\.\.\.:", re.M) - random_marker = re.compile('.*random', re.I) -@@ -935,6 +936,7 @@ class SageOutputChecker(doctest.OutputChecker): - - """ - got = self.human_readable_escape_sequences(got) -+ got = pari_stack_warning_regex.sub('', got) - if isinstance(want, MarkedOutput): - if want.random: - return True diff --git a/pkgs/applications/science/math/sage/patches/python-5755-hotpatch.patch b/pkgs/applications/science/math/sage/patches/python-5755-hotpatch.patch deleted file mode 100644 index 1b64f39fe60..00000000000 --- a/pkgs/applications/science/math/sage/patches/python-5755-hotpatch.patch +++ /dev/null @@ -1,28 +0,0 @@ -diff --git a/src/sage/all.py b/src/sage/all.py -index ca309ef..be3186b 100644 ---- a/src/sage/all.py -+++ b/src/sage/all.py -@@ -298,6 +298,23 @@ warnings.filterwarnings('ignore', module='matplotlib[.]font_manager') - warnings.filterwarnings('default', - '[\s\S]*See http://trac.sagemath.org/[0-9]* for details.') - -+# Hotpatch around https://bugs.python.org/issue5755 which won't be fixed for -+# python 2.7. Idea by https://stackoverflow.com/a/36293331. -+from distutils.command.build_ext import build_ext -+from distutils.sysconfig import customize_compiler -+ -+_build_extensions = build_ext.build_extensions -+ -+def build_extensions_patched(self): -+ customize_compiler(self.compiler) -+ try: -+ self.compiler.compiler_so.remove("-Wstrict-prototypes") -+ except (AttributeError, ValueError): -+ pass -+ _build_extensions(self) -+ -+build_ext.build_extensions = build_extensions_patched -+ - - # Set a new random number seed as the very last thing - # (so that printing initial_seed() and using that seed diff --git a/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch deleted file mode 100644 index 9f502a66951..00000000000 --- a/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sagenb/__init__.py b/sagenb/__init__.py -index 4db0d2cb..2fc5f01e 100644 ---- a/sagenb/__init__.py -+++ b/sagenb/__init__.py -@@ -1,3 +1,8 @@ - # -*- coding: utf-8 -* - # init -+import warnings - from . import storage -+ -+# deprecation in attrs, needs to be fixed in twisted -+warnings.filterwarnings('ignore', category=DeprecationWarning, -+ message=r'The usage of `cmp` is deprecated and will be removed.*') diff --git a/pkgs/applications/science/math/sage/patches/sympow-cache.patch b/pkgs/applications/science/math/sage/patches/sympow-cache.patch index 20020d610f8..d71f3acbc70 100644 --- a/pkgs/applications/science/math/sage/patches/sympow-cache.patch +++ b/pkgs/applications/science/math/sage/patches/sympow-cache.patch @@ -1,5 +1,5 @@ diff --git a/src/sage/lfunctions/sympow.py b/src/sage/lfunctions/sympow.py -index 1640ac4f6a..03578be7b8 100644 +index 92cb01fd73..b123e6accc 100644 --- a/src/sage/lfunctions/sympow.py +++ b/src/sage/lfunctions/sympow.py @@ -50,6 +50,7 @@ from __future__ import print_function, absolute_import @@ -8,14 +8,14 @@ index 1640ac4f6a..03578be7b8 100644 +from sage.env import DOT_SAGE from sage.structure.sage_object import SageObject - from sage.misc.all import pager, verbose - import sage.rings.all -@@ -76,7 +77,7 @@ class Sympow(SageObject): + from sage.misc.all import pager + from sage.misc.verbose import verbose +@@ -78,7 +79,7 @@ class Sympow(SageObject): """ Used to call sympow with given args """ -- cmd = 'sympow %s'%args +- cmd = 'sympow %s' % args + cmd = 'env SYMPOW_CACHEDIR="%s/sympow///" sympow %s' % (DOT_SAGE, args) - v = os.popen(cmd).read().strip() + with os.popen(cmd) as f: + v = f.read().strip() verbose(v, level=2) - return v diff --git a/pkgs/applications/science/math/sage/pybrial.nix b/pkgs/applications/science/math/sage/pybrial.nix deleted file mode 100644 index 5fc8a4aa6f4..00000000000 --- a/pkgs/applications/science/math/sage/pybrial.nix +++ /dev/null @@ -1,25 +0,0 @@ -{ stdenv -, fetchFromGitHub -, buildPythonPackage -, brial -}: -# This has a cyclic dependency with sage. I don't include sage in the -# buildInputs and let python figure it out at runtime. Because of this, -# I don't include the package in the main nipxkgs tree. It wouldn't be useful -# outside of sage anyways (as you could just directly depend on sage and use -# it). -buildPythonPackage rec { - pname = "pyBRiAl"; - version = brial.version; - - # included with BRiAl source - src = brial.src; - - sourceRoot = "source/sage-brial"; - - meta = with stdenv.lib; { - description = "python implementation of BRiAl"; - license = licenses.gpl2; - maintainers = teams.sage.members; - }; -} diff --git a/pkgs/applications/science/math/sage/python-openid.nix b/pkgs/applications/science/math/sage/python-openid.nix deleted file mode 100644 index 1e8a908ac79..00000000000 --- a/pkgs/applications/science/math/sage/python-openid.nix +++ /dev/null @@ -1,40 +0,0 @@ -{ stdenv -, buildPythonPackage -, fetchPypi -, isPy3k -, django -, nose -, twill -, pycrypto -}: - -buildPythonPackage rec { - pname = "python-openid"; - version = "2.2.5"; - - disabled = isPy3k; - - src = fetchPypi { - inherit pname version; - sha256 = "1vvhxlghjan01snfdc4k7ykd80vkyjgizwgg9bncnin8rqz1ricj"; - }; - - propagatedBuildInputs = [ - pycrypto - ]; - - # Cannot access the djopenid example module. - # I don't know how to fix that (adding the examples dir to PYTHONPATH doesn't work) - doCheck = false; - checkInputs = [ nose django twill ]; - checkPhase = '' - nosetests - ''; - - meta = with stdenv.lib; { - description = "OpenID library for Python"; - license = licenses.asl20; - maintainers = teams.sage.members; - homepage = "https://github.com/openid/python-openid/"; - }; -} diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 4791d12450a..b0182e9693f 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -10,44 +10,23 @@ # all get the same sources with the same patches applied. stdenv.mkDerivation rec { - version = "8.9"; + version = "9.2"; pname = "sage-src"; src = fetchFromGitHub { owner = "sagemath"; repo = "sage"; rev = version; - sha256 = "1bwga58x3s8z42w5h51c232f91ndsc1861dlb1glhax3pn0rhn3a"; + sha256 = "103j8d5x6szl9fxaz0dvdi4y47q1af9h9y5hmjh2xayi62qmp5ql"; }; # Patches needed because of particularities of nix or the way this is packaged. # The goal is to upstream all of them and get rid of this list. nixPatches = [ - # https://trac.sagemath.org/ticket/25358 - (fetchpatch { - name = "safe-directory-test-without-patch.patch"; - url = "https://git.sagemath.org/sage.git/patch?id2=8bdc326ba57d1bb9664f63cf165a9e9920cc1afc&id=dc673c17555efca611f68398d5013b66e9825463"; - sha256 = "1hhannz7xzprijakn2w2d0rhd5zv2zikik9p51i87bas3nc658f7"; - }) - - # `is_unitary` test in `matrix_double_dense.pyx` fails with some BLAS implementations - # https://trac.sagemath.org/ticket/29297 should be included in 9.1 - (fetchpatch { - name = "is_unitary-special-case.patch"; - url = "https://git.sagemath.org/sage.git/patch?id=cc3eb9ffa991e328b09028d32aab7e7cc2ddbb6a"; - sha256 = "0jq4w8hnp5c9q99011ldr4n3knvm1rx2g85z0hidv3i9x868p0ay"; - }) - - # Unfortunately inclusion in upstream sage was rejected. Instead the bug was - # fixed in python, but of course not backported to 2.7. So we'll probably - # have to keep this around until 2.7 is deprecated. - # https://trac.sagemath.org/ticket/25316 - # https://github.com/python/cpython/pull/7476 - ./patches/python-5755-hotpatch.patch - # Make sure py2/py3 tests are only run when their expected context (all "sage" # tests) are also run. That is necessary to test dochtml individually. See # https://trac.sagemath.org/ticket/26110 for an upstream discussion. + # TODO: Determine if it is still necessary. ./patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch # Fixes a potential race condition which can lead to transient doctest failures. @@ -60,11 +39,6 @@ stdenv.mkDerivation rec { # Parallelize docubuild using subprocesses, fixing an isolation issue. See # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE ./patches/sphinx-docbuild-subprocesses.patch - - # Fix doctest failures with docutils 0.15: - # https://nix-cache.s3.amazonaws.com/log/dzmzrb2zvardsmpy7idg7djkizmkzdhs-sage-tests-8.9.drv - # https://trac.sagemath.org/ticket/28856#comment:19 - ./patches/docutils-0.15.patch ]; # Since sage unfortunately does not release bugfix releases, packagers must @@ -96,55 +70,13 @@ stdenv.mkDerivation rec { } // builtins.removeAttrs args [ "rev" "base" ]) ); in [ - # New glpk version has new warnings, filter those out until upstream sage has found a solution - # Should be fixed with glpk > 4.65. - # https://trac.sagemath.org/ticket/24824 - ./patches/pari-stackwarn.patch # not actually necessary since the pari upgrade, but necessary for the glpk patch to apply - (fetchpatch { - url = "https://salsa.debian.org/science-team/sagemath/raw/58bbba93a807ca2933ca317501d093a1bb4b84db/debian/patches/dt-version-glpk-4.65-ignore-warnings.patch"; - sha256 = "0b9293v73wb4x13wv5zwyjgclc01zn16msccfzzi6znswklgvddp"; - stripLen = 1; - }) - # 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 # strictly necessary, but keeps us from littering in the user's HOME. ./patches/sympow-cache.patch - # https://trac.sagemath.org/ticket/28472 - (fetchpatch { - name = "eclib-20190909.patch"; - url = "https://git.sagemath.org/sage.git/patch?id=d27dc479a5772d59e4bc85d805b6ffd595284f1d"; - sha256 = "1nf1s9y7n30lhlbdnam7sghgaq9nasmv96415gl5jlcf7a3hlxk3"; - }) - # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests ./patches/ignore-cmp-deprecation.patch - - # Werkzeug has deprecated ImmutableDict, but it is still used in legacy - # sagenb. That's no big issue since sagenb will be removed soon anyways. - ./patches/ignore-werkzeug-immutable-dict-deprecation.patch - - # threejs r109 (#28560) - (fetchpatch { - name = "threejs-r109.patch"; - url = "https://git.sagemath.org/sage.git/patch?id=fcc11d6effa39f375bc5f4ea5831fb7a2f2767da"; - sha256 = "0hnmc8ld3bblks0hcjvjjaydkgwdr1cs3dbl2ys4gfq964pjgqwc"; - }) - - # https://trac.sagemath.org/ticket/28911 - (fetchpatch { - name = "sympy-1.5.patch"; - url = "https://git.sagemath.org/sage.git/patch/?h=c6d0308db15efd611211d26cfcbefbd180fc0831"; - sha256 = "0nwai2jr22h49km4hx3kwafs3mzsc5kwsv7mqwjf6ibwfx2bbgyq"; - }) - - # https://trac.sagemath.org/ticket/29313 (patch from ArchLinux) - (fetchpatch { - name = "pari-2.11.3.patch"; - url = "https://aur.archlinux.org/cgit/aur.git/plain/sagemath-pari-2.11.3.patch?h=sagemath-git&id=02e1d58bd1cd70935d69a4990469d18be6bd2c43"; - sha256 = "0z07444zvijyw96d11q7j81pvg7ysd6ycf1bbbjr6za9y74hv7d2"; - }) ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; diff --git a/pkgs/applications/science/math/sage/sage-with-env.nix b/pkgs/applications/science/math/sage/sage-with-env.nix index 87c1e07f530..88436e1e0f5 100644 --- a/pkgs/applications/science/math/sage/sage-with-env.nix +++ b/pkgs/applications/science/math/sage/sage-with-env.nix @@ -13,7 +13,7 @@ , pari , gmp , gfan -, python2 +, python3 , flintqs , eclib , ntl @@ -54,7 +54,7 @@ let pkg_to_spkg_name = pkg: patch_names: let parts = lib.splitString "-" pkg.name; # remove python2.7- - stripped_parts = if (builtins.head parts) == python2.libPrefix then builtins.tail parts else parts; + stripped_parts = if (builtins.head parts) == python3.libPrefix then builtins.tail parts else parts; version = lib.last stripped_parts; orig_pkgname = lib.init stripped_parts; pkgname = patch_names (lib.concatStringsSep "_" orig_pkgname); @@ -126,6 +126,8 @@ stdenv.mkDerivation rec { cp -r src/bin "$out/bin" cp -r build/bin "$out/build/bin" + ln -s "${python3}/bin/python3" "$out/bin/python3" + cp -f '${sage-env}/sage-env' "$out/bin/sage-env" substituteInPlace "$out/bin/sage-env" \ --subst-var-by sage-local "$out" diff --git a/pkgs/applications/science/math/sage/sage.nix b/pkgs/applications/science/math/sage/sage.nix index a21bffea14c..e2acef7b8eb 100644 --- a/pkgs/applications/science/math/sage/sage.nix +++ b/pkgs/applications/science/math/sage/sage.nix @@ -61,7 +61,6 @@ stdenv.mkDerivation rec { }; meta = with stdenv.lib; { - broken = true; description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"; license = licenses.gpl2; maintainers = teams.sage.members; diff --git a/pkgs/applications/science/math/sage/sagedoc.nix b/pkgs/applications/science/math/sage/sagedoc.nix index bf618fe64f4..619a69b7aac 100644 --- a/pkgs/applications/science/math/sage/sagedoc.nix +++ b/pkgs/applications/science/math/sage/sagedoc.nix @@ -26,7 +26,6 @@ stdenv.mkDerivation rec { psutil future sphinx - sagenb scipy sympy matplotlib @@ -36,7 +35,6 @@ stdenv.mkDerivation rec { ipywidgets jupyter_client typing - pybrial ]); unpackPhase = '' diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index 830d806a8bc..a60680139f9 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -15,6 +15,7 @@ , ecm , flint , gd +, giac , givaro , glpk , gsl @@ -51,6 +52,8 @@ , libbraiding , gmpy2 , pplpy +, sqlite +, boehmgc # FIXME }: assert (!blas.isILP64) && (!lapack.isILP64); @@ -94,6 +97,7 @@ buildPythonPackage rec { ecm fflas-ffpack flint + giac givaro glpk gsl @@ -124,6 +128,8 @@ buildPythonPackage rec { libbraiding gmpy2 pplpy + sqlite + boehmgc # FIXME ]; buildPhase = '' diff --git a/pkgs/applications/science/math/sage/sagenb.nix b/pkgs/applications/science/math/sage/sagenb.nix deleted file mode 100644 index ad5c53b6c11..00000000000 --- a/pkgs/applications/science/math/sage/sagenb.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ stdenv -, python -, buildPythonPackage -, fetchFromGitHub -, mathjax -, twisted -, flask -, flask-oldsessions -, flask-openid -, flask-autoindex -, flask-babel -}: - -# Has a cyclic dependency with sage (not expressed here) and is not useful outside of sage. -# Deprecated, hopefully soon to be removed. See -# https://trac.sagemath.org/ticket/25837 - -buildPythonPackage rec { - pname = "sagenb"; - version = "1.1.2"; - - src = fetchFromGitHub { - owner = "sagemath"; - repo = "sagenb"; - rev = version; - sha256 = "0bxvhr03qh2nsjdfc4pyfiqrn9jhp3vf7irsc9gqx0185jlblbxs"; - }; - - patches = [ - # cmp deprecation in attrs needs to be handled in twisted - ./patches/sagenb-cmp-deprecation.patch - ]; - - propagatedBuildInputs = [ - twisted - flask - flask-oldsessions - flask-openid - flask-autoindex - flask-babel - ]; - - # tests depend on sage - doCheck = false; - - meta = with stdenv.lib; { - description = "Sage Notebook"; - license = licenses.gpl3Plus; - maintainers = teams.sage.members; - }; - - # let sagenb use mathjax - postInstall = '' - mkdir -p "$out/${python.sitePackages}/sagenb/data" - ln -s ${mathjax}/lib/node_modules/mathjax "$out/${python.sitePackages}/sagenb/data/mathjax" - ''; -} From 5df948d4cc6c01e30bb8109b85672976a9f14d84 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:02:20 -0300 Subject: [PATCH 05/22] giac: 1.5.0-21 -> 1.5.0-87 --- pkgs/applications/science/math/giac/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/math/giac/default.nix b/pkgs/applications/science/math/giac/default.nix index ea9c921f19e..b090274919b 100644 --- a/pkgs/applications/science/math/giac/default.nix +++ b/pkgs/applications/science/math/giac/default.nix @@ -9,11 +9,11 @@ assert (!blas.isILP64) && (!lapack.isILP64); stdenv.mkDerivation rec { pname = "giac${lib.optionalString enableGUI "-with-xcas"}"; - version = "1.5.0-21"; # TODO try to remove preCheck phase on upgrade + version = "1.5.0-87"; # TODO try to remove preCheck phase on upgrade src = fetchurl { url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz"; - sha256 = "1b9khiv0mk2xzw1rblm2jy6qsf8y6f9k7qy15sxpb21d72hzzbl2"; + sha256 = "1d0h1yb7qvh9x7wwv9yrzmcp712f49w1iljkxp4y6g9pzsmg1mmv"; }; patches = stdenv.lib.optionals (!enableGUI) [ From e1998b1c5cf8e43cb7f4bcbf6b64a326fb0831c8 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:02:34 -0300 Subject: [PATCH 06/22] gmpy2: 2.1a4 -> 2.1.0b5 --- pkgs/development/python-modules/gmpy2/default.nix | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/gmpy2/default.nix b/pkgs/development/python-modules/gmpy2/default.nix index 1f7975abe5c..cfc481a90af 100644 --- a/pkgs/development/python-modules/gmpy2/default.nix +++ b/pkgs/development/python-modules/gmpy2/default.nix @@ -10,7 +10,7 @@ let pname = "gmpy2"; - version = "2.1a4"; + version = "2.1.0b5"; in buildPythonPackage { @@ -22,20 +22,9 @@ buildPythonPackage { owner = "aleaxit"; repo = "gmpy"; rev = "gmpy2-${version}"; - sha256 = "1wg4w4q2l7n26ksrdh4rwqmifgfm32n7x29cgdvmmbv5lmilb5hz"; + sha256 = "1mqzyp7qwqqyk6jbicgx22svdy2106xwhmhfvdf0vpnmwswcxclb"; }; - patches = [ - # Backport of two bugfixes (including a segfault): - # https://github.com/aleaxit/gmpy/pull/217 - # https://github.com/aleaxit/gmpy/pull/218 - (fetchpatch { - name = "bugfixes.patch"; - url = "https://git.sagemath.org/sage.git/plain/build/pkgs/gmpy2/patches/PR217_PR218_conversion_methods.patch?id=b7fbb9a4dac5d6882f6b83a57447dd79ecafb84c"; - sha256 = "1x3gwvqac36k4ypclxq37fcvi6p790k4xdpm2bj2b3xsvjb80ycz"; - }) - ]; - buildInputs = [ gmp mpfr libmpc ]; meta = with stdenv.lib; { From c46dcf470ef5998d5b5ccf0815a3f2e1474a9cc0 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:07:33 -0300 Subject: [PATCH 07/22] ecl: patches to fix SIGFPEs and for unicode compatibility with maxima --- pkgs/development/compilers/ecl/default.nix | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix index 0b37dcf64fc..40f3e38e506 100644 --- a/pkgs/development/compilers/ecl/default.nix +++ b/pkgs/development/compilers/ecl/default.nix @@ -36,6 +36,38 @@ stdenv.mkDerivation { }; patches = [ + # https://trac.sagemath.org/ticket/22191#comment:237 + (fetchurl { + name = "ECL_WITH_LISP_FPE.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/ECL_WITH_LISP_FPE.patch?h=9.2"; + sha256 = "0b194613avcmzr1k9gq725z41wdkg5rsa0q21kdw050iqpprcj1c"; + }) + + # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1 + (fetchurl { + name = "write_error.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/write_error.patch?h=9.2"; + sha256 = "1lvdvh77blnxp0zbd27dsbq1ljkb5qblabf1illszn4j7qgq88fh"; + }) + + # Three patches to fix ecl's unicode handling (https://trac.sagemath.org/ticket/30122) + (fetchurl { + name = "0001-unicode-fix-ecl_string_case-for-non-ascii-characters.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/0001-unicode-fix-ecl_string_case-for-non-ascii-characters.patch?h=9.2"; + sha256 = "0z8pnhawivrrbg4vz144nr2sz64jxp7764hn6df13bgkz84iqbmk"; + }) + + (fetchurl { + name = "0002-cosmetic-fix-some-compiler-warnings.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/0002-cosmetic-fix-some-compiler-warnings.patch?h=9.2"; + sha256 = "0msx3say9igwr9z5ywnr3gs6vsndnzlx47fmzwzh4l0m274cnia8"; + }) + + (fetchurl { + name = "0003-printer-fix-printing-of-symbols-with-non-ascii-names.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ecl/patches/0003-printer-fix-printing-of-symbols-with-non-ascii-names.patch?h=9.2"; + sha256 = "0ln5dsx6p265fkph3bl5wblgfi3f7frb4jl6v473wz3ibvcx1x9a"; + }) ]; configureFlags = [ From cf6364bed2dd1692b32307fcb7d438298bbeb973 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:08:37 -0300 Subject: [PATCH 08/22] pynac: import patch to avoid deprecation warnings on python3.8 --- pkgs/applications/science/math/pynac/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkgs/applications/science/math/pynac/default.nix b/pkgs/applications/science/math/pynac/default.nix index 87fb205174b..e3474d865e2 100644 --- a/pkgs/applications/science/math/pynac/default.nix +++ b/pkgs/applications/science/math/pynac/default.nix @@ -1,5 +1,6 @@ { stdenv , fetchFromGitHub +, fetchurl , autoreconfHook , pkgconfig , flint @@ -33,6 +34,14 @@ stdenv.mkDerivation rec { pkgconfig ]; + patches = [ + (fetchurl { + name = "py_ssize_t_clean.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/py_ssize_t_clean.patch?h=9.2"; + sha256 = "0l3gbg9hc4v671zf4w376krnk3wh8hj3649610nlvzzxckcryzab"; + }) + ]; + meta = with stdenv.lib; { description = "Python is Not a CAS -- modified version of Ginac"; longDescription = '' From fecce097737f5150d20f0048c058d9b8c994d388 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:08:03 -0300 Subject: [PATCH 09/22] maxima-ecl: unpin ecl version --- pkgs/top-level/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8fc72554c4f..b07cd16ec8f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27286,7 +27286,7 @@ in ecl = null; }; maxima-ecl = maxima.override { - ecl = ecl_16_1_2; + inherit ecl; ecl-fasl = true; sbcl = null; }; From 4058e457361be3008b0bc19d429eb08b36059f0b Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 2 Dec 2020 16:14:55 -0300 Subject: [PATCH 10/22] nauty: update tarball sha256 The old `nauty` tarball is currently accessible at https://distfiles.macports.org/nauty/nauty27r1.tar.gz. The diff is a single line in genbg.c: - SUMMARY(&nout,t2-t1); + SUMMARY(nout,t2-t1); --- pkgs/applications/science/math/nauty/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/nauty/default.nix b/pkgs/applications/science/math/nauty/default.nix index 76e7c796a13..94b7ad266c4 100644 --- a/pkgs/applications/science/math/nauty/default.nix +++ b/pkgs/applications/science/math/nauty/default.nix @@ -7,7 +7,7 @@ stdenv.mkDerivation rec { version = "27r1"; src = fetchurl { url = "http://pallini.di.uniroma1.it/nauty${version}.tar.gz"; - sha256 = "1nym0p2djws8ylkpr0kgpxfa6fxdlh46cmvz0gn5vd02jzgs0aww"; + sha256 = "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn"; }; outputs = [ "out" "dev" ]; configureFlags = [ From 8b8cae779fcc9160220b84daefe85ef12d254d33 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 2 Dec 2020 16:39:28 -0300 Subject: [PATCH 11/22] pari: update tarball location, since it moved --- pkgs/applications/science/math/pari/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix index a3e2f99ab27..7ec42d11ab1 100644 --- a/pkgs/applications/science/math/pari/default.nix +++ b/pkgs/applications/science/math/pari/default.nix @@ -15,7 +15,8 @@ stdenv.mkDerivation rec { version = "2.11.4"; src = fetchurl { - url = "https://pari.math.u-bordeaux.fr/pub/pari/unix/${pname}-${version}.tar.gz"; + # Versions with current majorMinor values are at http://pari.math.u-bordeaux.fr/pub/pari/unix/${pname}-${version}.tar.gz + url = "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.gz"; sha256 = "sha256-v8iPxPc1L0hA5uNSxy8DacvqikVAOxg0piafNwmXCxw="; }; From 88cfc7f87be468afaa5403e5a8a2a3f4eeed81b2 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 2 Dec 2020 16:44:10 -0300 Subject: [PATCH 12/22] ppl: fetch clang patch from alternate location (that doesn't require auth) --- pkgs/development/libraries/ppl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/ppl/default.nix b/pkgs/development/libraries/ppl/default.nix index a51db09db86..f1c93e0fa7c 100644 --- a/pkgs/development/libraries/ppl/default.nix +++ b/pkgs/development/libraries/ppl/default.nix @@ -12,8 +12,8 @@ stdenv.mkDerivation { }; patches = [(fetchpatch { - name = "ppl.patch"; - url = "http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=patch;h=c39f6a07b51f89e365b05ba4147aa2aa448febd7"; + name = "clang5-support.patch"; + url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ppl/patches/clang5-support.patch?h=9.2"; sha256 = "1zj90hm25pkgvk4jlkfzh18ak9b98217gbidl3731fdccbw6hr87"; })]; From 795baaa89ead82852c2477f8f458b908fa448234 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 14 Dec 2020 19:26:12 -0300 Subject: [PATCH 13/22] cypari2: revert 2.1.1 -> 2.1.2 update, sync with pip-install-hook.sh pip install deprecated the --build flag. The standard python installPhase (in pip-install-hook.sh) got updated in commit 76966f8dddf9b0b5bb2d21128c5fd3e4cf3d6256, but we use a custom one so we need to update it separately. --- pkgs/development/python-modules/cypari2/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/cypari2/default.nix b/pkgs/development/python-modules/cypari2/default.nix index 4b0d4691809..ee2c9ded18d 100644 --- a/pkgs/development/python-modules/cypari2/default.nix +++ b/pkgs/development/python-modules/cypari2/default.nix @@ -11,11 +11,11 @@ buildPythonPackage rec { pname = "cypari2"; # upgrade may break sage, please test the sage build or ping @timokau on upgrade - version = "2.1.2"; + version = "2.1.1"; src = fetchPypi { inherit pname version; - sha256 = "03cd45edab8716ebbfdb754e65fea72e873c73dc91aec098fe4a01e35324ac7a"; + sha256 = "df1ef62e771ec36e5a456f5fc8b51bc6745b70f0efdd0c7a30c3f0b5f1fb93db"; }; # This differs slightly from the default python installPhase in that it pip-installs @@ -26,7 +26,7 @@ buildPythonPackage rec { export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" # install "." instead of "*.whl" - ${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install --no-index --prefix=$out --no-cache --build=tmpdir . + ${python.pythonForBuild.pkgs.bootstrapped-pip}/bin/pip install . --no-index --no-warn-script-location --prefix="$out" --no-cache ''; nativeBuildInputs = [ From 8100c5a44b20a37c994c6923330f99674ffb9308 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Mon, 30 Nov 2020 10:09:26 -0300 Subject: [PATCH 14/22] sage: 8.9 -> 9.2 fixups --- .../science/math/maxima/default.nix | 4 ++ .../science/math/sage/default.nix | 36 +++++++--- .../science/math/sage/env-locations.nix | 2 +- .../math/sage/patches/pillow-update.patch | 39 +++++++++++ .../register-pretty-printer-earlier.patch | 36 ++++++++++ .../patches/sagespawn-implicit-casting.patch | 13 ++++ .../sphinx-docbuild-subprocesses.patch | 2 +- .../science/math/sage/sage-env.nix | 25 ++++--- .../science/math/sage/sage-src.nix | 66 +++++++++++++++++-- .../science/math/sage/sage-with-env.nix | 6 +- .../science/math/sage/sagedoc.nix | 22 +++++-- .../science/math/sage/sagelib.nix | 2 - 12 files changed, 217 insertions(+), 36 deletions(-) create mode 100644 pkgs/applications/science/math/sage/patches/pillow-update.patch create mode 100644 pkgs/applications/science/math/sage/patches/register-pretty-printer-earlier.patch create mode 100644 pkgs/applications/science/math/sage/patches/sagespawn-implicit-casting.patch diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix index 1bf7d16f290..cdc81a87646 100644 --- a/pkgs/applications/science/math/maxima/default.nix +++ b/pkgs/applications/science/math/maxima/default.nix @@ -87,6 +87,10 @@ stdenv.mkDerivation ({ enableParallelBuilding = true; + passthru = { + ecl = ecl; + }; + meta = { description = "Computer algebra system"; homepage = "http://maxima.sourceforge.net"; diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix index 2a95e9a5985..416f2b957b7 100644 --- a/pkgs/applications/science/math/sage/default.nix +++ b/pkgs/applications/science/math/sage/default.nix @@ -9,12 +9,13 @@ let inherit (pkgs) symlinkJoin callPackage nodePackages; - python = pkgs.python3.override { + python3 = pkgs.python3.override { packageOverrides = self: super: { # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies sagelib = self.callPackage ./sagelib.nix { inherit flint arb; inherit sage-src env-locations pynac singular; + ecl = maxima-ecl.ecl; linbox = pkgs.linbox.override { withSage = true; }; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig }; @@ -42,7 +43,8 @@ let env-locations = callPackage ./env-locations.nix { inherit pari_data; inherit singular maxima-ecl; - cysignals = python.pkgs.cysignals; + ecl = maxima-ecl.ecl; + cysignals = python3.pkgs.cysignals; three = nodePackages.three; mathjax = nodePackages.mathjax; }; @@ -50,21 +52,22 @@ let # The shell file that gets sourced on every sage start. Will also source # the env-locations file. sage-env = callPackage ./sage-env.nix { - sagelib = python.pkgs.sagelib; + sagelib = python3.pkgs.sagelib; inherit env-locations; - inherit python singular palp flint pynac pythonEnv maxima-ecl; + inherit python3 singular palp flint pynac pythonEnv maxima-ecl; + ecl = maxima-ecl.ecl; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig }; # The documentation for sage, building it takes a lot of ram. sagedoc = callPackage ./sagedoc.nix { inherit sage-with-env; - inherit python maxima-ecl; + inherit python3 maxima-ecl; }; # sagelib with added wrappers and a dependency on sage-tests to make sure thet tests were run. sage-with-env = callPackage ./sage-with-env.nix { - inherit pythonEnv; + inherit python3 pythonEnv; inherit sage-env; inherit pynac singular maxima-ecl; pkg-config = pkgs.pkgconfig; # not to confuse with pythonPackages.pkgconfig @@ -81,7 +84,7 @@ let sage-src = callPackage ./sage-src.nix {}; - pythonRuntimeDeps = with python.pkgs; [ + pythonRuntimeDeps = with python3.pkgs; [ sagelib cvxopt networkx @@ -95,11 +98,10 @@ let ipywidgets rpy2 sphinx - typing pillow ]; - pythonEnv = python.buildEnv.override { + pythonEnv = python3.buildEnv.override { extraLibs = pythonRuntimeDeps; ignoreCollisions = true; } // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible @@ -108,7 +110,21 @@ let singular = pkgs.singular.override { inherit flint; }; - maxima-ecl = pkgs.maxima-ecl; + maxima-ecl = pkgs.maxima-ecl.override { + ecl = pkgs.ecl.override { + # "echo syntax error | ecl > /dev/full 2>&1" segfaults in + # ECL. We apply a patch to fix it (write_error.patch), but it + # only works if threads are disabled. sage 9.2 tests this + # (src/sage/interfaces/tests.py) and ships ecl like so. + # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1#note_1657275 + threadSupport = false; + + # if we don't use the system boehmgc, sending a SIGINT to ecl + # can segfault if we it happens during memory allocation. + # src/sage/libs/ecl.pyx would intermittently fail in this case. + useBoehmgc = true; + }; + }; # *not* to confuse with the python package "pynac" pynac = pkgs.pynac.override { inherit singular flint; }; diff --git a/pkgs/applications/science/math/sage/env-locations.nix b/pkgs/applications/science/math/sage/env-locations.nix index bda2d23b9e5..b1ad0aad9c7 100644 --- a/pkgs/applications/science/math/sage/env-locations.nix +++ b/pkgs/applications/science/math/sage/env-locations.nix @@ -44,6 +44,6 @@ writeTextFile rec { export JSMOL_DIR="${jmol}/share/jsmol" export MATHJAX_DIR="${mathjax}/lib/node_modules/mathjax" export THREEJS_DIR="${three}/lib/node_modules/three" - export SAGE_INCLUDE_DIRECTORIES="${cysignals}/lib/python2.7/site-packages" + export SAGE_INCLUDE_DIRECTORIES="${cysignals}/${cysignals.pythonModule.sitePackages}" ''; } diff --git a/pkgs/applications/science/math/sage/patches/pillow-update.patch b/pkgs/applications/science/math/sage/patches/pillow-update.patch new file mode 100644 index 00000000000..19d61552262 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/pillow-update.patch @@ -0,0 +1,39 @@ +diff --git a/src/sage/repl/image.py b/src/sage/repl/image.py +index d7d00b0..cd1607a 100644 +--- a/src/sage/repl/image.py ++++ b/src/sage/repl/image.py +@@ -77,7 +77,7 @@ class Image(SageObject): + + - ``size`` -- 2-tuple, containing (width, height) in pixels. + +- - ``color`` -- string or tuple of numeric. What colour to use ++ - ``color`` -- string, numeric or tuple of numeric. What colour to use + for the image. Default is black. If given, this should be a + a tuple with one value per band. When creating RGB images, + you can also use colour strings as supported by the +@@ -91,9 +91,15 @@ class Image(SageObject): + EXAMPLES:: + + sage: from sage.repl.image import Image +- sage: Image('P', (16, 16), (13,)) ++ sage: Image('P', (16, 16), 13) + 16x16px 8-bit Color image + """ ++ # pillow does not support Sage integers as color ++ from sage.rings.integer import Integer ++ if isinstance(color, Integer): ++ color = int(color) ++ elif isinstance(color, tuple): ++ color = tuple(int(i) if isinstance(i, Integer) else i for i in color) + self._pil = PIL.Image.new(mode, size, color) + + @property +@@ -233,7 +239,7 @@ class Image(SageObject): + EXAMPLES:: + + sage: from sage.repl.image import Image +- sage: img = Image('P', (12, 34), (13,)) ++ sage: img = Image('P', (12, 34), 13) + sage: filename = tmp_filename(ext='.png') + sage: img.save(filename) + sage: with open(filename, 'rb') as f: diff --git a/pkgs/applications/science/math/sage/patches/register-pretty-printer-earlier.patch b/pkgs/applications/science/math/sage/patches/register-pretty-printer-earlier.patch new file mode 100644 index 00000000000..83bd83a6d33 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/register-pretty-printer-earlier.patch @@ -0,0 +1,36 @@ +diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py +index cb3667659e..867f547d71 100644 +--- a/src/sage/doctest/forker.py ++++ b/src/sage/doctest/forker.py +@@ -200,6 +200,15 @@ def init_sage(controller=None): + from sage.cpython._py2_random import Random + sage.misc.randstate.DEFAULT_PYTHON_RANDOM = Random + ++ # IPython's pretty printer sorts the repr of dicts by their keys by default ++ # (or their keys' str() if they are not otherwise orderable). However, it ++ # disables this for CPython 3.6+ opting to instead display dicts' "natural" ++ # insertion order, which is preserved in those versions). ++ # However, this order is random in some instances. ++ # Also modifications of code may affect the order. ++ # So here we fore sorted dict printing. ++ IPython.lib.pretty.for_type(dict, _sorted_dict_pprinter_factory('{', '}')) ++ + if controller is None: + import sage.repl.ipython_kernel.all_jupyter + else: +@@ -222,15 +231,6 @@ def init_sage(controller=None): + from sage.repl.rich_output.backend_doctest import BackendDoctest + dm.switch_backend(BackendDoctest()) + +- # IPython's pretty printer sorts the repr of dicts by their keys by default +- # (or their keys' str() if they are not otherwise orderable). However, it +- # disables this for CPython 3.6+ opting to instead display dicts' "natural" +- # insertion order, which is preserved in those versions). +- # However, this order is random in some instances. +- # Also modifications of code may affect the order. +- # So here we fore sorted dict printing. +- IPython.lib.pretty.for_type(dict, _sorted_dict_pprinter_factory('{', '}')) +- + # Switch on extra debugging + from sage.structure.debug_options import debug + debug.refine_category_hash_check = True diff --git a/pkgs/applications/science/math/sage/patches/sagespawn-implicit-casting.patch b/pkgs/applications/science/math/sage/patches/sagespawn-implicit-casting.patch new file mode 100644 index 00000000000..2ee5db3e29c --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/sagespawn-implicit-casting.patch @@ -0,0 +1,13 @@ +diff --git a/src/sage/interfaces/sagespawn.pyx b/src/sage/interfaces/sagespawn.pyx +index 9041238f1d..469befbc66 100644 +--- a/src/sage/interfaces/sagespawn.pyx ++++ b/src/sage/interfaces/sagespawn.pyx +@@ -228,7 +228,7 @@ class SagePtyProcess(PtyProcess): + Check that the process eventually dies after calling + ``terminate_async``:: + +- sage: s.ptyproc.terminate_async(interval=0.2) ++ sage: s.ptyproc.terminate_async(interval=float(0.2)) + sage: while True: + ....: try: + ....: os.kill(s.pid, 0) diff --git a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch index 56f09279622..661077cfa8c 100644 --- a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch +++ b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch @@ -36,7 +36,7 @@ index 73a078e619..059125c59f 100644 # Run Sphinx with Sage's special logger - sys.argv = ["sphinx-build"] + build_command.split() - from .sphinxbuild import runsphinx -+ args = "python -um sage_setup.docbuild.sphinxbuild -N".split() + build_command.split() ++ args = "python3 -um sage_setup.docbuild.sphinxbuild -N".split() + build_command.split() try: - runsphinx() + subprocess.check_call(args) diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix index ba7f6ccd18b..568a4a39f39 100644 --- a/pkgs/applications/science/math/sage/sage-env.nix +++ b/pkgs/applications/science/math/sage/sage-env.nix @@ -1,7 +1,6 @@ { stdenv , lib , writeTextFile -, python , sagelib , env-locations , gfortran @@ -67,11 +66,6 @@ let "@sage-local@" "@sage-local@/build" pythonEnv - # empty python env to add python wrapper that clears PYTHONHOME (see - # wrapper.nix). This is necessary because sage will call the python3 binary - # (from python2 code). The python2 PYTHONHOME (again set in wrapper.nix) - # will then confuse python3, if it is not overwritten. - python3.buildEnv gfortran # for inline fortran stdenv.cc # for cython bash @@ -129,8 +123,21 @@ writeTextFile rec { ] }' export SAGE_ROOT='${sagelib.src}' - export SAGE_LOCAL='@sage-local@' + '' + + # TODO: is using pythonEnv instead of @sage-local@ here a good + # idea? there is a test in src/sage/env.py that checks if the values + # SAGE_ROOT and SAGE_LOCAL set here match the ones set in env.py. + # we fix up env.py's SAGE_ROOT in sage-src.nix (which does not + # have access to sage-with-env), but env.py autodetects + # SAGE_LOCAL to be pythonEnv. + # setting SAGE_LOCAL to pythonEnv also avoids having to create + # python3, ipython, ipython3 and jupyter symlinks in + # sage-with-env.nix. + '' + export SAGE_LOCAL='${pythonEnv}' + export SAGE_SHARE='${sagelib}/share' + export SAGE_ENV_CONFIG_SOURCED=1 # sage-env complains if sage-env-config is not sourced beforehand orig_path="$PATH" export PATH='${runtimepath}' @@ -177,9 +184,9 @@ writeTextFile rec { ]) }' - export SAGE_LIB='${sagelib}/${python.sitePackages}' + export SAGE_LIB='${sagelib}/${python3.sitePackages}' - export SAGE_EXTCODE='${sagelib.src}/src/ext' + export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data' # for find_library export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH" diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index b0182e9693f..8948621a025 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -39,6 +39,18 @@ stdenv.mkDerivation rec { # Parallelize docubuild using subprocesses, fixing an isolation issue. See # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE ./patches/sphinx-docbuild-subprocesses.patch + + # Sage's workaround to pretty print dicts (in + # src/sage/doctest/forker.py:init_sage) runs too late (after + # controller.load_environment(), which imports sage.all.*) to to + # affect sage.sandpiles.Sandpile{Config,Divisor}'s pretty printer. + # Due to the sandpiles module being lazily loaded, this only + # affects the first run (subsequent runs read from an import cache + # at ~/.sage/cache and are not affected), which is probably why + # other distributions don't hit this bug. This breaks two sandpile + # tests, so do the workaround a little bit earlier. + # https://trac.sagemath.org/ticket/31053 + ./patches/register-pretty-printer-earlier.patch ]; # Since sage unfortunately does not release bugfix releases, packagers must @@ -48,6 +60,17 @@ stdenv.mkDerivation rec { # To help debug the transient error in # https://trac.sagemath.org/ticket/23087 when it next occurs. ./patches/configurationpy-error-verbose.patch + + # fix intermittent errors in Sage 9.2's psage.py (this patch is + # already included in Sage 9.3): https://trac.sagemath.org/ticket/30730 + (fetchpatch { + name = "fix-psage-is-locked.patch"; + url = "https://git.sagemath.org/sage.git/patch/?id=75df605f216ddc7b6ca719be942d666b241520e9"; + sha256 = "0g9pl1wbb3sgs26d3bvv70cpa77sfskylv4kd255y1794f1fgk4q"; + }) + + # fix intermittent errors in sagespawn.pyx: https://trac.sagemath.org/ticket/31052 + ./patches/sagespawn-implicit-casting.patch ]; # Patches needed because of package updates. We could just pin the versions of @@ -77,6 +100,9 @@ stdenv.mkDerivation rec { # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests ./patches/ignore-cmp-deprecation.patch + + # adapt sage's Image class to pillow 8.0.1 (https://trac.sagemath.org/ticket/30971) + ./patches/pillow-update.patch ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; @@ -84,16 +110,16 @@ stdenv.mkDerivation rec { postPatch = '' # make sure shebangs etc are fixed, but sage-python23 still works find . -type f -exec sed \ - -e 's/sage-python23/python/g' \ + -e 's/sage-python23/python3/g' \ -i {} \; echo '#!${runtimeShell} - python "$@"' > build/bin/sage-python23 + python3 "$@"' > build/bin/sage-python23 # Make sure sage can at least be imported without setting any environment # variables. It won't be close to feature complete though. sed -i \ - "s|var('SAGE_LOCAL',.*|var('SAGE_LOCAL', '$out/src')|" \ + "s|var('SAGE_ROOT'.*|var('SAGE_ROOT', '$out')|" \ src/sage/env.py # Do not use sage-env-config (generated by ./configure). @@ -101,7 +127,39 @@ stdenv.mkDerivation rec { echo '# do nothing' > src/bin/sage-env-config ''; - configurePhase = "# do nothing"; + # Test src/doc/en/reference/spkg/conf.py will fail if + # src/doc/en/reference/spkg/index.rst is not generated. It is + # generated by src/doc/bootstrap, so I've copied the relevant part + # here. An alternative would be to create an empty + # src/doc/en/reference/spkg/index.rst file. + configurePhase = '' + OUTPUT_DIR="src/doc/en/reference/spkg" + mkdir -p "$OUTPUT_DIR" + OUTPUT_INDEX="$OUTPUT_DIR"/index.rst + cat > "$OUTPUT_INDEX" <> "$OUTPUT_INDEX" " $PKG_BASE" + fi + fi + done + cat >> "$OUTPUT_INDEX" < some_pkg-1.0 + # python3.8-some-pkg-1.0 -> some_pkg-1.0 pkg_to_spkg_name = pkg: patch_names: let parts = lib.splitString "-" pkg.name; - # remove python2.7- + # remove python3.8- stripped_parts = if (builtins.head parts) == python3.libPrefix then builtins.tail parts else parts; version = lib.last stripped_parts; orig_pkgname = lib.init stripped_parts; @@ -126,8 +126,6 @@ stdenv.mkDerivation rec { cp -r src/bin "$out/bin" cp -r build/bin "$out/build/bin" - ln -s "${python3}/bin/python3" "$out/bin/python3" - cp -f '${sage-env}/sage-env' "$out/bin/sage-env" substituteInPlace "$out/bin/sage-env" \ --subst-var-by sage-local "$out" diff --git a/pkgs/applications/science/math/sage/sagedoc.nix b/pkgs/applications/science/math/sage/sagedoc.nix index 619a69b7aac..a10672f3a09 100644 --- a/pkgs/applications/science/math/sage/sagedoc.nix +++ b/pkgs/applications/science/math/sage/sagedoc.nix @@ -1,6 +1,6 @@ { stdenv , sage-with-env -, python +, python3 , maxima-ecl , tachyon , jmol @@ -17,12 +17,12 @@ stdenv.mkDerivation rec { # modules are imported and because matplotlib is used to produce plots. buildInputs = [ sage-with-env.env.lib - python + python3 maxima-ecl tachyon jmol cddlib - ] ++ (with python.pkgs; [ + ] ++ (with python3.pkgs; [ psutil future sphinx @@ -34,7 +34,6 @@ stdenv.mkDerivation rec { ipykernel ipywidgets jupyter_client - typing ]); unpackPhase = '' @@ -45,13 +44,26 @@ stdenv.mkDerivation rec { chmod -R 755 "$SAGE_DOC_SRC_OVERRIDE" ''; + postPatch = '' + # src/doc/bootstrap generates installation instructions for + # arch, debian, fedora, cygwin and homebrew. as a hack, disable + # including the generated files. + sed -i "/literalinclude/d" $SAGE_DOC_SRC_OVERRIDE/en/installation/source.rst + ''; + buildPhase = '' export SAGE_NUM_THREADS="$NIX_BUILD_CORES" export HOME="$TMPDIR/sage_home" mkdir -p "$HOME" # needed to link them in the sage docs using intersphinx - export PPLPY_DOCS=${python.pkgs.pplpy.doc}/share/doc/pplpy + export PPLPY_DOCS=${python3.pkgs.pplpy.doc}/share/doc/pplpy + + # adapted from src/doc/bootstrap + OUTPUT_DIR="$SAGE_DOC_SRC_OVERRIDE/en/reference/repl" + mkdir -p "$OUTPUT_DIR" + OUTPUT="$OUTPUT_DIR/options.txt" + ${sage-with-env}/bin/sage -advanced > "$OUTPUT" ${sage-with-env}/bin/sage -python -m sage_setup.docbuild \ --mathjax \ diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index a60680139f9..1c2235bf71b 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -53,7 +53,6 @@ , gmpy2 , pplpy , sqlite -, boehmgc # FIXME }: assert (!blas.isILP64) && (!lapack.isILP64); @@ -129,7 +128,6 @@ buildPythonPackage rec { gmpy2 pplpy sqlite - boehmgc # FIXME ]; buildPhase = '' From 5907bcadfadba6a57844eb0952486c535b3a2d82 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 13 Dec 2020 06:53:17 +0100 Subject: [PATCH 15/22] tree-sitter: exports.json was fixed in releases, remove sed These symbols do not exist anymore in the new tree-sitter releases, so we can remove the sed. --- pkgs/development/tools/parsing/tree-sitter/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index e3435061563..027d10c0572 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -60,10 +60,6 @@ in rustPlatform.buildRustPackage { # needed for the tests rm -rf test/fixtures/grammars ln -s ${grammars} test/fixtures/grammars - - # These functions do not appear in the source code - sed -i /_ts_query_context/d lib/binding_web/exports.json - sed -i /___assert_fail/d lib/binding_web/exports.json ''; # Compile web assembly with emscripten. The --debug flag prevents us from From cf817454041353a235f02d34245e0873a072f31a Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Sun, 13 Dec 2020 06:54:25 +0100 Subject: [PATCH 16/22] tree-sitter: split arguments in library.nix & document --- pkgs/development/tools/parsing/tree-sitter/default.nix | 6 ++++-- pkgs/development/tools/parsing/tree-sitter/library.nix | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index 027d10c0572..37811943a6d 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -41,8 +41,10 @@ let builtGrammars = let change = name: grammar: - callPackage ./library.nix { - language = name; inherit version; source = fetchGrammar grammar; + callPackage ./library.nix {} { + language = name; + inherit version; + source = fetchGrammar grammar; }; in # typescript doesn't have parser.c in the same place as others diff --git a/pkgs/development/tools/parsing/tree-sitter/library.nix b/pkgs/development/tools/parsing/tree-sitter/library.nix index 36245ff7d44..f78939b22ff 100644 --- a/pkgs/development/tools/parsing/tree-sitter/library.nix +++ b/pkgs/development/tools/parsing/tree-sitter/library.nix @@ -1,7 +1,15 @@ { stdenv -, language , tree-sitter +}: + +# Build a parser grammar and put the resulting shared object in `$out/parser` + +{ + # language name + language + # version of tree-sitter , version + # source for the language grammar , source }: From 15ab96d5a7c61204be79d0588a4816a0f7969306 Mon Sep 17 00:00:00 2001 From: Millian Poquet Date: Wed, 16 Dec 2020 19:22:00 +0100 Subject: [PATCH 17/22] simgrid: 3.25 -> 3.26 --- pkgs/applications/science/misc/simgrid/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/science/misc/simgrid/default.nix b/pkgs/applications/science/misc/simgrid/default.nix index 0ba1cd0d2fa..11d73095834 100644 --- a/pkgs/applications/science/misc/simgrid/default.nix +++ b/pkgs/applications/science/misc/simgrid/default.nix @@ -18,14 +18,14 @@ in stdenv.mkDerivation rec { pname = "simgrid"; - version = "3.25"; + version = "3.26"; src = fetchFromGitLab { domain = "framagit.org"; owner = pname; repo = pname; rev = "v${version}"; - sha256 = "019fgryfwpcrkv1f3271v7qxk0mfw2w990vgnk1cqhmr9i1f17gs"; + sha256 = "0kwiggdjqjhjvmwb1m7hb9clvm3xz948fy5ia67dif2pakwad754"; }; nativeBuildInputs = [ cmake perl python3 boost valgrind ] From a105609c5e100c5d746bde66a27e2214e854a3ae Mon Sep 17 00:00:00 2001 From: "R. RyanTM" Date: Wed, 16 Dec 2020 11:42:33 +0000 Subject: [PATCH 18/22] picard: 2.5.2 -> 2.5.4 --- pkgs/applications/audio/picard/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/audio/picard/default.nix b/pkgs/applications/audio/picard/default.nix index fb6f59d0ded..428a76ea617 100644 --- a/pkgs/applications/audio/picard/default.nix +++ b/pkgs/applications/audio/picard/default.nix @@ -12,13 +12,13 @@ let ; in pythonPackages.buildPythonApplication rec { pname = "picard"; - version = "2.5.2"; + version = "2.5.4"; src = fetchFromGitHub { owner = "metabrainz"; repo = pname; rev = "release-${version}"; - sha256 = "193pk6fhrqar2ra8krj6xdd7sm5qfw0p708iazzwk4b8c8g0q72j"; + sha256 = "11kx4wwl6d2yy0kijcsda0kz2494a7cywp3mzvbga1hcz78f2xv6"; }; nativeBuildInputs = [ gettext qt5.wrapQtAppsHook qt5.qtbase ] From e1e45a40f21276ef3c214e02cc1ad01a987e8d76 Mon Sep 17 00:00:00 2001 From: Mario Rodas Date: Thu, 17 Dec 2020 04:20:00 +0000 Subject: [PATCH 19/22] ocamlPackages.ocaml-lsp: 1.1.0 -> 1.4.0 --- .../ocaml-modules/ocaml-lsp/default.nix | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix index 0db0164589c..0391498c37a 100644 --- a/pkgs/development/ocaml-modules/ocaml-lsp/default.nix +++ b/pkgs/development/ocaml-modules/ocaml-lsp/default.nix @@ -2,6 +2,8 @@ , stdlib-shims , ppx_yojson_conv_lib , ocaml-syntax-shims +, yojson +, result , omd , octavius , dune-build-info @@ -12,10 +14,10 @@ , lib }: let - version = "1.1.0"; + version = "1.4.0"; src = fetchzip { - url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/ocaml-lsp-server-${version}.tbz"; - sha256 = "0al89waw43jl80k9z06kh44byhjhwb5hmzx07sddwi1kr1vc6jrb"; + url = "https://github.com/ocaml/ocaml-lsp/releases/download/${version}/jsonrpc-${version}.tbz"; + sha256 = "16vvwq3d9xmr91r6yv5i2gyqcdliji7asyq4g6iygi617233fa33"; }; # unvendor some (not all) dependencies. @@ -23,7 +25,7 @@ let # ocaml-lsp without messing with your opam switch, but nix should prevent # this type of problems without resorting to vendoring. preBuild = '' - rm -r vendor/{octavius,uutf,ocaml-syntax-shims,omd,cmdliner} + rm -r ocaml-lsp-server/vendor/{octavius,uutf,ocaml-syntax-shims,omd,cmdliner} ''; buildInputs = [ @@ -36,6 +38,7 @@ let dune-build-info omd cmdliner + jsonrpc ]; lsp = buildDunePackage { @@ -47,6 +50,15 @@ let inherit buildInputs preBuild; }; + jsonrpc = buildDunePackage { + pname = "jsonrpc"; + inherit version src; + useDune2 = true; + minimumOCamlVersion = "4.06"; + + buildInputs = [ yojson stdlib-shims ocaml-syntax-shims ppx_yojson_conv_lib result ]; + }; + in buildDunePackage { pname = "ocaml-lsp-server"; From 9e2c96b26b19b2dd2465e8a0e04f8681753d9942 Mon Sep 17 00:00:00 2001 From: Milan Date: Sat, 19 Dec 2020 18:23:00 +0100 Subject: [PATCH 20/22] qbittorrent: 4.3.0.1 -> 4.3.1 (#107205) --- pkgs/applications/networking/p2p/qbittorrent/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix index 9b6a8bd707d..1550bfeb94d 100644 --- a/pkgs/applications/networking/p2p/qbittorrent/default.nix +++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix @@ -10,13 +10,13 @@ with lib; mkDerivation rec { pname = "qbittorrent"; - version = "4.3.0.1"; + version = "4.3.1"; src = fetchFromGitHub { owner = "qbittorrent"; repo = "qbittorrent"; rev = "release-${version}"; - sha256 = "068sf24mjvc2idimgpzvf7gjk8n9xrr3qqlqfx5j3j598ckm3yfp"; + sha256 = "17ih00q7idrpl3b2vgh4smva6lazs5jw06pblriscn1lrwdvrc38"; }; # NOTE: 2018-05-31: CMake is working but it is not officially supported From e569d6b98c475f8a30822993aa07577fc8e32bcb Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sat, 12 Dec 2020 13:10:31 +0200 Subject: [PATCH 21/22] qbittorrent: clean-up --- pkgs/applications/networking/p2p/qbittorrent/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix index 1550bfeb94d..5efd6910043 100644 --- a/pkgs/applications/networking/p2p/qbittorrent/default.nix +++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix @@ -1,13 +1,13 @@ { mkDerivation, lib, fetchFromGitHub, pkgconfig , boost, libtorrentRasterbar, qtbase, qttools, qtsvg -, debugSupport ? false # Debugging -, guiSupport ? true, dbus ? null # GUI (disable to run headless) +, debugSupport ? false +, guiSupport ? true, dbus ? null # GUI OR headless , webuiSupport ? true # WebUI }: assert guiSupport -> (dbus != null); -with lib; +with lib; mkDerivation rec { pname = "qbittorrent"; version = "4.3.1"; @@ -19,7 +19,6 @@ mkDerivation rec { sha256 = "17ih00q7idrpl3b2vgh4smva6lazs5jw06pblriscn1lrwdvrc38"; }; - # NOTE: 2018-05-31: CMake is working but it is not officially supported nativeBuildInputs = [ pkgconfig ]; buildInputs = [ boost libtorrentRasterbar qtbase qttools qtsvg ] From cb312f3d03dbaf2d60e2fd3917ba2e5d41ffe631 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Sat, 12 Dec 2020 13:11:20 +0200 Subject: [PATCH 22/22] qbittorrent: add default trackerSearch option, include python3 Since people regularly open reports about tracker search not working because python is not found. And since Tracker Search in qBittorrent can not be disabled & at the same time the Pythong is needed for it to work - including Python for default functionality to work. --- .../networking/p2p/qbittorrent/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/qbittorrent/default.nix b/pkgs/applications/networking/p2p/qbittorrent/default.nix index 5efd6910043..cdd96d04aff 100644 --- a/pkgs/applications/networking/p2p/qbittorrent/default.nix +++ b/pkgs/applications/networking/p2p/qbittorrent/default.nix @@ -1,11 +1,13 @@ -{ mkDerivation, lib, fetchFromGitHub, pkgconfig +{ mkDerivation, lib, fetchFromGitHub, makeWrapper, pkgconfig , boost, libtorrentRasterbar, qtbase, qttools, qtsvg , debugSupport ? false , guiSupport ? true, dbus ? null # GUI OR headless , webuiSupport ? true # WebUI +, trackerSearch ? true, python3 ? null }: assert guiSupport -> (dbus != null); +assert trackerSearch -> (python3 != null); with lib; mkDerivation rec { @@ -19,10 +21,11 @@ mkDerivation rec { sha256 = "17ih00q7idrpl3b2vgh4smva6lazs5jw06pblriscn1lrwdvrc38"; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = [ makeWrapper pkgconfig ]; buildInputs = [ boost libtorrentRasterbar qtbase qttools qtsvg ] - ++ optional guiSupport dbus; # D(esktop)-Bus depends on GUI support + ++ optional guiSupport dbus # D(esktop)-Bus depends on GUI support + ++ optional trackerSearch python3; # Otherwise qm_gen.pri assumes lrelease-qt5, which does not exist. QMAKE_LRELEASE = "lrelease"; @@ -34,6 +37,12 @@ mkDerivation rec { ++ optional (!webuiSupport) "--disable-webui" ++ optional debugSupport "--enable-debug"; + postInstall = "wrapProgram $out/bin/${ + if guiSupport + then "qbittorrent" + else "qbittorrent-nox" + } --prefix PATH : ${makeBinPath [ python3 ]}"; + enableParallelBuilding = true; meta = {