1 {pkgs, clwrapper, quicklisp-to-nix-packages}:
3 addNativeLibs = libs: x: { propagatedBuildInputs = libs; };
5 overrides = y: ((x.overrides y) // { buildPhase = "true"; });
7 multiOverride = l: x: pkgs.lib.optionalAttrs (l != []) (((builtins.head l) x) // (multiOverride (builtins.tail l) x));
8 lispName = (clwrapper.lisp.pname or (builtins.parseDrvName clwrapper.lisp.name).name);
9 ifLispIn = l: f: if (pkgs.lib.elem lispName l) then f else (x: {});
10 ifLispNotIn = l: f: if ! (pkgs.lib.elem lispName l) then f else (x: {});
11 extraLispDeps = l: x: { deps = x.deps ++ l; };
15 overrides = y: (x.overrides y) // {
18 export configureFlags="$configureFlags --with-$NIX_LISP=common-lisp.sh";
21 export NIX_LISP_PRELAUNCH_HOOK="nix_lisp_build_system stumpwm \
22 '(function stumpwm:stumpwm)' '$linkedSystems'"
23 "$out/bin/stumpwm-lisp-launcher.sh"
25 cp "$out/lib/common-lisp/stumpwm/stumpwm" "$out/bin"
29 iterate = multiOverride [ skipBuildPhase
30 (ifLispNotIn ["sbcl" "gcl"] (x: { parasites=[]; }))];
32 propagatedBuildInputs = [pkgs.fuse];
33 overrides = y : (x.overrides y) // {
35 export makeFlags="$makeFlags LISP=common-lisp.sh"
39 mkdir -p "$out/lib/common-lisp/"
40 cp -r . "$out/lib/common-lisp/cl-fuse/"
41 "gcc" "-x" "c" "$out/lib/common-lisp/cl-fuse/fuse-launcher.c-minus" "-fPIC" "--shared" "-lfuse" "-o" "$out/lib/common-lisp/cl-fuse/libfuse-launcher.so"
45 hunchentoot = addNativeLibs [pkgs.openssl];
47 propagatedBuildInputs = (x.propagatedBuildInputs or [])
48 ++ (with pkgs; [libfixposix gcc])
50 overrides = y: (x.overrides y) // {
52 sed 's|default \"libfixposix\"|default \"${pkgs.libfixposix}/lib/libfixposix\"|' -i src/syscalls/ffi-functions-unix.lisp
53 # Socket tests don't work because they try to access the internet
54 sed 's/(:file "sockets" :depends-on ("pkgdcl" "defsuites"))//' -i iolib.asd
59 cxml = skipBuildPhase;
60 wookie = addNativeLibs (with pkgs; [libuv openssl]);
61 lev = addNativeLibs [pkgs.libev];
62 cl_plus_ssl = x: rec {
63 propagatedBuildInputs = [pkgs.openssl];
64 overrides = y: (x.overrides y) // {
66 sed 's|libssl.so|${pkgs.lib.getLib pkgs.openssl}/lib/libssl.so|' -i src/reload.lisp
70 cl-colors = skipBuildPhase;
71 cl-libuv = addNativeLibs [pkgs.libuv];
72 cl-async-ssl = addNativeLibs [pkgs.openssl (import ./openssl-lib-marked.nix)];
73 cl-async-test = addNativeLibs [pkgs.openssl];
74 clsql = multiOverride [ (x: {
75 propagatedBuildInputs = with pkgs; [libmysqlclient postgresql sqlite zlib];
76 overrides = y: (x.overrides y) // {
77 preConfigure = ((x.overrides y).preConfigure or "") + ''
78 export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.libmysqlclient}/include/mysql"
79 export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.libmysqlclient}/lib/mysql"
81 (ifLispIn ["ecl" "clisp"] (x: {
82 deps = pkgs.lib.filter (x: x.outPath != quicklisp-to-nix-packages.uffi.outPath)
83 (x.deps ++ (with quicklisp-to-nix-packages; [cffi-uffi-compat]));
84 overrides = y: (x.overrides y) // {
86 sed -e '1i(cl:push :clsql-cffi cl:*features*)' -i "$sourceRoot/clsql.asd"
91 clsql-postgresql-socket = ifLispIn ["ecl" "clisp"] (x: {
92 deps = pkgs.lib.filter (x: x.outPath != quicklisp-to-nix-packages.uffi.outPath)
93 (x.deps ++ (with quicklisp-to-nix-packages; [cffi-uffi-compat]));
94 overrides = y: (x.overrides y) // {
96 sed -e '1i(cl:push :clsql-cffi cl:*features*)' -i "$sourceRoot/clsql-postgresql-socket.asd"
100 clx-truetype = skipBuildPhase;
102 overrides = y: (x.overrides y) // {
104 postInstall = ((x.overrides y).postInstall or "") + ''
105 export NIX_LISP_ASDF_PATHS="$NIX_LISP_ASDF_PATHS
106 $out/lib/common-lisp/query-fs"
108 export NIX_LISP_PRELAUNCH_HOOK="nix_lisp_build_system query-fs \
109 '(function query-fs:run-fs-with-cmdline-args)' '$linkedSystems'"
110 "$out/bin/query-fs-lisp-launcher.sh"
111 cp "$out/lib/common-lisp/query-fs/query-fs" "$out/bin/"
115 cffi = addNativeLibs [pkgs.libffi];
117 propagatedBuildInputs = [pkgs.libmysqlclient];
118 overrides = y: (x.overrides y) // {
119 prePatch = ((x.overrides y).prePatch or "") + ''
120 sed -i 's,libmysqlclient_r,${pkgs.libmysqlclient}/lib/mysql/libmysqlclient_r,' system.lisp
124 cl-ppcre-template = x: {
125 overrides = y: (x.overrides y) // {
127 ln -s lib-dependent/*.asd .
132 propagatedBuildInputs = [pkgs.sqlite];
133 overrides = y: (x.overrides y) // {
134 prePatch = ((x.overrides y).preConfigure or "") + ''
135 sed 's|libsqlite3|${pkgs.sqlite.out}/lib/libsqlite3|' -i sqlite-ffi.lisp
140 overrides = y: (x.overrides y) // {
143 --- swank-loader.lisp 2017-08-30 16:46:16.554076684 -0700
144 +++ swank-loader-new.lisp 2017-08-30 16:49:23.333450928 -0700
147 (user-homedir-pathname)))
149 -(defvar *fasl-directory* (default-fasl-dir)
150 +(defvar *fasl-directory* #P"$out/lib/common-lisp/swank/fasl/"
151 "The directory where fasl files should be placed.")
153 (defun binary-pathname (src-pathname binary-dir)
155 (contrib-dir src-dir))))
157 (defun delete-stale-contrib-fasl-files (swank-files contrib-files fasl-dir)
158 - (let ((newest (reduce #'max (mapcar #'file-write-date swank-files))))
159 - (dolist (src contrib-files)
160 - (let ((fasl (binary-pathname src fasl-dir)))
161 - (when (and (probe-file fasl)
162 - (<= (file-write-date fasl) newest))
163 - (delete-file fasl))))))
164 + (declare (ignore swank-files contrib-files fasl-dir)))
166 (defun compile-contribs (&key (src-dir (contrib-dir *source-directory*))
167 (fasl-dir (contrib-dir *fasl-directory*))
173 overrides = y: (x.overrides y) // {
174 postInstall = ((x.overrides y).postInstall or "") + ''
175 cp -r "${pkgs.asdf}/lib/common-lisp/asdf/uiop/contrib" "$out/lib/common-lisp/uiop"
180 overrides = y: (x.overrides y) // {
181 postConfigure = "rm GNUmakefile";
184 mssql = addNativeLibs [pkgs.freetds];
185 cl-unification = x: {
186 asdFilesToKeep = (x.asdFilesToKeep or []) ++ [
187 "cl-unification-lib.asd"
191 deps = with quicklisp-to-nix-packages; [
195 # Needs pomo? Wants to do queries unconditionally?
196 # "simple-date/tests"
200 deps = pkgs.lib.filter (x: x.outPath != quicklisp-to-nix-packages.simple-date.outPath) x.deps;
201 parasites = (x.parasites or []) ++ [
202 "simple-date" "simple-date/postgres-glue"
204 asdFilesToKeep = x.asdFilesToKeep ++ ["simple-date.asd"];
207 deps = pkgs.lib.filter (x: x.name != quicklisp-to-nix-packages.buildnode-xhtml.name) x.deps;
208 parasites = pkgs.lib.filter (x: x!= "buildnode-test") x.parasites;
211 asdFilesToKeep = (x.asdFilesToKeep or []) ++ ["postmodern.asd" "simple-date.asd"];
212 parasites = (pkgs.lib.filter (x: x!= "postmodern/tests") x.parasites) ++
213 ["simple-date/postgres-glue"];
214 deps = pkgs.lib.filter
215 (x: x.name != quicklisp-to-nix-packages.simple-date.name)
219 parasites = pkgs.lib.filter (x: x!= "s-sql/tests") x.parasites;
220 deps = pkgs.lib.filter
221 (x: x.name != quicklisp-to-nix-packages.postmodern.name)
224 split-sequence = x: {
225 overrides = y: (x.overrides y) // {
227 sed -i -e '/:components/i:serial t' split-sequence.asd
232 overrides = y: (x.overrides y) // {
234 sed -i -e 's/:initform "Unknown" /:initform #:|Unknown| /' backends.lisp
240 deps = pkgs.lib.filter
243 x.name != quicklisp-to-nix-packages.dbd-mysql.name &&
244 x.name != quicklisp-to-nix-packages.dbd-postgres.name &&
245 x.name != quicklisp-to-nix-packages.dbd-sqlite3.name &&
246 x.name != quicklisp-to-nix-packages.dbi-test.name &&
250 cl-cffi-gtk-glib = addNativeLibs [pkgs.glib];
251 cl-cffi-gtk-gdk-pixbuf = addNativeLibs [pkgs.gdk-pixbuf];
252 cl-cffi-gtk-cairo = addNativeLibs [pkgs.cairo];
253 cl-cffi-gtk-pango = addNativeLibs [pkgs.pango];
254 cl-cffi-gtk-gdk = addNativeLibs [pkgs.gtk3];
255 cl-cffi-gtk-gtk3 = addNativeLibs [pkgs.gtk3];
256 cl-webkit2 = addNativeLibs [pkgs.webkitgtk];
258 overrides = y: (x.overrides y) // {
260 export NIX_LISP_PRELAUNCH_HOOK="nix_lisp_build_system clfswm '(function clfswm:main)'"
261 "$out/bin/clfswm-lisp-launcher.sh"
263 cp "$out/lib/common-lisp/clfswm/clfswm" "$out/bin"
267 woo = ifLispNotIn ["sbcl" "gcl"]
268 (extraLispDeps (with quicklisp-to-nix-packages; [cl-speedy-queue]));
270 overrides = y: (x.overrides y) // {
272 sed -e '1a:serial t' -i $sourceRoot/cl-syslog.asd
276 log4cl = ifLispNotIn ["sbcl" "gcl"]
277 (extraLispDeps (with quicklisp-to-nix-packages; [cl-syslog]));
278 md5 = ifLispNotIn ["sbcl" "ccl" "gcl"]
279 (extraLispDeps (with quicklisp-to-nix-packages; [flexi-streams]));
280 cl-gobject-introspection = addNativeLibs (with pkgs; [glib gobject-introspection]);
281 generic-cl = x: { parasites = []; };
282 static-dispatch = x: {
283 overrides = y: (x.overrides y) // {
285 # workaround for https://github.com/alex-gutev/static-dispatch/issues/12
287 sed -e '/^(in-package / a (eval-when (:compile-toplevel :load-toplevel :execute)' \
289 -i $sourceRoot/src/combin.lisp
293 lla = addNativeLibs [ pkgs.openblas ];
294 # cl-opengl = addNativeLibs [ pkgs.libGL pkgs.glfw ];