flint, ntl: Fix pkgsStatic builds, clean-up derivations (#445050)

authored by Weijia Wang and committed by GitHub e0fd47c4 b0c704f1

+104 -59
+26
pkgs/by-name/fl/flint/checkPhase.patch
···
··· 1 + https://github.com/flintlib/flint/pull/2411 2 + 3 + From 9957b17e6b08bd57790f7da1344b4d92eefc0b38 Mon Sep 17 00:00:00 2001 4 + From: Ross Smyth <18294397+RossSmyth@users.noreply.github.com> 5 + Date: Sun, 21 Sep 2025 15:58:57 -0400 6 + Subject: [PATCH] Fix duplicate symbols linker error 7 + 8 + When I run `make check` I get linker errors without 9 + this patch 10 + --- 11 + src/double_interval.h | 2 +- 12 + 1 file changed, 1 insertion(+), 1 deletion(-) 13 + 14 + diff --git a/src/double_interval.h b/src/double_interval.h 15 + index a423257db2..5f685c283f 100644 16 + --- a/src/double_interval.h 17 + +++ b/src/double_interval.h 18 + @@ -13,7 +13,7 @@ 19 + #define DOUBLE_INTERVAL_H 20 + 21 + #ifdef DOUBLE_INTERVAL_INLINES_C 22 + -#define DOUBLE_INTERVAL_INLINE 23 + +#define DOUBLE_INTERVAL_INLINE static 24 + #else 25 + #define DOUBLE_INTERVAL_INLINE static inline 26 + #endif
+2 -2
pkgs/by-name/ms/msolve/package.nix
··· 3 stdenv, 4 fetchFromGitHub, 5 autoreconfHook, 6 - flint3, 7 gmp, 8 mpfr, 9 llvmPackages, ··· 29 ]; 30 31 buildInputs = [ 32 - flint3 33 gmp 34 mpfr 35 ]
··· 3 stdenv, 4 fetchFromGitHub, 5 autoreconfHook, 6 + flint, 7 gmp, 8 mpfr, 9 llvmPackages, ··· 29 ]; 30 31 buildInputs = [ 32 + flint 33 gmp 34 mpfr 35 ]
+2 -2
pkgs/by-name/no/normaliz/package.nix
··· 4 fetchFromGitHub, 5 autoreconfHook, 6 gmpxx, 7 - flint3, 8 nauty, 9 }: 10 ··· 21 22 buildInputs = [ 23 gmpxx 24 - flint3 25 nauty 26 ]; 27
··· 4 fetchFromGitHub, 5 autoreconfHook, 6 gmpxx, 7 + flint, 8 nauty, 9 }: 10 ··· 21 22 buildInputs = [ 23 gmpxx 24 + flint 25 nauty 26 ]; 27
+19 -14
pkgs/by-name/nt/ntl/package.nix
··· 13 14 assert withGf2x -> gf2x != null; 15 16 - stdenv.mkDerivation rec { 17 pname = "ntl"; 18 version = "11.5.1"; 19 20 src = fetchurl { 21 - url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz"; 22 - sha256 = "sha256-IQ0GwxMGy8bq9oFEU8Vsd22djo3zbXTrMG9qUj0caoo="; 23 }; 24 25 buildInputs = [ 26 gmp 27 ]; 28 29 - nativeBuildInputs = [ 30 - perl # needed for ./configure 31 - ]; 32 - 33 - sourceRoot = "${pname}-${version}/src"; 34 35 enableParallelBuilding = true; 36 ··· 42 configurePlatforms = [ ]; 43 44 # reference: http://shoup.net/ntl/doc/tour-unix.html 45 configureFlags = [ 46 "DEF_PREFIX=$(out)" 47 - "SHARED=on" # genereate a shared library (as well as static) 48 "NATIVE=off" # don't target code to current hardware (reproducibility, portability) 49 "TUNE=${ 50 if tune then ··· 55 "generic" # "chooses options that should be OK for most platforms" 56 }" 57 "CXX=${stdenv.cc.targetPrefix}c++" 58 ] 59 ++ lib.optionals withGf2x [ 60 "NTL_GF2X_LIB=on" 61 "GF2X_PREFIX=${gf2x}" 62 ]; 63 64 doCheck = true; # takes some time 65 66 - meta = with lib; { 67 description = "Library for doing Number Theory"; 68 longDescription = '' 69 NTL is a high-performance, portable C++ library providing data ··· 76 homepage = "http://www.shoup.net/ntl/"; 77 # also locally at "${src}/doc/tour-changes.html"; 78 changelog = "https://www.shoup.net/ntl/doc/tour-changes.html"; 79 - teams = [ teams.sage ]; 80 - license = licenses.gpl2Plus; 81 - platforms = platforms.all; 82 # Does not cross compile 83 # https://github.com/libntl/ntl/issues/8 84 broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); 85 }; 86 - }
··· 13 14 assert withGf2x -> gf2x != null; 15 16 + stdenv.mkDerivation (finalAttrs: { 17 pname = "ntl"; 18 version = "11.5.1"; 19 20 src = fetchurl { 21 + url = "http://www.shoup.net/ntl/ntl-${finalAttrs.version}.tar.gz"; 22 + hash = "sha256-IQ0GwxMGy8bq9oFEU8Vsd22djo3zbXTrMG9qUj0caoo="; 23 }; 24 25 + strictDeps = true; 26 + depsBuildBuild = [ 27 + perl # needed for ./configure 28 + ]; 29 buildInputs = [ 30 gmp 31 ]; 32 33 + sourceRoot = "ntl-${finalAttrs.version}/src"; 34 35 enableParallelBuilding = true; 36 ··· 42 configurePlatforms = [ ]; 43 44 # reference: http://shoup.net/ntl/doc/tour-unix.html 45 + dontAddStaticConfigureFlags = true; # perl config doesn't understand it. 46 configureFlags = [ 47 "DEF_PREFIX=$(out)" 48 "NATIVE=off" # don't target code to current hardware (reproducibility, portability) 49 "TUNE=${ 50 if tune then ··· 55 "generic" # "chooses options that should be OK for most platforms" 56 }" 57 "CXX=${stdenv.cc.targetPrefix}c++" 58 + "AR=${stdenv.cc.targetPrefix}ar" 59 + ] 60 + ++ lib.optionals (!stdenv.hostPlatform.isStatic) [ 61 + "SHARED=on" # genereate a shared library 62 ] 63 ++ lib.optionals withGf2x [ 64 "NTL_GF2X_LIB=on" 65 "GF2X_PREFIX=${gf2x}" 66 ]; 67 68 + enableParallelChecking = true; 69 doCheck = true; # takes some time 70 71 + meta = { 72 description = "Library for doing Number Theory"; 73 longDescription = '' 74 NTL is a high-performance, portable C++ library providing data ··· 81 homepage = "http://www.shoup.net/ntl/"; 82 # also locally at "${src}/doc/tour-changes.html"; 83 changelog = "https://www.shoup.net/ntl/doc/tour-changes.html"; 84 + teams = [ lib.teams.sage ]; 85 + license = lib.licenses.gpl2Plus; 86 + platforms = lib.platforms.all; 87 # Does not cross compile 88 # https://github.com/libntl/ntl/issues/8 89 broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform); 90 }; 91 + })
+2 -2
pkgs/by-name/pp/pplite/package.nix
··· 3 lib, 4 fetchurl, 5 fetchpatch, 6 - flint3, 7 gmp, 8 }: 9 ··· 17 }; 18 19 buildInputs = [ 20 - flint3 21 gmp 22 ]; 23
··· 3 lib, 4 fetchurl, 5 fetchpatch, 6 + flint, 7 gmp, 8 }: 9 ··· 17 }; 18 19 buildInputs = [ 20 + flint 21 gmp 22 ]; 23
+2 -2
pkgs/by-name/s7/s7/package.nix
··· 3 fetchFromGitLab, 4 stdenv, 5 6 - flint3, 7 gmp, 8 libmpc, 9 mpfr, ··· 37 }; 38 39 buildInputs = 40 - lib.optional withArb flint3 41 ++ lib.optionals withGMP [ 42 gmp 43 mpfr
··· 3 fetchFromGitLab, 4 stdenv, 5 6 + flint, 7 gmp, 8 libmpc, 9 mpfr, ··· 37 }; 38 39 buildInputs = 40 + lib.optional withArb flint 41 ++ lib.optionals withGMP [ 42 gmp 43 mpfr
+4 -4
pkgs/by-name/sa/sage/package.nix
··· 17 self: super: { 18 # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies 19 sagelib = self.callPackage ./sagelib.nix { 20 - inherit flint3; 21 inherit sage-src env-locations singular; 22 inherit (maxima) lisp-compiler; 23 linbox = pkgs.linbox; ··· 79 python3 80 singular 81 palp 82 - flint3 83 pythonEnv 84 maxima 85 ; ··· 142 extraLibs = pythonRuntimeDeps; 143 }; # make the libs accessible 144 145 - singular = pkgs.singular.override { inherit flint3; }; 146 147 maxima = pkgs.maxima-ecl.override { 148 lisp-compiler = pkgs.ecl.override { ··· 164 # openblas instead of openblasCompat. Apparently other packages somehow use flints 165 # blas when it is available. Alternative would be to override flint to use 166 # openblasCompat. 167 - flint3 = pkgs.flint3.override { withBlas = false; }; 168 169 # Multiple palp dimensions need to be available and sage expects them all to be 170 # in the same folder.
··· 17 self: super: { 18 # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies 19 sagelib = self.callPackage ./sagelib.nix { 20 + inherit flint; 21 inherit sage-src env-locations singular; 22 inherit (maxima) lisp-compiler; 23 linbox = pkgs.linbox; ··· 79 python3 80 singular 81 palp 82 + flint 83 pythonEnv 84 maxima 85 ; ··· 142 extraLibs = pythonRuntimeDeps; 143 }; # make the libs accessible 144 145 + singular = pkgs.singular.override { inherit flint; }; 146 147 maxima = pkgs.maxima-ecl.override { 148 lisp-compiler = pkgs.ecl.override { ··· 164 # openblas instead of openblasCompat. Apparently other packages somehow use flints 165 # blas when it is available. Alternative would be to override flint to use 166 # openblasCompat. 167 + flint = pkgs.flint.override { withBlas = false; }; 168 169 # Multiple palp dimensions need to be available and sage expects them all to be 170 # in the same folder.
+3 -3
pkgs/by-name/sa/sage/sage-env.nix
··· 43 rubiks, 44 blas, 45 lapack, 46 - flint3, 47 gmp, 48 mpfr, 49 zlib, ··· 167 export LDFLAGS='${ 168 lib.concatStringsSep " " ( 169 map (pkg: "-L${pkg}/lib") [ 170 - flint3 171 gap 172 glpk 173 gmp ··· 187 singular 188 gmp.dev 189 glpk 190 - flint3 191 gap 192 mpfr.dev 193 ]
··· 43 rubiks, 44 blas, 45 lapack, 46 + flint, 47 gmp, 48 mpfr, 49 zlib, ··· 167 export LDFLAGS='${ 168 lib.concatStringsSep " " ( 169 map (pkg: "-L${pkg}/lib") [ 170 + flint 171 gap 172 glpk 173 gmp ··· 187 singular 188 gmp.dev 189 glpk 190 + flint 191 gap 192 mpfr.dev 193 ]
+2 -2
pkgs/by-name/sa/sage/sagelib.nix
··· 21 eclib, 22 ecm, 23 fflas-ffpack, 24 - flint3, 25 gap, 26 giac, 27 givaro, ··· 136 eclib 137 ecm 138 fflas-ffpack 139 - flint3 140 gap 141 giac 142 givaro
··· 21 eclib, 22 ecm, 23 fflas-ffpack, 24 + flint, 25 gap, 26 giac, 27 givaro, ··· 136 eclib 137 ecm 138 fflas-ffpack 139 + flint 140 gap 141 giac 142 givaro
+3 -3
pkgs/by-name/si/singular/package.nix
··· 15 sharutils, 16 file, 17 getconf, 18 - flint3, 19 ntl, 20 mpfr, 21 cddlib, ··· 52 configureFlags = [ 53 "--enable-gfanlib" 54 "--with-ntl=${ntl}" 55 - "--with-flint=${flint3}" 56 ] 57 ++ lib.optionals enableDocs [ 58 "--enable-doc-build" ··· 88 buildInputs = [ 89 # necessary 90 gmp 91 - flint3 92 # by upstream recommended but optional 93 ncurses 94 readline
··· 15 sharutils, 16 file, 17 getconf, 18 + flint, 19 ntl, 20 mpfr, 21 cddlib, ··· 52 configureFlags = [ 53 "--enable-gfanlib" 54 "--with-ntl=${ntl}" 55 + "--with-flint=${flint}" 56 ] 57 ++ lib.optionals enableDocs [ 58 "--enable-doc-build" ··· 88 buildInputs = [ 89 # necessary 90 gmp 91 + flint 92 # by upstream recommended but optional 93 ncurses 94 readline
+2 -2
pkgs/by-name/sy/symengine/package.nix
··· 4 fetchFromGitHub, 5 cmake, 6 gmp, 7 - flint3, 8 mpfr, 9 libmpc, 10 withShared ? true, ··· 25 26 buildInputs = [ 27 gmp 28 - flint3 29 mpfr 30 libmpc 31 ];
··· 4 fetchFromGitHub, 5 cmake, 6 gmp, 7 + flint, 8 mpfr, 9 libmpc, 10 withShared ? true, ··· 25 26 buildInputs = [ 27 gmp 28 + flint 29 mpfr 30 libmpc 31 ];
+31 -14
pkgs/development/libraries/flint/3.nix pkgs/by-name/fl/flint/package.nix
··· 2 lib, 3 stdenv, 4 fetchurl, 5 - gmp, 6 - mpfr, 7 - ntl, 8 windows, 9 autoconf, 10 automake, 11 gettext, 12 libtool, 13 - openblas ? null, 14 blas, 15 lapack, 16 withBlas ? true, 17 withNtl ? !ntl.meta.broken, 18 }: 19 20 assert 21 withBlas 22 -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas"; 23 24 - stdenv.mkDerivation rec { 25 - pname = "flint3"; 26 version = "3.3.1"; 27 28 src = fetchurl { 29 - url = "https://flintlib.org/download/flint-${version}.tar.gz"; 30 hash = "sha256-ZNcOUTB2z6lx4EELWMHaXTURKRPppWtE4saBtFnT6vs="; 31 }; 32 33 nativeBuildInputs = [ 34 autoconf 35 automake ··· 50 ++ lib.optionals withNtl [ 51 ntl 52 ] 53 ++ lib.optionals stdenv.hostPlatform.isMinGW [ 54 windows.pthreads 55 ]; ··· 70 ] 71 ++ lib.optionals withNtl [ 72 "--with-ntl=${ntl}" 73 ]; 74 75 enableParallelBuilding = true; 76 - 77 doCheck = true; 78 79 - meta = with lib; { 80 description = "Fast Library for Number Theory"; 81 - license = licenses.lgpl3Plus; 82 - maintainers = with maintainers; [ smasher164 ]; 83 - teams = [ teams.sage ]; 84 - platforms = platforms.all; 85 homepage = "https://www.flintlib.org/"; 86 downloadPage = "https://www.flintlib.org/downloads.html"; 87 }; 88 - }
··· 2 lib, 3 stdenv, 4 fetchurl, 5 + fetchpatch, 6 windows, 7 autoconf, 8 automake, 9 gettext, 10 libtool, 11 + gmp, 12 + mpfr, 13 + ntl, 14 blas, 15 lapack, 16 + boehmgc, 17 + openblas ? null, 18 withBlas ? true, 19 withNtl ? !ntl.meta.broken, 20 + withGc ? false, 21 }: 22 23 assert 24 withBlas 25 -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas"; 26 27 + stdenv.mkDerivation (finalAttrs: { 28 + pname = "flint"; 29 version = "3.3.1"; 30 31 src = fetchurl { 32 + url = "https://flintlib.org/download/flint-${finalAttrs.version}.tar.gz"; 33 hash = "sha256-ZNcOUTB2z6lx4EELWMHaXTURKRPppWtE4saBtFnT6vs="; 34 }; 35 36 + patches = [ 37 + # Remove once/if https://github.com/flintlib/flint/pull/2411 is merged 38 + # Required or else during the check phase the build fails while 39 + # linking a test due to duplicate symbol errors 40 + ./checkPhase.patch 41 + ]; 42 + 43 + strictDeps = true; 44 nativeBuildInputs = [ 45 autoconf 46 automake ··· 61 ++ lib.optionals withNtl [ 62 ntl 63 ] 64 + ++ lib.optionals withGc [ 65 + boehmgc 66 + ] 67 ++ lib.optionals stdenv.hostPlatform.isMinGW [ 68 windows.pthreads 69 ]; ··· 84 ] 85 ++ lib.optionals withNtl [ 86 "--with-ntl=${ntl}" 87 + ] 88 + ++ lib.optionals withGc [ 89 + "--with-gc=${boehmgc}" 90 ]; 91 92 enableParallelBuilding = true; 93 + enableParallelChecking = true; 94 doCheck = true; 95 96 + meta = { 97 description = "Fast Library for Number Theory"; 98 + license = lib.licenses.lgpl3Plus; 99 + maintainers = [ lib.maintainers.smasher164 ]; 100 + teams = [ lib.teams.sage ]; 101 + platforms = lib.platforms.all; 102 homepage = "https://www.flintlib.org/"; 103 downloadPage = "https://www.flintlib.org/downloads.html"; 104 }; 105 + })
+2 -2
pkgs/development/ocaml-modules/apron/default.nix
··· 10 findlib, 11 camlidl, 12 mlgmpidl, 13 - flint3, 14 pplite, 15 }: 16 ··· 34 mpfr 35 ppl 36 camlidl 37 - flint3 38 pplite 39 ]; 40 propagatedBuildInputs = [ mlgmpidl ];
··· 10 findlib, 11 camlidl, 12 mlgmpidl, 13 + flint, 14 pplite, 15 }: 16 ··· 34 mpfr 35 ppl 36 camlidl 37 + flint 38 pplite 39 ]; 40 propagatedBuildInputs = [ mlgmpidl ];
+2 -2
pkgs/development/ocaml-modules/mopsa/default.nix
··· 5 clang, 6 libclang, 7 libllvm, 8 - flint3, 9 mpfr, 10 pplite, 11 ocaml, ··· 39 buildInputs = [ 40 arg-complete 41 camlidl 42 - flint3 43 libclang 44 mpfr 45 pplite
··· 5 clang, 6 libclang, 7 libllvm, 8 + flint, 9 mpfr, 10 pplite, 11 ocaml, ··· 39 buildInputs = [ 40 arg-complete 41 camlidl 42 + flint 43 libclang 44 mpfr 45 pplite
+1 -1
pkgs/development/r-modules/default.nix
··· 503 pkg-config 504 gmp.dev 505 mpfr.dev 506 - flint3 507 ]; 508 fingerPro = [ pkgs.gsl ]; 509 Formula = [ pkgs.gmp ];
··· 503 pkg-config 504 gmp.dev 505 mpfr.dev 506 + flint 507 ]; 508 fingerPro = [ pkgs.gsl ]; 509 Formula = [ pkgs.gmp ];
+1
pkgs/top-level/aliases.nix
··· 901 flashrom-stable = flashprog; # Added 2024-03-01 902 flatbuffers_2_0 = flatbuffers; # Added 2022-05-12 903 flatcam = throw "flatcam has been removed because it is unmaintained since 2022 and doesn't support Python > 3.10"; # Added 2025-01-25 904 floorp = throw "floorp has been replaced with floorp-bin, as building from upstream sources has become unfeasible starting with version 12.x"; # Added 2025-09-06 905 floorp-unwrapped = throw "floorp-unwrapped has been replaced with floorp-bin-unwrapped, as building from upstream sources has become unfeasible starting with version 12.x"; # Added 2025-09-06 906 flow-editor = flow-control; # Added 2025-03-05
··· 901 flashrom-stable = flashprog; # Added 2024-03-01 902 flatbuffers_2_0 = flatbuffers; # Added 2022-05-12 903 flatcam = throw "flatcam has been removed because it is unmaintained since 2022 and doesn't support Python > 3.10"; # Added 2025-01-25 904 + flint3 = flint; # Added 2025-09-21 905 floorp = throw "floorp has been replaced with floorp-bin, as building from upstream sources has become unfeasible starting with version 12.x"; # Added 2025-09-06 906 floorp-unwrapped = throw "floorp-unwrapped has been replaced with floorp-bin-unwrapped, as building from upstream sources has become unfeasible starting with version 12.x"; # Added 2025-09-06 907 flow-editor = flow-control; # Added 2025-03-05
-4
pkgs/top-level/all-packages.nix
··· 7371 }; 7372 fftwMpi = fftw.override { enableMpi = true; }; 7373 7374 - flint = flint3; 7375 - 7376 - flint3 = callPackage ../development/libraries/flint/3.nix { }; 7377 - 7378 fltk13 = callPackage ../development/libraries/fltk { }; 7379 fltk14 = callPackage ../development/libraries/fltk/1.4.nix { }; 7380 fltk13-minimal = fltk13.override {
··· 7371 }; 7372 fftwMpi = fftw.override { enableMpi = true; }; 7373 7374 fltk13 = callPackage ../development/libraries/fltk { }; 7375 fltk14 = callPackage ../development/libraries/fltk/1.4.nix { }; 7376 fltk13-minimal = fltk13.override {