summary refs log tree commit diff
path: root/pkgs/development/libraries/linbox
diff options
context:
space:
mode:
authorMasanori Ogino <167209+omasanori@users.noreply.github.com>2020-10-22 22:47:50 +0900
committerMasanori Ogino <167209+omasanori@users.noreply.github.com>2020-10-26 18:29:29 +0900
commite0fecf442cd126bf4aab4d310fc75bcb935b3713 (patch)
tree683275e40e529840705e9beacecce18d713c5b5c /pkgs/development/libraries/linbox
parentec3aa4c109cf4ddb2094269d7673bae3d3867308 (diff)
downloadnixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar.gz
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar.bz2
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar.lz
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar.xz
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.tar.zst
nixpkgs-e0fecf442cd126bf4aab4d310fc75bcb935b3713.zip
linbox: backport upstream fixes
References:
https://github.com/linbox-team/linbox/commit/f78117d9c365efd46f5ea2903b553a08c4029aeb
https://github.com/linbox-team/linbox/commit/4ff828e20053ab2ef9adc4ce6931d159fd513cef

Signed-off-by: Masanori Ogino <167209+omasanori@users.noreply.github.com>
Diffstat (limited to 'pkgs/development/libraries/linbox')
-rw-r--r--pkgs/development/libraries/linbox/default.nix17
-rw-r--r--pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch13
2 files changed, 28 insertions, 2 deletions
diff --git a/pkgs/development/libraries/linbox/default.nix b/pkgs/development/libraries/linbox/default.nix
index 09bd7e12091..4072dcd1d25 100644
--- a/pkgs/development/libraries/linbox/default.nix
+++ b/pkgs/development/libraries/linbox/default.nix
@@ -14,8 +14,7 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "linbox";
-  version = "1.6.3";
-
+  version = "1.6.3"; # TODO: Check postPatch script on update
 
   src = fetchFromGitHub {
     owner = "linbox-team";
@@ -36,6 +35,20 @@ stdenv.mkDerivation rec {
     fflas-ffpack
   ];
 
+  patches = [
+    # Remove inappropriate `const &` qualifiers on data members that can be
+    # modified via member functions.
+    # See also: https://github.com/linbox-team/linbox/pull/256
+    ./patches/linbox-pr256-part2.patch # TODO: Remove on 1.7.0 update
+  ];
+
+  postPatch = ''
+    # Remove @LINBOXSAGE_LIBS@ that is actually undefined.
+    # See also: https://github.com/linbox-team/linbox/pull/249
+    # TODO: Remove on 1.7.0 update
+    find . -type f -exec sed -e 's/@LINBOXSAGE_LIBS@//' -i {} \;
+  '';
+
   configureFlags = [
     "--with-blas-libs=-lblas"
     "--disable-optimization"
diff --git a/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch b/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch
new file mode 100644
index 00000000000..ec8571a7d71
--- /dev/null
+++ b/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch
@@ -0,0 +1,13 @@
+--- a/linbox/algorithms/det-rational.h
++++ b/linbox/algorithms/det-rational.h
+@@ -79,8 +79,8 @@
+ 	struct MyRationalModularDet {
+ 		const Blackbox &A;
+ 		const MyMethod &M;
+-		const Integer &mul;//multiplicative prec;
+-		const Integer &div;
++		Integer mul;//multiplicative prec;
++		Integer div;
+ 
+ 		MyRationalModularDet(const Blackbox& b, const MyMethod& n,
+ 				     const Integer & p1, const Integer & p2) :