about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKasper Gałkowski <kgalkowski@comscore.com>2024-03-28 08:39:17 +0100
committerKasper Gałkowski <kgalkowski@comscore.com>2024-03-28 08:39:17 +0100
commitb8daebef9a868b5771b62096fd31f2ad40e751ec (patch)
treec65d365a97dadefa62d3018bfca7de69dfe4d13d
parent2c9ecd1f0400076a4d6b2193ad468ff0a7e7fdc5 (diff)
sbcl.pkgs.cephes: fix build
The package could not be built because it was trying to write the DLL into
$src. One way to fix that is to build the DLL beforehand. Perhaps "make" could
be convinced to put its outputs elsewhere, then the build-with-compile-into-pwd
could be swapped for just build-asdf-system. It would have to create $out during
buildPhase.
-rw-r--r--pkgs/development/lisp-modules/packages.nix8
-rw-r--r--pkgs/development/lisp-modules/patches/cephes-make.patch22
2 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/development/lisp-modules/packages.nix b/pkgs/development/lisp-modules/packages.nix
index a752f713043f2..49c787ea760a5 100644
--- a/pkgs/development/lisp-modules/packages.nix
+++ b/pkgs/development/lisp-modules/packages.nix
@@ -243,6 +243,14 @@ let
     '';
   };
 
+  cephes = build-with-compile-into-pwd {
+    inherit (super.cephes) pname version src lispLibs;
+    patches = [ ./patches/cephes-make.patch ];
+    postConfigure = ''
+      substituteAllInPlace cephes.asd
+    '';
+  };
+
   clx-truetype = build-asdf-system {
     pname = "clx-truetype";
     version = "20160825-git";
diff --git a/pkgs/development/lisp-modules/patches/cephes-make.patch b/pkgs/development/lisp-modules/patches/cephes-make.patch
new file mode 100644
index 0000000000000..b67b5f70ad3ce
--- /dev/null
+++ b/pkgs/development/lisp-modules/patches/cephes-make.patch
@@ -0,0 +1,22 @@
+--- a/cephes.asd
++++ b/cephes.asd
+@@ -5,7 +5,7 @@
+ (defclass makefile (source-file) ((type :initform "m")))
+ (defmethod perform ((o load-op) (c makefile)) t)
+ (defmethod perform ((o compile-op) (c makefile))
+-  (let* ((lib-dir (system-relative-pathname "cephes" "scipy-cephes"))
++  (let* ((lib-dir #P"@out@/scipy-cephes")
+          (lib (make-pathname :directory `(:relative ,(namestring lib-dir))
+                              :name "libmd"
+                              :type #+darwin "dylib" #+(and unix (not darwin)) "so" #+(or windows win32) "dll"))
+@@ -14,7 +14,7 @@
+ 	(format *error-output* "Library ~S exists, skipping build" lib)
+ 	(format *error-output* "Building ~S~%" lib))
+     (unless built
+-      (chdir (native-namestring lib-dir))
++      (chdir "scipy-cephes")
+       (run-program "make" :output t))))
+ 
+ (defsystem "cephes"
+
+Diff finished.  Thu Mar 28 08:13:30 2024