diff --git a/pkgs/by-name/gf/gfan/gfan-0.7-macos.patch b/pkgs/by-name/gf/gfan/gfan-0.7-macos.patch new file mode 100644 index 000000000000..9a1bfe31e30e --- /dev/null +++ b/pkgs/by-name/gf/gfan/gfan-0.7-macos.patch @@ -0,0 +1,139 @@ +diff --git a/src/app_components.cpp b/src/app_components.cpp +index 407c23e..8fc0d86 100644 +--- a/src/app_components.cpp ++++ b/src/app_components.cpp +@@ -162,7 +162,6 @@ void connectedComponentsOfSlices(PostComplex& pc, bool saveNoncomets, boo + */ + if (potentialsOutputAndStop) { + std::for_each( +- std::execution::seq, + potentials.begin(), + potentials.end(), + [](Rational p) +@@ -180,7 +179,6 @@ void connectedComponentsOfSlices(PostComplex& pc, bool saveNoncomets, boo + }); + } else { + std::for_each( +- std::execution::par,//fails to trigger parallelism + potentials.begin(), + potentials.end(), + [pc,minConePotential,maxConePotential,saveNoncomets](Rational p) +diff --git a/src/gfanlib_circuittableint.h b/src/gfanlib_circuittableint.h +index 2b5ced4..d53fbec 100644 +--- a/src/gfanlib_circuittableint.h ++++ b/src/gfanlib_circuittableint.h +@@ -25,6 +25,7 @@ namespace gfan{ + template struct MyMakeUnsigned; + template <> struct MyMakeUnsigned{typedef unsigned int type;}; + template <> struct MyMakeUnsigned{typedef unsigned long int type;}; ++ template <> struct MyMakeUnsigned{typedef unsigned long long int type;}; + template <> struct MyMakeUnsigned<__int128>{typedef unsigned __int128 type;}; + + class MVMachineIntegerOverflow: public std::exception +@@ -92,6 +93,15 @@ static std::string toStr(__uint32_t b) + return s.str(); + } + ++#ifndef _64BITLONGINT ++static std::string toStr(long int b) ++{ ++ std::stringstream s; ++ s< ++#include + #include +-#include ++#include + #include + + +@@ -42,9 +42,9 @@ void test() { + + template + //using std::experimental::pmr pmr; +-using pmrvector=std::experimental::pmr::vector; +-typedef std::experimental::pmr::memory_resource MR; //Maybe this should be polymorphic_allocator instead - at least for the constructors using these +-using std::experimental::pmr::get_default_resource; ++using pmrvector=std::pmr::vector; ++typedef std::pmr::memory_resource MR; //Maybe this should be polymorphic_allocator instead - at least for the constructors using these ++using std::pmr::get_default_resource; + + //DELETE + class ResourceWrapper: public MR{ +@@ -76,7 +76,7 @@ public: + } + }; + +-class StackResource: public std::experimental::pmr::memory_resource{ ++class StackResource: public std::pmr::memory_resource{ + /* + * + * Layout of memory +@@ -98,7 +98,7 @@ class StackResource: public std::experimental::pmr::memory_resource{ + The header is 4 byte aligned, while the alignment of each block is specified at allocation. + */ + public: +- std::experimental::pmr::vector mem; ++ std::pmr::vector mem; + int topHeader; + int nbytes; + memory_resource* parentResource; +@@ -124,8 +124,8 @@ public: + return (firstPossible+((align-1)|(minimumAlignment-1)))& ~((align-1)|(minimumAlignment-1)); + } + StackResource(int nbytes_, +- memory_resource* parentResource_=std::experimental::pmr::new_delete_resource(), +- memory_resource* fallBackResource_=std::experimental::pmr::null_memory_resource()): ++ memory_resource* parentResource_=std::pmr::new_delete_resource(), ++ memory_resource* fallBackResource_=std::pmr::null_memory_resource()): + topHeader(0), + nbytes(nbytes_), + mem(nbytes_,parentResource_), +@@ -254,7 +254,7 @@ public: + }; + + +-std::string memoryResourceToString(const std::experimental::pmr::memory_resource *mr); ++std::string memoryResourceToString(const std::pmr::memory_resource *mr); + + // DELETE? + class ResourceInvariant diff --git a/pkgs/by-name/gf/gfan/package.nix b/pkgs/by-name/gf/gfan/package.nix index 9ca8ed038811..8b6bce850f2f 100644 --- a/pkgs/by-name/gf/gfan/package.nix +++ b/pkgs/by-name/gf/gfan/package.nix @@ -9,22 +9,19 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "gfan"; - version = "0.6.2"; + version = "0.7"; src = fetchurl { url = "https://home.math.au.dk/jensen/software/gfan/gfan${finalAttrs.version}.tar.gz"; - sha256 = "02pihqb1lb76a0xbfwjzs1cd6ay3ldfxsm8dvsbl6qs3vkjxax56"; + sha256 = "sha256-q4M3V+Hk1KmGYvSqaROUAT6poib2QWuPhWU1bW/MmJ4="; }; patches = [ ./gfan-0.6.2-cddlib-prefix.patch (fetchpatch { - # removes dead code with invalid member reference in gfanlib - name = "clang-19.patch"; - url = "https://github.com/Singular/Singular/commit/d3f73432d73ac0dd041af83cb35301498e9b57d9.patch"; - stripLen = 2; - extraPrefix = "src/"; - hash = "sha256-jPGMYx/GOFV7Tk3CqaRWeX/UHkzjeL57eZj4r40s8/g="; + name = "cstdint.patch"; + url = "https://salsa.debian.org/math-team/gfan/-/raw/6bb6bc3dd517b3c26fbcb76bfdc47f04d1978007/debian/patches/cstdint.patch"; + hash = "sha256-ALD8Exe2SW8TZg0hIfhvUuiEbbT3Sk7v+oLnNsYA8hs="; }) ] ++ lib.optionals (stdenv.cc.isClang) [ @@ -33,17 +30,17 @@ stdenv.mkDerivation (finalAttrs: { url = "https://raw.githubusercontent.com/sagemath/sage/eea1f59394a5066e9acd8ae39a90302820914ee3/build/pkgs/gfan/patches/nodel.patch"; sha256 = "sha256-RrncSgFyrBIk/Bwe3accxiJ2rpOSJKQ84cV/uBvQsDc="; }) + ] + ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ + # On MacOS, we need to adress differences in int64_t types and remove the + # "experimental/" library and namespace prefixes as well as references to + # std::execution. + ./gfan-0.7-macos.patch ]; - # This test assumes that our implementation of sort behaves identically to the - # one used during development, which is not necessarily the case; update the - # expected result to be sorted using our copy of sort. - postPatch = '' - sort testsuite/0008PolynomialSetUnion/output -o testsuite/0008PolynomialSetUnion/output - sort testsuite/0008PolynomialSetUnion/outputNew -o testsuite/0008PolynomialSetUnion/outputNew - '' - + lib.optionalString stdenv.cc.isClang '' - substituteInPlace Makefile --replace "-fno-guess-branch-probability" "" + postPatch = lib.optionalString stdenv.cc.isClang '' + substituteInPlace Makefile --replace-fail "-fno-guess-branch-probability" "" \ + --replace-fail "-finline-limit=1000" "" for f in $(find -name "*.h" -or -name "*.cpp"); do substituteInPlace "$f" --replace-quiet "log2" "_log2" @@ -60,6 +57,7 @@ stdenv.mkDerivation (finalAttrs: { mpir cddlib ]; + enableParallelBuilding = true; hardeningDisable = [ "libcxxhardeningfast" ]; doCheck = true; @@ -72,7 +70,12 @@ stdenv.mkDerivation (finalAttrs: { meta = { description = "Software package for computing Gröbner fans and tropical varieties"; - license = lib.licenses.gpl2; + license = + with lib.licenses; + OR [ + gpl2 + gpl3 + ]; maintainers = [ lib.maintainers.raskin ]; platforms = lib.platforms.unix; homepage = "http://home.math.au.dk/jensen/software/gfan/gfan.html";