diff --git a/pkgs/by-name/pe/perseus/fix-gcc15.patch b/pkgs/by-name/pe/perseus/fix-gcc15.patch new file mode 100644 index 000000000000..58289cd6a062 --- /dev/null +++ b/pkgs/by-name/pe/perseus/fix-gcc15.patch @@ -0,0 +1,57 @@ +diff --git a/Cells/Point.h b/Cells/Point.h +index b03113c..472372e 100644 +--- a/Cells/Point.h ++++ b/Cells/Point.h +@@ -91,7 +91,7 @@ public: + template + struct ptcomp + { +- bool operator ()(Point* p, Point* q) ++ bool operator ()(Point* p, Point* q) const + { + if (p == q) return false; + if (p == NULL && q != NULL) return true; +@@ -106,7 +106,7 @@ struct ptcomp + template + struct ptcomplex + { +- bool operator ()(Point* p, Point* q) ++ bool operator ()(Point* p, Point* q) const + { + if (p == q) return false; + if (p == NULL && q != NULL) return true; +diff --git a/Complexes/CToplex.h b/Complexes/CToplex.h +index bdd026f..732701e 100644 +--- a/Complexes/CToplex.h ++++ b/Complexes/CToplex.h +@@ -24,7 +24,7 @@ + // vector lexico comparison for map-making + struct addcomp + { +- bool operator () (vector* v1, vector* v2) ++ bool operator () (vector* v1, vector* v2) const + { + //cout<<" here "; cin.get(); + if (v1 == v2) return false; +diff --git a/Global/Combinatorics.h b/Global/Combinatorics.h +index d751a04..d8cf6b2 100644 +--- a/Global/Combinatorics.h ++++ b/Global/Combinatorics.h +@@ -18,7 +18,7 @@ + // order nums increasingly + struct incnum + { +- bool operator() (num n1, num n2) ++ bool operator() (num n1, num n2) const + { + return (n1 < n2); + } +@@ -28,7 +28,7 @@ struct incnum + // order nums decreasingly + struct decnum + { +- bool operator() (num n1, num n2) ++ bool operator() (num n1, num n2) const + { + return (n1 > n2); + } diff --git a/pkgs/by-name/pe/perseus/package.nix b/pkgs/by-name/pe/perseus/package.nix index 27bb58ec764e..08f7e562c039 100644 --- a/pkgs/by-name/pe/perseus/package.nix +++ b/pkgs/by-name/pe/perseus/package.nix @@ -18,6 +18,11 @@ stdenv.mkDerivation { }; sourceRoot = "."; + + patches = [ + ./fix-gcc15.patch + ]; + env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ]; buildPhase = '' g++ Pers.cpp -O3 -fpermissive -o perseus