Skip to content

Commit f6b9e01

Browse files
committed
cephes: update override to build with new version from quicklisp
embedded binaries are now removed from the source tree before build
1 parent fd3e88e commit f6b9e01

File tree

3 files changed

+44
-18
lines changed

3 files changed

+44
-18
lines changed

pkgs/development/lisp-modules/nix-cl.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,23 @@ let
177177
asdf = "${asdfFasl}/asdf.${faslExt}";
178178
};
179179

180-
preConfigure = ''
180+
configurePhase = ''
181+
runHook preConfigure
182+
181183
source ${./setup-hook.sh}
182184
buildAsdfPath
185+
186+
runHook postConfigure
183187
'';
184188

185189
buildPhase = optionalString (src != null) ''
190+
runHook preBuild
191+
186192
export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$src//
187193
export ASDF_OUTPUT_TRANSLATIONS="$src:$(pwd):${storeDir}:${storeDir}"
188194
${pkg}/bin/${program} ${toString flags} < $buildScript
195+
196+
runHook postBuild
189197
'';
190198

191199
# Copy compiled files to store
@@ -200,13 +208,17 @@ let
200208
concatMapStringsSep "\\|" (replaceStrings ["." "+"] ["[.]" "[+]"]) systems;
201209
in
202210
''
211+
runHook preInstall
212+
203213
mkdir -pv $out
204214
cp -r * $out
205215
206216
# Remove all .asd files except for those in `systems`.
207217
find $out -name "*.asd" \
208218
| grep -v "/\(${mkSystemsRegex systems}\)\.asd$" \
209219
| xargs rm -fv || true
220+
221+
runHook postInstall
210222
'';
211223

212224
dontPatchShebangs = true;

pkgs/development/lisp-modules/packages.nix

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,29 @@ let
2828
build = (build-asdf-system (args' // { version = args'.version + "-build"; }))
2929
.overrideAttrs(o: {
3030
buildPhase = with builtins; ''
31+
runHook preBuild
32+
3133
mkdir __fasls
3234
export ASDF_OUTPUT_TRANSLATIONS="$(pwd):$(pwd)/__fasls:${storeDir}:${storeDir}"
3335
export CL_SOURCE_REGISTRY=$CL_SOURCE_REGISTRY:$(pwd)//
3436
${o.pkg}/bin/${o.program} ${toString (o.flags or [])} < ${o.buildScript}
37+
38+
runHook postBuild
3539
'';
3640
installPhase = ''
41+
runHook preInstall
42+
3743
mkdir -pv $out
3844
rm -rf __fasls
3945
cp -r * $out
46+
47+
runHook postInstall
4048
'';
4149
});
4250
in build-asdf-system (args' // {
4351
# Patches are already applied in `build`
4452
patches = [];
53+
postPatch = "";
4554
src = build;
4655
});
4756

@@ -151,9 +160,15 @@ let
151160
cephes = build-with-compile-into-pwd {
152161
inherit (super.cephes) pname version src lispLibs;
153162
patches = [ ./patches/cephes-make.patch ];
163+
postPatch = ''
164+
find \( -name '*.dll' -o -name '*.dylib' -o -name '*.so' \) -delete
165+
'';
154166
postConfigure = ''
155167
substituteAllInPlace cephes.asd
156168
'';
169+
postInstall = ''
170+
find $out -name '*.o' -delete
171+
'';
157172
};
158173

159174
clx-truetype = build-asdf-system {
Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
11
--- a/cephes.asd
22
+++ b/cephes.asd
3-
@@ -5,7 +5,7 @@
4-
(defclass makefile (source-file) ((type :initform "m")))
5-
(defmethod perform ((o load-op) (c makefile)) t)
6-
(defmethod perform ((o compile-op) (c makefile))
7-
- (let* ((lib-dir (system-relative-pathname "cephes" "scipy-cephes"))
8-
+ (let* ((lib-dir #P"@out@/scipy-cephes")
9-
(lib (make-pathname :directory `(:relative ,(namestring lib-dir))
10-
:name "libmd"
11-
:type #+darwin "dylib" #+(and unix (not darwin)) "so" #+(or windows win32) "dll"))
12-
@@ -14,7 +14,7 @@
13-
(format *error-output* "Library ~S exists, skipping build" lib)
14-
(format *error-output* "Building ~S~%" lib))
15-
(unless built
16-
- (chdir (native-namestring lib-dir))
17-
+ (chdir "scipy-cephes")
18-
(run-program "make" :output t))))
3+
@@ -16,7 +16,7 @@
4+
(defclass makefile (source-file) ((type :initform "m")))
5+
(defmethod perform ((o load-op) (c makefile)) t)
6+
(defmethod perform ((o compile-op) (c makefile))
7+
- (let* ((lib-dir (system-relative-pathname "cephes" "scipy-cephes/"))
8+
+ (let* ((lib-dir #P"@out@/scipy-cephes/")
9+
(lib (make-pathname :directory (pathname-directory lib-dir)
10+
:name #+(or (and unix (not darwin)) windows win32) "libmd"
11+
#+(and darwin arm64) "libmd-arm64"
12+
@@ -30,7 +30,7 @@
13+
(format *error-output* "Library ~S exists, skipping build" lib)
14+
(format *error-output* "Building ~S~%" lib))
15+
(unless built
16+
- (chdir (native-namestring lib-dir))
17+
+ (chdir "scipy-cephes")
18+
(run-program "make" :output t)))))
1919

2020
(defsystem "cephes"
2121

22-
Diff finished. Thu Mar 28 08:13:30 2024

0 commit comments

Comments
 (0)