cephes: update override to build with new version from quicklisp

embedded binaries are now removed from the source tree before build

Changed files
+44 -18
pkgs
development
+13 -1
pkgs/development/lisp-modules/nix-cl.nix
···
asdf = "${asdfFasl}/asdf.${faslExt}";
};
-
preConfigure = ''
+
configurePhase = ''
+
runHook preConfigure
+
source ${./setup-hook.sh}
buildAsdfPath
+
+
runHook postConfigure
'';
buildPhase = optionalString (src != null) ''
+
runHook preBuild
+
export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$src//
export ASDF_OUTPUT_TRANSLATIONS="$src:$(pwd):${storeDir}:${storeDir}"
${pkg}/bin/${program} ${toString flags} < $buildScript
+
+
runHook postBuild
'';
# Copy compiled files to store
···
concatMapStringsSep "\\|" (replaceStrings ["." "+"] ["[.]" "[+]"]) systems;
in
''
+
runHook preInstall
+
mkdir -pv $out
cp -r * $out
···
find $out -name "*.asd" \
| grep -v "/\(${mkSystemsRegex systems}\)\.asd$" \
| xargs rm -fv || true
+
+
runHook postInstall
'';
dontPatchShebangs = true;
+15
pkgs/development/lisp-modules/packages.nix
···
build = (build-asdf-system (args' // { version = args'.version + "-build"; }))
.overrideAttrs(o: {
buildPhase = with builtins; ''
+
runHook preBuild
+
mkdir __fasls
export ASDF_OUTPUT_TRANSLATIONS="$(pwd):$(pwd)/__fasls:${storeDir}:${storeDir}"
export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$(pwd)//
${o.pkg}/bin/${o.program} ${toString (o.flags or [])} < ${o.buildScript}
+
+
runHook postBuild
'';
installPhase = ''
+
runHook preInstall
+
mkdir -pv $out
rm -rf __fasls
cp -r * $out
+
+
runHook postInstall
'';
});
in build-asdf-system (args' // {
# Patches are already applied in `build`
patches = [];
+
postPatch = "";
src = build;
});
···
cephes = build-with-compile-into-pwd {
inherit (super.cephes) pname version src lispLibs;
patches = [ ./patches/cephes-make.patch ];
+
postPatch = ''
+
find \( -name '*.dll' -o -name '*.dylib' -o -name '*.so' \) -delete
+
'';
postConfigure = ''
substituteAllInPlace cephes.asd
+
'';
+
postInstall = ''
+
find $out -name '*.o' -delete
'';
};
+16 -17
pkgs/development/lisp-modules/patches/cephes-make.patch
···
--- 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))))
+
@@ -16,7 +16,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 (pathname-directory lib-dir)
+
:name #+(or (and unix (not darwin)) windows win32) "libmd"
+
#+(and darwin arm64) "libmd-arm64"
+
@@ -30,7 +30,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