diff options
Diffstat (limited to 'pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix')
-rw-r--r-- | pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix | 123 |
1 files changed, 92 insertions, 31 deletions
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix index 909ddc5d1a9..dbc57cb8d1f 100644 --- a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix +++ b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix @@ -1,4 +1,4 @@ -{pkgs, quicklisp-to-nix-packages}: +{pkgs, clwrapper, quicklisp-to-nix-packages}: let addNativeLibs = libs: x: { propagatedBuildInputs = libs; }; skipBuildPhase = x: { @@ -6,6 +6,10 @@ let }; multiOverride = l: x: if l == [] then {} else ((builtins.head l) x) // (multiOverride (builtins.tail l) x); + lispName = (clwrapper.lisp.pname or (builtins.parseDrvName clwrapper.lisp.name).name); + ifLispIn = l: f: if (pkgs.lib.elem lispName l) then f else (x: {}); + ifLispNotIn = l: f: if ! (pkgs.lib.elem lispName l) then f else (x: {}); + extraLispDeps = l: x: { deps = x.deps ++ l; }; in { stumpwm = x:{ @@ -23,7 +27,8 @@ in ''; }; }; - iterate = skipBuildPhase; + iterate = multiOverride [ skipBuildPhase + (ifLispNotIn ["sbcl" "gcl"] (x: { parasites=[]; }))]; cl-fuse = x: { propagatedBuildInputs = [pkgs.fuse]; overrides = y : (x.overrides y) // { @@ -32,9 +37,9 @@ in ''; preInstall = '' type gcc - mkdir -p "$out/lib/common-lisp/" + mkdir -p "$out/lib/common-lisp/" cp -r . "$out/lib/common-lisp/cl-fuse/" - "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" + "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" ''; }; }; @@ -65,15 +70,32 @@ in cl-libuv = addNativeLibs [pkgs.libuv]; cl-async-ssl = addNativeLibs [pkgs.openssl (import ./openssl-lib-marked.nix)]; cl-async-test = addNativeLibs [pkgs.openssl]; - clsql = x: { + clsql = multiOverride [ (x: { propagatedBuildInputs = with pkgs; [libmysqlclient postgresql sqlite zlib]; overrides = y: (x.overrides y) // { preConfigure = ((x.overrides y).preConfigure or "") + '' export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pkgs.libmysqlclient}/include/mysql" export NIX_LDFLAGS="$NIX_LDFLAGS -L${pkgs.libmysqlclient}/lib/mysql" - ''; - }; - }; + '';};}) + (ifLispIn ["ecl" "clisp"] (x: { + deps = pkgs.lib.filter (x: x.outPath != quicklisp-to-nix-packages.uffi.outPath) + (x.deps ++ (with quicklisp-to-nix-packages; [cffi-uffi-compat])); + overrides = y: (x.overrides y) // { + postUnpack = '' + sed -e '1i(cl:push :clsql-cffi cl:*features*)' -i "$sourceRoot/clsql.asd" + ''; + }; + })) + ]; + clsql-postgresql-socket = ifLispIn ["ecl" "clisp"] (x: { + deps = pkgs.lib.filter (x: x.outPath != quicklisp-to-nix-packages.uffi.outPath) + (x.deps ++ (with quicklisp-to-nix-packages; [cffi-uffi-compat])); + overrides = y: (x.overrides y) // { + postUnpack = '' + sed -e '1i(cl:push :clsql-cffi cl:*features*)' -i "$sourceRoot/clsql-postgresql-socket.asd" + ''; + }; + }); clx-truetype = skipBuildPhase; query-fs = x: { overrides = y: (x.overrides y) // { @@ -81,7 +103,7 @@ in postInstall = ((x.overrides y).postInstall or "") + '' export NIX_LISP_ASDF_PATHS="$NIX_LISP_ASDF_PATHS $out/lib/common-lisp/query-fs" - export HOME=$PWD + export HOME=$PWD export NIX_LISP_PRELAUNCH_HOOK="nix_lisp_build_system query-fs \ '(function query-fs:run-fs-with-cmdline-args)' '$linkedSystems'" "$out/bin/query-fs-lisp-launcher.sh" @@ -105,18 +127,6 @@ $out/lib/common-lisp/query-fs" ''; }; }; - serapeum = x: { - overrides = y: (x.overrides y) //{ - # Override src until quicklisp catches up to 65837f8 (see serapeum - # issue #42) - src = pkgs.fetchFromGitHub { - owner = "ruricolist"; - repo = "serapeum"; - rev = "65837f8a0d65b36369ec8d000fff5c29a395b5fe"; - sha256 = "0clwf81r2lvk1rbfvk91s9zmbkas9imf57ilqclw12mxaxlfsnbw"; - }; - }; - }; sqlite = x: { propagatedBuildInputs = [pkgs.sqlite]; overrides = y: (x.overrides y) // { @@ -134,15 +144,15 @@ $out/lib/common-lisp/query-fs" @@ -155,7 +155,7 @@ ,(unique-dir-name))) (user-homedir-pathname))) - + -(defvar *fasl-directory* (default-fasl-dir) +(defvar *fasl-directory* #P"$out/lib/common-lisp/swank/fasl/" "The directory where fasl files should be placed.") - + (defun binary-pathname (src-pathname binary-dir) @@ -277,12 +277,7 @@ (contrib-dir src-dir)))) - + (defun delete-stale-contrib-fasl-files (swank-files contrib-files fasl-dir) - (let ((newest (reduce #'max (mapcar #'file-write-date swank-files)))) - (dolist (src contrib-files) @@ -151,7 +161,7 @@ $out/lib/common-lisp/query-fs" - (<= (file-write-date fasl) newest)) - (delete-file fasl)))))) + (declare (ignore swank-files contrib-files fasl-dir))) - + (defun compile-contribs (&key (src-dir (contrib-dir *source-directory*)) (fasl-dir (contrib-dir *fasl-directory*)) EOD @@ -159,9 +169,6 @@ $out/lib/common-lisp/query-fs" }; }; uiop = x: { - parasites = (x.parasites or []) ++ [ - "uiop/version" - ]; overrides = y: (x.overrides y) // { postInstall = ((x.overrides y).postInstall or "") + '' cp -r "${pkgs.asdf}/lib/common-lisp/asdf/uiop/contrib" "$out/lib/common-lisp/uiop" @@ -200,9 +207,18 @@ $out/lib/common-lisp/query-fs" parasites = pkgs.lib.filter (x: x!= "buildnode-test") x.parasites; }; postmodern = x: { - overrides = y : (x.overrides y) // { - meta.broken = true; # 2018-04-10 - }; + asdFilesToKeep = (x.asdFilesToKeep or []) ++ ["postmodern.asd" "simple-date.asd"]; + parasites = (pkgs.lib.filter (x: x!= "postmodern/tests") x.parasites) ++ + ["simple-date/postgres-glue"]; + deps = pkgs.lib.filter + (x: x.name != quicklisp-to-nix-packages.simple-date.name) + x.deps; + }; + s-sql = x: { + parasites = pkgs.lib.filter (x: x!= "s-sql/tests") x.parasites; + deps = pkgs.lib.filter + (x: x.name != quicklisp-to-nix-packages.postmodern.name) + x.deps; }; split-sequence = x: { overrides = y: (x.overrides y) // { @@ -218,4 +234,49 @@ $out/lib/common-lisp/query-fs" ''; }; }; + dbi = x: { + parasites = []; + deps = pkgs.lib.filter + (x: + ( + x.name != quicklisp-to-nix-packages.dbd-mysql.name && + x.name != quicklisp-to-nix-packages.dbd-postgres.name && + x.name != quicklisp-to-nix-packages.dbd-sqlite3.name && + x.name != quicklisp-to-nix-packages.dbi-test.name && + true)) + x.deps; + }; + cl-cffi-gtk-glib = addNativeLibs [pkgs.glib]; + cl-cffi-gtk-gdk-pixbuf = addNativeLibs [pkgs.gdk-pixbuf]; + cl-cffi-gtk-cairo = addNativeLibs [pkgs.cairo]; + cl-cffi-gtk-pango = addNativeLibs [pkgs.pango]; + cl-cffi-gtk-gdk = addNativeLibs [pkgs.gtk3]; + cl-cffi-gtk-gtk3 = addNativeLibs [pkgs.gtk3]; + cl-webkit2 = addNativeLibs [pkgs.webkitgtk]; + clfswm = x: { + overrides = y: (x.overrides y) // { + postInstall = '' + export NIX_LISP_PRELAUNCH_HOOK="nix_lisp_build_system clfswm '(function clfswm:main)'" + "$out/bin/clfswm-lisp-launcher.sh" + + cp "$out/lib/common-lisp/clfswm/clfswm" "$out/bin" + ''; + }; + }; + woo = ifLispNotIn ["sbcl" "gcl"] + (extraLispDeps (with quicklisp-to-nix-packages; [cl-speedy-queue])); + cl-syslog = x: { + overrides = y: (x.overrides y) // { + postUnpack = '' + sed -e '1a:serial t' -i $sourceRoot/cl-syslog.asd + ''; + }; + }; + log4cl = ifLispNotIn ["sbcl" "gcl"] + (extraLispDeps (with quicklisp-to-nix-packages; [cl-syslog])); + md5 = ifLispNotIn ["sbcl" "ccl" "gcl"] + (extraLispDeps (with quicklisp-to-nix-packages; [flexi-streams])); + cl-gobject-introspection = addNativeLibs (with pkgs; [glib gobject-introspection]); + generic-cl = x: { parasites = []; }; + static-dispatch = x: { parasites = []; }; } |