about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorMasanori Ogino <167209+omasanori@users.noreply.github.com>2020-10-19 09:00:00 +0900
committerMasanori Ogino <167209+omasanori@users.noreply.github.com>2020-10-19 10:29:01 +0900
commit096ef947170de11130edaeeb29b7568b954b92d9 (patch)
tree3cf33ae9460060a9947bbef52f1ebb4fa2e73580 /pkgs
parent713c3682910623bfc973333b75fc38c5330e3be7 (diff)
gfan: fix build failures with cddlib v0.94l
It fixes https://github.com/NixOS/nixpkgs/issues/100622.

Signed-off-by: Masanori Ogino <167209+omasanori@users.noreply.github.com>
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/science/math/gfan/default.nix8
-rw-r--r--pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch55
2 files changed, 61 insertions, 2 deletions
diff --git a/pkgs/applications/science/math/gfan/default.nix b/pkgs/applications/science/math/gfan/default.nix
index adac92f376c8e..7e2a4625d3011 100644
--- a/pkgs/applications/science/math/gfan/default.nix
+++ b/pkgs/applications/science/math/gfan/default.nix
@@ -8,11 +8,15 @@ stdenv.mkDerivation rec {
     sha256 = "02pihqb1lb76a0xbfwjzs1cd6ay3ldfxsm8dvsbl6qs3vkjxax56";
   };
 
-  patchPhase = stdenv.lib.optionalString stdenv.cc.isClang ''
+  patches = [
+    ./gfan-0.6.2-cddlib-prefix.patch
+  ];
+
+  postPatch = stdenv.lib.optionalString stdenv.cc.isClang ''
     substituteInPlace Makefile --replace "-fno-guess-branch-probability" ""
   '';
 
-  buildFlags = [ "CC=cc" "CXX=c++" "cddnoprefix=1" ];
+  buildFlags = [ "CC=cc" "CXX=c++" ];
   installFlags = [ ''PREFIX=$(out)'' ];
   buildInputs = [ gmp mpir cddlib ];
 
diff --git a/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch b/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch
new file mode 100644
index 0000000000000..8a96a991cf754
--- /dev/null
+++ b/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch
@@ -0,0 +1,55 @@
+diff -ru gfan0.6.2.orig/src/app_librarytest.cpp gfan0.6.2/src/app_librarytest.cpp
+--- gfan0.6.2.orig/src/app_librarytest.cpp	2020-10-19 08:41:27.981863500 +0900
++++ gfan0.6.2/src/app_librarytest.cpp	2020-10-19 08:42:44.551863500 +0900
+@@ -12,8 +12,8 @@
+ #include "setoper.h"
+ #include "cdd.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
+ #endif
+ #include <iostream>
+ #include <fstream>
+diff -ru gfan0.6.2.orig/src/gfanlib_zcone.cpp gfan0.6.2/src/gfanlib_zcone.cpp
+--- gfan0.6.2.orig/src/gfanlib_zcone.cpp	2020-10-19 08:41:27.981863500 +0900
++++ gfan0.6.2/src/gfanlib_zcone.cpp	2020-10-19 08:42:44.571863500 +0900
+@@ -16,8 +16,8 @@
+ #include "setoper.h"
+ #include "cdd.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
+ #endif
+ //}
+ 
+@@ -52,8 +52,8 @@
+ 				  "dd_free_global_constants()\n"
+ 				  "in your deinitialisation code (only available for cddlib version>=094d).\n"
+ 				  "This requires the header includes:\n"
+-				  "#include \"cdd/setoper.h\"\n"
+-				  "#include \"cdd/cdd.h\"\n"
++				  "#include \"cddlib/setoper.h\"\n"
++				  "#include \"cddlib/cdd.h\"\n"
+ 				  "\n"
+ 				  "Alternatively, you may call gfan:initializeCddlibIfRequired() and deinitializeCddlibIfRequired()\n"
+ 				  "if gfanlib is the only code using cddlib. If at some point cddlib is no longer required by gfanlib\n"
+diff -ru gfan0.6.2.orig/src/lp_cdd.cpp gfan0.6.2/src/lp_cdd.cpp
+--- gfan0.6.2.orig/src/lp_cdd.cpp	2020-10-19 08:41:27.991863500 +0900
++++ gfan0.6.2/src/lp_cdd.cpp	2020-10-19 08:42:44.571863500 +0900
+@@ -5,9 +5,9 @@
+ #include "cdd.h"
+ #include "cdd_f.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
+-#include "cdd/cdd_f.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
++#include "cddlib/cdd_f.h"
+ #endif
+ //}
+ #include "termorder.h"