···11diff --git a/src/sage/env.py b/src/sage/env.py
22-index 2908f5d04f..81dfd75c0d 100644
22+index 95980cc2df..37107a30e1 100644
33--- a/src/sage/env.py
44+++ b/src/sage/env.py
55-@@ -218,93 +218,12 @@ NTL_LIBDIR = var("NTL_LIBDIR")
55+@@ -227,93 +227,12 @@ OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
66 SAGE_BANNER = var("SAGE_BANNER", "")
77 SAGE_IMPORTALL = var("SAGE_IMPORTALL", "yes")
88···5151- if sys.platform == 'cygwin':
5252- # Later down we take the first matching DLL found, so search
5353- # SAGE_LOCAL first so that it takes precedence
5454-- search_directories = [
5555-- Path(SAGE_LOCAL) / 'bin',
5656-- Path(sysconfig.get_config_var('BINDIR')),
5757-- ]
5454+- if SAGE_LOCAL:
5555+- search_directories.append(Path(SAGE_LOCAL) / 'bin')
5656+- search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
5857- # Note: The following is not very robust, since if there are multible
5958- # versions for the same library this just selects one more or less
6059- # at arbitrary. However, practically speaking, on Cygwin, there
···6665- else:
6766- ext = 'so'
6867-
6969-- search_directories = [Path(SAGE_LOCAL) / 'lib']
6868+- if SAGE_LOCAL:
6969+- search_directories.append(Path(SAGE_LOCAL) / 'lib')
7070- libdir = sysconfig.get_config_var('LIBDIR')
7171- if libdir is not None:
7272- libdir = Path(libdir)
7373- search_directories.append(libdir)
7474-
7575- multiarchlib = sysconfig.get_config_var('MULTIARCH')
7676-- if multiarchlib is not None:
7676+- if multiarchlib is not None:
7777- search_directories.append(libdir / multiarchlib),
7878-
7979- patterns = [f'lib{libname}.{ext}']
···9797+GAP_SO = var("GAP_SO", '/default')
98989999 # post process
100100- if ' ' in DOT_SAGE:
100100+ if DOT_SAGE is not None and ' ' in DOT_SAGE:
···2929 );
3030in
3131stdenv.mkDerivation rec {
3232- version = "9.3";
3232+ version = "9.4";
3333 pname = "sage-src";
34343535 src = fetchFromGitHub {
3636 owner = "sagemath";
3737 repo = "sage";
3838 rev = version;
3939- sha256 = "sha256-l9DX8jcDdKA7GJ6xU+nBsmlZxrcZ9ZUAJju621ooBEo=";
3939+ sha256 = "sha256-jqkr4meG02KbTCMsGvyr1UbosS4ZuUJhPXU/InuS+9A=";
4040 };
41414242 # Patches needed because of particularities of nix or the way this is packaged.
···7777 # be empty since dependencies update all the time.
7878 packageUpgradePatches = [
7979 # After updating smypow to (https://trac.sagemath.org/ticket/3360) we can
8080- # now set the cache dir to be withing the .sage directory. This is not
8080+ # now set the cache dir to be within the .sage directory. This is not
8181 # strictly necessary, but keeps us from littering in the user's HOME.
8282 ./patches/sympow-cache.patch
8383-8484- # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
8585- ./patches/ignore-cmp-deprecation.patch
8686-8787- # remove use of matplotlib function deprecated in 3.4
8888- # https://trac.sagemath.org/ticket/31827
8989- (fetchSageDiff {
9090- base = "9.3";
9191- name = "remove-matplotlib-deprecated-function.patch";
9292- rev = "32b2bcaefddc4fa3d2aee6fa690ce1466cbb5948";
9393- sha256 = "sha256-SXcUGBMOoE9HpuBzgKC3P6cUmM5MiktXbe/7dVdrfWo=";
9494- })
9595-9696- # pari 2.13 update
9797- # https://trac.sagemath.org/ticket/30801
9898- #
9999- # the last commit in that ticket is
100100- # c78b1470fccd915e2fa93f95f2fefba6220fb1f7, but commits after
101101- # 10a4531721d2700fd717e2b3a1364508ffd971c3 only deal with 32-bit
102102- # and post-26635 breakage, none of which is relevant to us. since
103103- # there are post-9.4.beta0 rebases after that, we just skip later
104104- # commits.
105105- (fetchSageDiff {
106106- base = "9.3";
107107- name = "pari-2.13.1.patch";
108108- rev = "10a4531721d2700fd717e2b3a1364508ffd971c3";
109109- sha256 = "sha256-gffWKK9CMREaNOb5zb63iZUgON4FvsPrMQNqe+5ZU9E=";
110110- })
111111-112112- # sympy 1.8 update
113113- # https://trac.sagemath.org/ticket/31647
114114- (fetchSageDiff {
115115- base = "9.4.beta0";
116116- name = "sympy-1.8.patch";
117117- rev = "fa864b36e15696450c36d54215b1e68183b29d25";
118118- sha256 = "sha256-fj/9QEZlVF0fw9NpWflkTuBSKpGjCE6b96ECBgdn77o=";
119119- })
120120-121121- # sphinx 4 update
122122- # https://trac.sagemath.org/ticket/31696
123123- (fetchSageDiff {
124124- base = "9.4.beta3";
125125- name = "sphinx-4.patch";
126126- rev = "bc84af8c795b7da433d2000afc3626ee65ba28b8";
127127- sha256 = "sha256-5Kvs9jarC8xRIU1rdmvIWxQLC25ehiTLJpg5skh8WNM=";
128128- })
129129-130130- # eclib 20210625 update
131131- # https://trac.sagemath.org/ticket/31443
132132- (fetchSageDiff {
133133- base = "9.4.beta3";
134134- name = "eclib-20210625.patch";
135135- rev = "789550ca04c94acfb1e803251538996a34962038";
136136- sha256 = "sha256-VlyEn5hg3joG8t/GwiRfq9TzJ54AoHxLolsNQ3shc2c=";
137137- })
13883 ];
1398414085 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;