push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchurl,
texinfo,
texLive,
perl,
}:
stdenv.mkDerivation rec {
pname = "asdf";
version = "2.26";
src = fetchurl {
url = "http://common-lisp.net/project/asdf/archives/asdf-${version}.tar.gz";
sha256 = "sha256-tuUuIlZcS+a0izXeJl3Ckp+/PYAWkZ0+Cw7blwkh9+M=";
};
strictDeps = true;
nativeBuildInputs = [
texinfo
texLive
perl
];
buildPhase = ''
make asdf.lisp
mkdir build
ln -s ../asdf.lisp build
'';
installPhase = ''
mkdir -p "$out"/lib/common-lisp/asdf/
mkdir -p "$out"/share/doc/asdf/
cp -r ./* "$out"/lib/common-lisp/asdf/
cp -r doc/* "$out"/share/doc/asdf/
'';
meta = with lib; {
description = "Standard software-system definition library for Common Lisp";
homepage = "https://asdf.common-lisp.dev/";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchurl,
texinfo,
texLive,
perl,
}:
stdenv.mkDerivation rec {
pname = "asdf";
version = "3.1.7";
src = fetchurl {
url = "http://common-lisp.net/project/asdf/archives/asdf-${version}.tar.gz";
sha256 = "sha256-+P+FLM1mr2KRdj7bfhWq4ync86bJS/uE0Jm/E/e4HL0=";
};
strictDeps = true;
nativeBuildInputs = [
texinfo
texLive
perl
];
buildPhase = ''
make build/asdf.lisp
make -C doc asdf.info asdf.html
'';
installPhase = ''
mkdir -p "$out"/lib/common-lisp/asdf/
mkdir -p "$out"/share/doc/asdf/
cp -r ./* "$out"/lib/common-lisp/asdf/
cp -r doc/* "$out"/share/doc/asdf/
ln -s "$out"/lib/common-lisp/{asdf/uiop,uiop}
'';
meta = with lib; {
description = "Standard software-system definition library for Common Lisp";
homepage = "https://asdf.common-lisp.dev/";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,54 @@
{
lib,
stdenv,
fetchurl,
fetchpatch,
texinfo,
texLive,
perl,
}:
stdenv.mkDerivation rec {
pname = "asdf";
version = "3.3.6";
src = fetchurl {
url = "http://common-lisp.net/project/asdf/archives/asdf-${version}.tar.gz";
sha256 = "sha256-NkjvNlLqJnBAfOxC9ECTtmuS5K+0v5ZXOw2xt8l7vgk=";
};
patches = [
# Clasp bytecode support
(fetchpatch {
url = "https://github.com/clasp-developers/asdf/compare/fe6e3ab741c71ecebc8503e20637d4c940326421..615771b3d0ee6ebb158134769e88ba421c2ea7d1.diff";
hash = "sha256-jrv/vH4uxLVvaCK4UicNzIePQ12lscA0auwgTMb4QwI=";
})
];
strictDeps = true;
nativeBuildInputs = [
texinfo
texLive
perl
];
buildPhase = ''
make build/asdf.lisp
make -C doc asdf.info asdf.html
'';
installPhase = ''
mkdir -p "$out"/lib/common-lisp/asdf/
mkdir -p "$out"/share/doc/asdf/
cp -r ./* "$out"/lib/common-lisp/asdf/
cp -r doc/* "$out"/share/doc/asdf/
ln -s "$out"/lib/common-lisp/{asdf/uiop,uiop}
'';
meta = with lib; {
description = "Standard software-system definition library for Common Lisp";
homepage = "https://asdf.common-lisp.dev/";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,45 @@
{
lib,
stdenv,
fetchurl,
texinfo,
texLive,
perl,
}:
stdenv.mkDerivation rec {
pname = "asdf";
version = "3.3.4";
src = fetchurl {
url = "http://common-lisp.net/project/asdf/archives/asdf-${version}.tar.gz";
sha256 = "sha256-/k7cmN0ymZUgpP4K+IWfhq85TkzfPjTR4QdUgV9n1x4=";
};
strictDeps = true;
nativeBuildInputs = [
texinfo
texLive
perl
];
buildPhase = ''
make build/asdf.lisp
make -C doc asdf.info asdf.html
'';
installPhase = ''
mkdir -p "$out"/lib/common-lisp/asdf/
mkdir -p "$out"/share/doc/asdf/
cp -r ./* "$out"/lib/common-lisp/asdf/
cp -r doc/* "$out"/share/doc/asdf/
ln -s "$out"/lib/common-lisp/{asdf/uiop,uiop}
'';
meta = with lib; {
description = "Standard software-system definition library for Common Lisp";
homepage = "https://asdf.common-lisp.dev/";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.unix;
};
}

View File

@@ -0,0 +1,18 @@
(defpackage :nix-cl-user
(:use :cl))
(in-package :nix-cl-user)
(load "@asdf@")
(defun load-systems ()
(handler-case
(let ((systems (uiop:getenv "systems")))
(dolist (s (uiop:split-string systems :separator " "))
(asdf:load-system s)))
(error (c)
(format t "BUILD FAILED: ~A~%" c)
(uiop:quit 1)))
(uiop:quit 0))
(load-systems)

View File

@@ -0,0 +1,18 @@
(defpackage org.lispbuilds.nix/api
(:documentation "Public interface of org.lispbuilds.nix")
(:use :cl)
(:export
:import-lisp-packages
:database->nix-expression))
(in-package org.lispbuilds.nix/api)
(defgeneric import-lisp-packages (repository database)
(:documentation
"Import Lisp packages (ASDF systems) from repository (Quicklisp,
Ultralisp etc.) into a package database."))
(defgeneric database->nix-expression (database outfile)
(:documentation
"Generate a nix expression from the package database and write it
into outfile."))

View File

@@ -0,0 +1,175 @@
(defpackage org.lispbuilds.nix/database/sqlite
(:use :cl)
(:import-from :str)
(:import-from :sqlite)
(:import-from :alexandria :read-file-into-string)
(:import-from :alexandria-2 :line-up-first)
(:import-from :arrow-macros :->>)
(:import-from
:org.lispbuilds.nix/util
:replace-regexes)
(:import-from
:org.lispbuilds.nix/nix
:nix-eval
:nixify-symbol
:system-master
:make-pname
:*nix-attrs-depth*)
(:import-from
:org.lispbuilds.nix/api
:database->nix-expression)
(:export :sqlite-database :init-db)
(:local-nicknames
(:hydra :org.lispbuilds.nix/hydra)
(:json :com.inuoe.jzon)))
(in-package org.lispbuilds.nix/database/sqlite)
(defclass sqlite-database ()
((url :initarg :url
:reader database-url
:initform (error "url required"))
(init-file :initarg :init-file
:reader init-file
:initform (error "init file required"))))
(defun init-db (db init-file)
(let ((statements (->> (read-file-into-string init-file)
(replace-regexes '(".*--.*") '(""))
(substitute #\Space #\Newline)
(str:collapse-whitespaces)
(str:split #\;)
(mapcar #'str:trim)
(remove-if #'str:emptyp))))
(sqlite:with-transaction db
(dolist (s statements)
(sqlite:execute-non-query db s)))))
;; Writing Nix
(defparameter prelude "
# This file was auto-generated by nix-quicklisp.lisp
{ runCommand, pkgs, lib, fetchzip, build-asdf-system, ... }:
let
inherit (builtins) getAttr;
# Ensures that every non-slashy `system` exists in a unique .asd file.
# (Think cl-async-base being declared in cl-async.asd upstream)
#
# This is required because we're building and loading a system called
# `system`, not `asd`, so otherwise `system` would not be loadable
# without building and loading `asd` first.
#
createAsd = { url, sha256, asd, system }:
let
src = fetchzip { inherit url sha256; };
in
if asd == system
then src
else runCommand \"source\" {} ''
mkdir -pv $out
cp -r ${src}/* $out
find $out -name \"${asd}.asd\" | while read f; do mv -fv $f $(dirname $f)/${system}.asd || true; done
'';
in lib.makeScope pkgs.newScope (self: {")
;; Random compilation errors
(defparameter +broken-packages+
(list
;; no dispatch function defined for #\t
"hu.dwim.logger"
"hu.dwim.serializer"
"hu.dwim.quasi-quote"
;; Tries to write in $HOME
"ubiquitous"
;; Upstream bad packaging, multiple systems in clml.blas.asd
"clml.blas.hompack"
;; Fails on SBCL due to heap exhaustion
"magicl"
;; Missing dependency on c2ffi cffi extension
"hu.dwim.zlib"
;; These require libRmath.so, but I don't know where to get it from
"cl-random"
"cl-random-tests"
))
(defmethod database->nix-expression ((database sqlite-database) outfile)
(sqlite:with-open-database (db (database-url database))
(with-open-file (f outfile
:direction :output
:if-exists :supersede)
;; Fix known problematic packages before dumping the nix file.
(sqlite:execute-non-query db
"create temp table fixed_systems as select * from system_view")
(sqlite:execute-non-query db
"alter table fixed_systems add column systems")
(sqlite:execute-non-query db
"update fixed_systems set systems = json_array(name)")
(sqlite:execute-non-query db
"alter table fixed_systems add column asds")
(sqlite:execute-non-query db
"update fixed_systems set asds = json_array(name)")
(sqlite:execute-non-query db
"delete from fixed_systems where name in ('asdf', 'uiop')")
(sqlite:execute-non-query db
"delete from fixed_systems where instr(name, '/')")
(format f prelude)
(dolist (p (sqlite:execute-to-list db "select * from fixed_systems"))
(destructuring-bind (name version asd url sha256 deps systems asds) p
(format f "~% ")
(let ((*nix-attrs-depth* 1))
(format
f
"~a = ~a;"
(nix-eval `(:symbol ,name))
(nix-eval
`(:funcall
"build-asdf-system"
(:attrs
("pname" (:string ,(make-pname name)))
("version" (:string ,version))
("asds" (:list
,@(mapcar (lambda (asd)
`(:string ,(system-master asd)))
(coerce (json:parse asds) 'list))))
("src" (:funcall
"createAsd"
(:attrs
("url" (:string ,url))
("sha256" (:string ,sha256))
("system" (:string ,(system-master name)))
("asd" (:string ,asd)))))
("systems" (:list
,@(mapcar (lambda (sys)
`(:string ,sys))
(coerce (json:parse systems) 'list))))
("lispLibs" (:list
,@(mapcar (lambda (dep)
`(:funcall
"getAttr"
(:string ,(nixify-symbol dep))
(:symbol "self")))
(line-up-first
(str:split-omit-nulls #\, deps)
(set-difference '("asdf" "uiop") :test #'string=)
(sort #'string<)))))
("meta" (:attrs
,@(when (or (find #\/ name)
(find name +broken-packages+ :test #'string=))
'(("broken" (:symbol "true"))))
,@(unless (find name hydra:+allowlist+ :test #'string=)
'(("hydraPlatforms" (:list)))))))))))))
(format f "~%})~%"))))

View File

@@ -0,0 +1,416 @@
(defpackage org.lispbuilds.nix/hydra
(:documentation "List of packages allowed to be build on Hydra")
(:use :cl)
(:export
:+allowlist+))
(in-package org.lispbuilds.nix/hydra)
(defparameter +allowlist+
(list
"_1am"
"_3bmd"
"_3bmd-ext-code-blocks"
"access"
"acclimation"
"agutil"
"alexandria"
"anaphora"
"arnesi"
"array-operations"
"array-utils"
"arrows"
"asdf-package-system"
"asdf-system-connections"
"babel"
"binomial-heap"
"binpack"
"blackbird"
"bordeaux-threads"
"buildnode"
"buildnode-xhtml"
"calispel"
"cffi"
"cffi-grovel"
"cffi-toolchain"
"cffi-uffi-compat"
"chanl"
"check-it"
"chipz"
"chunga"
"circular-streams"
"cl-aa"
"cl-ana"
"cl-annot"
"cl-anonfun"
"cl-ansi-text"
"cl-async"
"cl-async-base"
"cl-async-repl"
"cl-async-ssl"
"cl-async-util"
"cl-avro"
"cl-base64"
"cl-cairo2"
"cl-cairo2"
"cl-cairo2-xlib"
"cl-cffi-gtk"
"cl-cffi-gtk-cairo"
"cl-cffi-gtk-gdk"
"cl-cffi-gtk-gdk-pixbuf"
"cl-cffi-gtk-gio"
"cl-cffi-gtk-glib"
"cl-cffi-gtk-gobject"
"cl-cffi-gtk-pango"
"cl-change-case"
"cl-cli"
"cl-colors"
"cl-colors2"
"cl-containers"
"cl-cookie"
"cl-css"
"cl-csv"
"cl-cuda"
"cl-custom-hash-table"
"cl-dbi"
"cl-difflib"
"cl-digraph"
"cl-dot"
"cl-emb"
"cl-environments"
"cl-fad"
"cl-form-types"
"cl-freetype2"
"cl-fuse"
"cl-fuse-meta-fs"
"cl-fuzz"
"cl-geometry"
"cl-gobject-introspection"
"cl-gtk2-gdk"
"cl-gtk2-glib"
"cl-gtk2-pango"
"cl-gtk4"
"cl-gtk4.adw"
"cl-gtk4.webkit2"
"cl-heap"
"cl-hooks"
"cl-html-diff"
"cl-html-parse"
"cl-html5-parser"
"cl-interpol"
"cl-jpeg"
"cl-json"
"cl-l10n"
"cl-l10n-cldr"
"cl-libuv"
"cl-libxml2"
"cl-libyaml"
"cl-locale"
"cl-markup"
"cl-mustache"
"cl-mysql"
"cl-num-utils"
"cl-pango"
"cl-paths"
"cl-paths-ttf"
"cl-pattern"
"cl-pdf"
"cl-postgres"
"cl-postgres+local-time"
"cl-ppcre"
"cl-ppcre-template"
"cl-ppcre-unicode"
"cl-prevalence"
"cl-qprint"
"cl-qrencode"
"cl-readline"
"cl-reexport"
"cl-rsvg2"
"cl-sat"
"cl-sat.glucose"
"cl-sat.minisat"
"cl-shellwords"
"cl-slice"
"cl-smt-lib"
"cl-smtp"
"cl-speedy-queue"
"cl-store"
"cl-svg"
"cl-syntax"
"cl-syntax-annot"
"cl-syntax-anonfun"
"cl-syntax-markup"
"cl-syslog"
"cl-test-more"
"cl-typesetting"
"cl-unicode"
"cl-unification"
"cl-utilities"
"cl-vectors"
"cl-webkit2"
"cl-who"
"cl-xmlspam"
"cl+ssl"
"clack"
"clack-socket"
"classowary"
"clfswm"
"closer-mop"
"closure-common"
"closure-html"
"clsql"
"clsql-postgresql"
"clsql-postgresql-socket"
"clsql-sqlite3"
"clsql-uffi"
"clss"
"cluffer"
"clump"
"clump-2-3-tree"
"clump-binary-tree"
"clunit"
"clunit2"
"clx"
"clx-truetype"
"collectors"
"colorize"
"com.inuoe.jzon"
"command-line-arguments"
"css-lite"
"css-selectors"
"css-selectors-simple-tree"
"css-selectors-stp"
"cxml"
"cxml-stp"
"data-table"
"dbd-mysql"
"dbd-postgres"
"dbd-sqlite3"
"dbi"
"dbi-test"
"dbus"
"defclass-std"
"dexador"
"dissect"
"djula"
"do-urlencode"
"documentation-utils"
"drakma"
"eager-future2"
"enchant"
"esrap"
"esrap-peg"
"external-program"
"fare-csv"
"fare-mop"
"fare-quasiquote"
"fare-quasiquote-extras"
"fare-quasiquote-optima"
"fare-quasiquote-readtable"
"fare-utils"
"fast-http"
"fast-io"
"fiasco"
"file-attributes"
"fiveam"
"flexi-streams"
"float-features"
"flow"
"fn"
"form-fiddle"
"fset"
"generic-cl"
"gettext"
"global-vars"
"glsl-docs"
"glsl-spec"
"glsl-symbols"
"gsll"
"heap"
"html-encode"
"http-body"
"hu.dwim.asdf"
"hu.dwim.common"
"hu.dwim.common-lisp"
"hu.dwim.def"
"hu.dwim.def+swank"
"hu.dwim.defclass-star"
"hu.dwim.stefil"
"hu.dwim.stefil+hu.dwim.def"
"hu.dwim.stefil+hu.dwim.def+swank"
"hu.dwim.stefil+swank"
"hunchensocket"
"hunchentoot"
"idna"
"ieee-floats"
"inferior-shell"
"introspect-environment"
"iolib"
"iolib.asdf"
"iolib.base"
"iolib.common-lisp"
"iolib.conf"
"ironclad"
"iterate"
"jonathan"
"jpl-queues"
"jpl-util"
"jsown"
"kmrcl"
"lack"
"lack-component"
"lack-middleware-backtrace"
"lack-util"
"lambda-fiddle"
"legit"
"let-plus"
"lev"
"lfarm-client"
"lfarm-common"
"lfarm-server"
"lfarm-ssl"
"lift"
"lisp-binary"
"lisp-namespace"
"lisp-unit"
"lisp-unit2"
"lla"
"local-time"
"log4cl"
"lparallel"
"lquery"
"ltk"
"marshal"
"md5"
"metabang-bind"
"metatilities-base"
"mgl"
"mgl-mat"
"mgl-pax"
"minheap"
"misc-extensions"
"mk-string-metrics"
"mmap"
"moptilities"
"more-conditions"
"mt19937"
"named-readtables"
"nbd"
"net-telent-date"
"net.didierverna.asdf-flv"
"nibbles"
"nyxt"
"optima"
"osicat"
"parachute"
"parenscript"
"parse-declarations-1.0"
"parse-float"
"parse-number"
"parseq"
"parser-combinators"
"parser.common-rules"
"pcall"
"pcall-queue"
"physical-quantities"
"plump"
"postmodern"
"proc-parse"
"prove"
"prove-asdf"
"ptester"
"puri"
"pythonic-string-reader"
"pzmq"
"pzmq-compat"
"pzmq-examples"
"pzmq-test"
"qt"
"qt-libs"
"qtools"
"quasiquote-2.0"
"query-fs"
"quri"
"rfc2388"
"rove"
"rt"
"s-sql"
"s-sysdeps"
"s-xml"
"salza2"
"serapeum"
"simple-date"
"simple-date-time"
"simple-inferiors"
"simple-tasks"
"slynk"
"smart-buffer"
"smug"
"spinneret"
"split-sequence"
"sqlite"
"static-dispatch"
"static-vectors"
"stefil"
"str"
"string-case"
"stumpwm"
"swank"
"swap-bytes"
"sycamore"
"symbol-munger"
"trees"
"trivia"
"trivia.balland2006"
"trivia.level0"
"trivia.level1"
"trivia.level2"
"trivia.quasiquote"
"trivia.trivial"
"trivial-arguments"
"trivial-backtrace"
"trivial-clipboard"
"trivial-cltl2"
"trivial-features"
"trivial-file-size"
"trivial-garbage"
"trivial-gray-streams"
"trivial-indent"
"trivial-macroexpand-all"
"trivial-main-thread"
"trivial-mimes"
"trivial-package-local-nicknames"
"trivial-package-manager"
"trivial-shell"
"trivial-types"
"trivial-utf-8"
"trivial-with-current-source-form"
"type-i"
"uax-15"
"uffi"
"unit-test"
"unix-options"
"unix-opts"
"usocket"
"usocket-server"
"utilities.print-items"
"utilities.print-tree"
"uuid"
"varjo"
"vas-string-metrics"
"vecto"
"vom"
"wild-package-inferred-system"
"woo"
"wookie"
"xembed"
"xkeyboard"
"xml.location"
"xmls"
"xpath"
"xsubseq"
"yacc"
"yason"
"zpb-ttf"
"zpng"
))

View File

@@ -0,0 +1,41 @@
CREATE TABLE IF NOT EXISTS sha256 (
id integer PRIMARY KEY AUTOINCREMENT,
url text UNIQUE,
hash text NOT NULL,
created real DEFAULT (julianday('now'))
);
CREATE TABLE IF NOT EXISTS system (
id integer PRIMARY KEY AUTOINCREMENT,
name text NOT NULL,
version text NOT NULL,
asd text NOT NULL,
created real DEFAULT (julianday('now')),
UNIQUE(name, version)
);
CREATE TABLE IF NOT EXISTS dep (
system_id integer NOT NULL REFERENCES system(id),
dep_id integer NOT NULL REFERENCES system(id),
PRIMARY KEY (system_id, dep_id)
);
CREATE TABLE IF NOT EXISTS src (
sha256_id integer REFERENCES sha256(id),
system_id integer UNIQUE REFERENCES system(id)
);
DROP VIEW IF EXISTS system_view;
CREATE VIEW IF NOT EXISTS system_view AS
SELECT
sys.name,
sys.version,
sys.asd,
sha.url,
sha.hash,
group_concat((SELECT name FROM system WHERE id = dep.dep_id)) as deps
FROM system sys
JOIN src ON src.system_id = sys.id
JOIN sha256 sha ON sha.id = src.sha256_id
LEFT JOIN dep ON dep.system_id = sys.id
GROUP BY sys.name;

View File

@@ -0,0 +1,59 @@
(defpackage org.lispbuilds.nix/main
(:use :common-lisp
:org.lispbuilds.nix/database/sqlite
:org.lispbuilds.nix/repository/quicklisp
:org.lispbuilds.nix/api)
(:local-nicknames
(:http :dexador)))
(in-package org.lispbuilds.nix/main)
(defun resource (name type)
(make-pathname
:defaults (asdf:system-source-directory :org.lispbuilds.nix)
:name name
:type type))
(defvar *sqlite*
(make-instance
'sqlite-database
:init-file (resource "init" "sql")
:url "packages.sqlite"))
(defvar *quicklisp* nil)
(defun get-quicklisp-version ()
(let ((response (http:get "http://beta.quicklisp.org/dist/quicklisp.txt")))
(subseq
(second (uiop:split-string response :separator '(#\Newline)))
9)))
(defun init-quicklisp ()
(setf *quicklisp*
(make-instance
'quicklisp-repository
:dist-url
(format nil
"https://beta.quicklisp.org/dist/quicklisp/~a/"
(get-quicklisp-version)))))
(defun run-importers ()
(ignore-errors (delete-file "packages.sqlite"))
(import-lisp-packages *quicklisp* *sqlite*)
(format t "Imported packages from quicklisp to ~A~%"
(truename "packages.sqlite")))
(defun gen-nix-file ()
(database->nix-expression *sqlite* "imported.nix")
(format t "Dumped nix file to ~a~%"
(truename "imported.nix")))
(defun run-nix-formatter ()
(uiop:run-program '("nixfmt" "imported.nix")))
(defun main ()
(format t "~%")
(init-quicklisp)
(run-importers)
(gen-nix-file)
(run-nix-formatter))

View File

@@ -0,0 +1,83 @@
(defpackage org.lispbuilds.nix/nix
(:documentation "Utilities for generating Nix code")
(:use :cl)
(:import-from :str)
(:import-from :ppcre)
(:import-from :arrow-macros :->>)
(:import-from :org.lispbuilds.nix/util :replace-regexes)
(:export
:nix-eval
:nixify-symbol
:system-master
:make-pname
:*nix-attrs-depth*))
(in-package org.lispbuilds.nix/nix)
;; Path names are alphanumeric and can include the symbols +-._?= and
;; must not begin with a period.
(defun make-pname (string)
(replace-regexes '("^[.]" "[^a-zA-Z0-9+-._?=]")
'("_" "_")
string))
(defun system-master (system)
(first (str:split "/" system)))
;;;; Nix generation
(defun nix-eval (exp)
(assert (consp exp))
(ecase (car exp)
(:string (nix-string (cadr exp)))
(:list (apply #'nix-list (rest exp)))
(:funcall (apply #'nix-funcall (rest exp)))
(:attrs (nix-attrs (cdr exp)))
(:merge (apply #'nix-merge (cdr exp)))
(:symbol (nix-symbol (cadr exp)))))
(defun nix-string (object)
(format nil "\"~a\"" object))
(defun nixify-symbol (string)
(flet ((fix-special-chars (str)
(replace-regexes '("[_]" "[+]$" "[+][/]" "[+]" "[.]" "[/]")
'("__" "_plus" "_plus/" "_plus_" "_dot_" "_slash_")
str)))
(if (ppcre:scan "^[0-9]" string)
(str:concat "_" (fix-special-chars string))
(fix-special-chars string))))
(defun nix-symbol (object)
(nixify-symbol (format nil "~a" object)))
(defun nix-list (&rest things)
(format nil "[ ~{~A~^ ~} ]" (mapcar 'nix-eval things)))
(defvar *nix-attrs-depth* 0)
(defun nix-attrs (keyvals)
(when (null keyvals)
(return-from nix-attrs "{}"))
(let ((*nix-attrs-depth* (1+ *nix-attrs-depth*)))
(format
nil
(->> "{~%*depth*~{~{~A = ~A;~}~^~%*depth*~}~%*depth-1*}"
(str:replace-all "*depth*" (str:repeat *nix-attrs-depth* " "))
(str:replace-all "*depth-1*" (str:repeat (1- *nix-attrs-depth*) " ")))
(mapcar (lambda (keyval)
(let ((key (car keyval))
(val (cadr keyval)))
(list (nix-symbol key)
(nix-eval val))))
keyvals))))
(defun nix-funcall (fun &rest args)
(format nil "(~a ~{~a~^ ~})"
(nixify-symbol fun)
(mapcar 'nix-eval args)))
(defun nix-merge (a b)
(format nil "(~a // ~b)"
(nix-eval a)
(nix-eval b)))

View File

@@ -0,0 +1,28 @@
(defsystem org.lispbuilds.nix
:class :package-inferred-system
:description "Utilities for importing ASDF systems into Nix"
:depends-on (
:alexandria
:str
:cl-ppcre
:sqlite
:dexador
:arrow-macros
:com.inuoe.jzon
:org.lispbuilds.nix/api
:org.lispbuilds.nix/repository/quicklisp
:org.lispbuilds.nix/database/sqlite
))
(register-system-packages
"cl-ppcre"
'(:ppcre))
(register-system-packages
"dexador"
'(:dex))
(register-system-packages
"alexandria"
'(:alexandria :alexandria-2))

View File

@@ -0,0 +1,240 @@
(defpackage org.lispbuilds.nix/repository/quicklisp
(:use :cl)
(:import-from :dex)
(:import-from :alexandria :read-file-into-string :ensure-list)
(:import-from :arrow-macros :->>)
(:import-from :str)
(:import-from
:org.lispbuilds.nix/database/sqlite
:sqlite-database
:init-db
:database-url
:init-file)
(:import-from
:org.lispbuilds.nix/api
:import-lisp-packages)
(:import-from
:org.lispbuilds.nix/util
:replace-regexes)
(:export :quicklisp-repository)
(:local-nicknames
(:json :com.inuoe.jzon)))
(in-package org.lispbuilds.nix/repository/quicklisp)
(defclass quicklisp-repository ()
((dist-url :initarg :dist-url
:reader dist-url
:initform (error "dist url required"))))
(defun clear-line ()
(write-char #\Return *error-output*)
(write-char #\Escape *error-output*)
(write-char #\[ *error-output*)
(write-char #\K *error-output*))
(defun status (&rest format-args)
(clear-line)
(apply #'format (list* *error-output* format-args))
(force-output *error-output*))
;; TODO: This should not know about the imported.nix file.
(defun init-tarball-hashes (database)
(status "no packages.sqlite - will pre-fill tarball hashes from ~A to save time~%"
(truename "imported.nix"))
(let* ((lines (uiop:read-file-lines "imported.nix"))
(lines (remove-if-not
(lambda (line)
(let ((trimmed (str:trim-left line)))
(or (str:starts-with-p "url = " trimmed)
(str:starts-with-p "sha256 = " trimmed))))
lines))
(lines (mapcar
(lambda (line)
(multiple-value-bind (whole groups)
(ppcre:scan-to-strings "\"\(.*\)\"" line)
(declare (ignore whole))
(svref groups 0)))
lines)))
(sqlite:with-open-database (db (database-url database))
(init-db db (init-file database))
(sqlite:with-transaction db
(loop while lines do
(sqlite:execute-non-query db
"insert or ignore into sha256(url,hash) values (?,?)"
(prog1 (first lines) (setf lines (rest lines)))
(prog1 (first lines) (setf lines (rest lines))))))
(status "OK, imported ~A hashes into DB.~%"
(sqlite:execute-single db
"select count(*) from sha256")))))
(defparameter *broken-systems*
'(
;; Infinite recursion through dependencies in 2024-10-12 dist
"cl-quil" "qvm"
)
"List of broken systems, which should be omitted from the package graph")
(defmethod import-lisp-packages ((repository quicklisp-repository)
(database sqlite-database))
;; If packages.sqlite is missing, we should populate the sha256
;; table to speed things up.
(unless (probe-file (database-url database))
(init-tarball-hashes database))
(let* ((db (sqlite:connect (database-url database)))
(systems-url (str:concat (dist-url repository) "systems.txt"))
(releases-url (str:concat (dist-url repository) "releases.txt"))
(systems-lines (rest (butlast (str:split #\Newline (dex:get systems-url)))))
(releases-lines (rest (butlast (str:split #\Newline (dex:get releases-url))))))
(flet ((sql-query (sql &rest params)
(apply #'sqlite:execute-to-list (list* db sql params))))
;; Ensure database schema
(init-db db (init-file database))
;; Prepare temporary tables for efficient access
(sql-query "create temp table if not exists quicklisp_system
(project, asd, name unique, deps)")
(sql-query "create temp table if not exists quicklisp_release
(project unique, url, size, md5, sha1, prefix not null, asds)")
(sqlite:with-transaction db
(dolist (line systems-lines)
(destructuring-bind (project asd name &rest deps)
(str:words line)
(sql-query
"insert or ignore into quicklisp_system values(?,?,?,?)"
project asd name (json:stringify (coerce deps 'vector))))))
(sqlite:with-transaction db
(dolist (line releases-lines)
(destructuring-bind (project http-url size md5 sha1 prefix &rest asds)
(str:words line)
;; quicklisp does not support TLS
;; https://github.com/quicklisp/quicklisp-client/issues/167
;; but since we fetch systems using nix we can adapt the url.
(let ((url (str:replace-first "http://" "https://" http-url)))
(sql-query
"insert or ignore into quicklisp_release values(?,?,?,?,?,?,?)"
project url size md5 sha1 prefix (json:stringify (coerce
asds
'vector)))))))
;; Weed out circular dependencies from the package graph.
(sqlite:with-transaction db
(sql-query "create temp table will_delete (root,name)")
(loop for (system) in (sql-query "select name from quicklisp_system") do
(when (sql-query
"with recursive dep(root, name) as (
select s.name, d.value
from quicklisp_system s
cross join json_each(s.deps) d
where s.name = ?
union
select dep.root, d.value
from quicklisp_system s, dep
cross join json_each(s.deps) d
where s.name = dep.name
) select 1 from dep where name = root"
system)
(sql-query
"with recursive broken(name) as (
select ?
union
select s.name from quicklisp_system s, broken b
where b.name in (select value from json_each(s.deps))
) insert into will_delete select ?, name from broken"
system system)))
(loop for (root name) in (sql-query "select root, name from will_delete") do
(warn "Circular dependency in '~a': Omitting '~a'" root name)
(sql-query "delete from quicklisp_system where name = ?" name)))
(sqlite:with-transaction db
;; Should these be temp tables, that then get queried by
;; system name? This looks like it uses a lot of memory.
(let ((systems
(sql-query
"with pkgs as (
select
name, asd, url, deps,
ltrim(replace(prefix, r.project, ''), '-_') as version
from quicklisp_system s, quicklisp_release r
where s.project = r.project
)
select
name, version, asd, url,
(select json_group_array(
json_array(value, (select version from pkgs where name=value))
)
from json_each(deps)
where value <> 'asdf') as deps
from pkgs"
)))
;; First pass: insert system and source tarball informaton.
;; Can't insert dependency information, because this works
;; on system ids in the database and they don't exist
;; yet. Could it be better to just base dependencies on
;; names? But then ACID is lost.
(dolist (system systems)
(destructuring-bind (name version asd url deps) system
(declare (ignore deps))
(status "importing system '~a-~a'" name version)
(let ((hash (nix-prefetch-tarball url db)))
(sql-query
"insert or ignore into system(name,version,asd) values (?,?,?)"
name version asd)
(sql-query
"insert or ignore into sha256(url,hash) values (?,?)"
url hash)
(sql-query
"insert or ignore into src values
((select id from sha256 where url=?),
(select id from system where name=? and version=?))"
url name version))))
;; Second pass: connect the in-database systems with
;; dependency information
(dolist (system systems)
(destructuring-bind (name version asd url deps) system
(declare (ignore asd url))
(dolist (dep (coerce (json:parse deps) 'list))
(destructuring-bind (dep-name dep-version) (coerce dep 'list)
(if (eql dep-version 'NULL)
(warn "Bad data in Quicklisp: ~a has no version" dep-name)
(sql-query
"insert or ignore into dep values
((select id from system where name=? and version=?),
(select id from system where name=? and version=?))"
name version
dep-name dep-version))))))))))
(write-char #\Newline *error-output*))
(defun shell-command-to-string (cmd)
;; Clearing the library path is needed to prevent a bug, where the
;; called subprocess uses a different glibc than the SBCL process
;; is. In that case, the call to execve attempts to load the
;; libraries used by SBCL from LD_LIBRARY_PATH using a different
;; glibc than they expect, which errors out.
(let ((ld-library-path (uiop:getenv "LD_LIBRARY_PATH")))
(setf (uiop:getenv "LD_LIBRARY_PATH") "")
(unwind-protect
(uiop:run-program cmd :output '(:string :stripped t))
(setf (uiop:getenv "LD_LIBRARY_PATH") ld-library-path))))
(defun nix-prefetch-tarball (url db)
(restart-case
(compute-sha256 url db)
(try-again ()
:report "Try downloading again"
(nix-prefetch-tarball url db))))
(defun compute-sha256 (url db)
(or (sqlite:execute-single db "select hash from sha256 where url=?" url)
(let ((sha256 (shell-command-to-string (str:concat "nix-prefetch-url --unpack " url))))
sha256)))

View File

@@ -0,0 +1,16 @@
(defpackage org.lispbuilds.nix/util
(:use :cl)
(:import-from :ppcre)
(:export
:replace-regexes))
(in-package org.lispbuilds.nix/util)
(defun replace-regexes (from to str)
(assert (= (length from) (length to)))
(if (null from)
str
(replace-regexes
(rest from)
(rest to)
(ppcre:regex-replace-all (first from) str (first to)))))

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,429 @@
# TODO:
# - faster build by using lisp with preloaded asdf?
# - dont include java libs unless abcl?
# - dont use build-asdf-system to build lispWithPackages?
# - make the lisp packages overridable? (e.g. buildInputs glibc->musl)
# - build asdf with nix and use that instead of one shipped with impls
# (e.g. to fix build with clisp - does anyone use clisp?)
# - claspPackages ? (gotta package clasp with nix first)
# - hard one: remove unrelated sources ( of systems not being built)
# - figure out a less awkward way to patch sources
# (have to build from src directly for SLIME to work, so can't just patch sources in place)
{
pkgs,
lib,
stdenv,
...
}:
let
inherit (lib)
length
filter
foldl
unique
id
concat
concatMap
mutuallyExclusive
findFirst
remove
setAttr
getAttr
hasAttr
attrNames
attrValues
filterAttrs
mapAttrs
splitString
concatStringsSep
concatMapStringsSep
replaceStrings
removeSuffix
hasInfix
optionalString
makeBinPath
makeLibraryPath
makeSearchPath
recurseIntoAttrs
;
inherit (builtins)
head
tail
elem
split
storeDir
;
inherit (pkgs)
replaceVars
;
# Stolen from python-packages.nix
# Actually no idea how this works
makeOverridableLispPackage =
f: origArgs:
let
ff = f origArgs;
overrideWith =
newArgs: origArgs // (if pkgs.lib.isFunction newArgs then newArgs origArgs else newArgs);
in
if builtins.isAttrs ff then
(
ff
// {
overrideLispAttrs = newArgs: makeOverridableLispPackage f (overrideWith newArgs);
}
)
else if builtins.isFunction ff then
{
overrideLispAttrs = newArgs: makeOverridableLispPackage f (overrideWith newArgs);
__functor = self: ff;
}
else
ff;
buildAsdf =
{
asdf,
pkg,
program,
flags,
faslExt,
}:
stdenv.mkDerivation {
inherit (asdf) pname version;
dontUnpack = true;
buildPhase = ''
cp -v ${asdf}/lib/common-lisp/asdf/build/asdf.lisp asdf.lisp
${pkg}/bin/${program} ${toString flags} < <(echo '(compile-file "asdf.lisp")')
'';
installPhase = ''
mkdir -p $out
cp -v asdf.${faslExt} $out
'';
};
#
# Wrapper around stdenv.mkDerivation for building ASDF systems.
#
build-asdf-system = makeOverridableLispPackage (
{
pname,
version,
src ? null,
patches ? [ ],
# Native libraries, will be appended to the library path
nativeLibs ? [ ],
# Java libraries for ABCL, will be appended to the class path
javaLibs ? [ ],
# Lisp dependencies
# these should be packages built with `build-asdf-system`
# TODO(kasper): use propagatedBuildInputs
lispLibs ? [ ],
# Derivation containing the CL implementation package
pkg,
# Name of the Lisp executable
program ? pkg.meta.mainProgram or pkg.pname,
# General flags to the Lisp executable
flags ? [ ],
# Extension for implementation-dependent FASL files
faslExt,
# ASDF amalgamation file to use
# Created in build/asdf.lisp by `make` in ASDF source tree
asdf,
# Some libraries have multiple systems under one project, for
# example, cffi has cffi-grovel, cffi-toolchain etc. By
# default, only the `pname` system is build.
#
# .asd's not listed in `systems` are removed in
# installPhase. This prevents asdf from referring to uncompiled
# systems on run time.
#
# Also useful when the pname is different than the system name,
# such as when using reverse domain naming.
systems ? [ pname ],
# The .asd files that this package provides
# TODO(kasper): remove
asds ? systems,
# Other args to mkDerivation
...
}@args:
(
stdenv.mkDerivation (
rec {
inherit
version
nativeLibs
javaLibs
lispLibs
systems
asds
pkg
program
flags
faslExt
;
# When src is null, we are building a lispWithPackages and only
# want to make use of the dependency environment variables
# generated by build-asdf-system
dontUnpack = src == null;
# Portable script to build the systems.
#
# `lisp` must evaluate this file then exit immediately. For
# example, SBCL's --script flag does just that.
#
# NOTE:
# Every other library worked fine with asdf:compile-system in
# buildScript.
#
# cl-syslog, for some reason, signals that CL-SYSLOG::VALID-SD-ID-P
# is undefined with compile-system, but works perfectly with
# load-system. Strange.
# TODO(kasper) portable quit
asdfFasl = buildAsdf {
inherit
asdf
pkg
program
flags
faslExt
;
};
buildScript = replaceVars ./builder.lisp {
asdf = "${asdfFasl}/asdf.${faslExt}";
};
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
#
# Make sure to include '$' in regex to prevent skipping
# stuff like 'iolib.asdf.asd' for system 'iolib.asd'
#
# Same with '/': `local-time.asd` for system `cl-postgres+local-time.asd`
installPhase =
let
mkSystemsRegex =
systems: concatMapStringsSep "\\|" (replaceStrings [ "." "+" ] [ "[.]" "[+]" ]) systems;
in
''
runHook preInstall
mkdir -pv $out
cp -r * $out
# Remove all .asd files except for those in `systems`.
find $out -name "*.asd" \
| grep -v "/\(${mkSystemsRegex systems}\)\.asd$" \
| xargs rm -fv || true
runHook postInstall
'';
dontPatchShebangs = true;
# Not sure if it's needed, but caused problems with SBCL
# save-lisp-and-die binaries in the past
dontStrip = true;
}
// (
args
// (
let
isJVM = args.pkg.pname == "abcl";
javaLibs = lib.optionals isJVM args.javaLibs or [ ];
in
{
pname = "${args.pkg.pname}-${args.pname}";
src =
if args ? patches || args ? postPatch then
pkgs.applyPatches {
inherit (args) src;
patches = args.patches or [ ];
postPatch = args.postPatch or "";
}
else
args.src;
patches = [ ];
inherit javaLibs;
propagatedBuildInputs = args.propagatedBuildInputs or [ ] ++ lispLibs ++ javaLibs ++ nativeLibs;
meta = (args.meta or { }) // {
maintainers = args.meta.maintainers or [ ];
teams = args.meta.teams or [ lib.teams.lisp ];
};
}
)
)
)
// {
# Useful for overriding
# Overriding code would prefer to use pname from the attribute set
# However, pname is extended with the implementation name
# Moreover, it is used in the default list of systems to load
# So we pass the original pname
pname = args.pname;
}
)
);
# Build the set of lisp packages using `lisp`
# These packages are defined manually for one reason or another:
# - The library is not in quicklisp
# - The library that is in quicklisp is broken
# - Special build procedure such as cl-unicode, asdf
#
# They can use the auto-imported quicklisp packages as dependencies,
# but some of those don't work out of the box.
#
# E.g if a QL package depends on cl-unicode it won't build out of
# the box.
commonLispPackagesFor =
spec:
let
build-asdf-system' = body: build-asdf-system (body // spec);
in
pkgs.callPackage ./packages.nix {
inherit spec quicklispPackagesFor;
build-asdf-system = build-asdf-system';
};
# Build the set of packages imported from quicklisp using `lisp`
quicklispPackagesFor =
spec:
let
build-asdf-system' = body: build-asdf-system (body // spec);
in
pkgs.callPackage ./ql.nix {
build-asdf-system = build-asdf-system';
};
# Creates a lisp wrapper with `packages` installed
#
# `packages` is a function that takes `clpkgs` - a set of lisp
# packages - as argument and returns the list of packages to be
# installed
# TODO(kasper): assert each package has the same lisp and asdf?
lispWithPackages =
clpkgs: packages:
let
first = head (lib.attrValues clpkgs);
in
(build-asdf-system {
inherit (first)
pkg
program
flags
faslExt
asdf
;
# See dontUnpack in build-asdf-system
src = null;
pname = "with";
version = "packages";
lispLibs = packages clpkgs;
systems = [ ];
}).overrideAttrs
(o: {
nativeBuildInputs = [ pkgs.makeBinaryWrapper ];
installPhase = ''
mkdir -pv $out/bin
makeWrapper \
${o.pkg}/bin/${o.program} \
$out/bin/${o.program} \
--add-flags "${toString o.flags}" \
--set ASDF "${o.asdfFasl}/asdf.${o.faslExt}" \
--prefix CL_SOURCE_REGISTRY : "$CL_SOURCE_REGISTRY''${CL_SOURCE_REGISTRY:+:}" \
--prefix ASDF_OUTPUT_TRANSLATIONS : "$(echo $CL_SOURCE_REGISTRY | sed s,//:,::,g):" \
--prefix LD_LIBRARY_PATH : "$LD_LIBRARY_PATH" \
--prefix DYLD_LIBRARY_PATH : "$DYLD_LIBRARY_PATH" \
--prefix CLASSPATH : "$CLASSPATH" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
--prefix PATH : "${makeBinPath (o.propagatedBuildInputs or [ ])}"
'';
});
wrapLisp =
{
pkg,
faslExt,
program ? pkg.meta.mainProgram or pkg.pname,
flags ? [ ],
asdf ? pkgs.asdf_3_3,
packageOverrides ? (self: super: { }),
}:
let
spec = {
inherit
pkg
faslExt
program
flags
asdf
;
};
pkgs = (commonLispPackagesFor spec).overrideScope packageOverrides;
withPackages = lispWithPackages pkgs;
withOverrides =
packageOverrides:
wrapLisp {
inherit
pkg
faslExt
program
flags
asdf
;
inherit packageOverrides;
};
buildASDFSystem = args: build-asdf-system (args // spec);
in
pkg
// {
inherit
pkgs
withPackages
withOverrides
buildASDFSystem
;
};
in
wrapLisp

View File

@@ -0,0 +1,569 @@
{
build-asdf-system,
spec,
quicklispPackagesFor,
stdenv,
pkgs,
...
}:
let
inherit (pkgs.lib)
head
makeLibraryPath
makeSearchPath
setAttr
hasAttr
optionals
optionalAttrs
isDerivation
hasSuffix
splitString
remove
;
# Used by builds that would otherwise attempt to write into storeDir.
#
# Will run build two times, keeping all files created during the
# first run, exept the FASL's. Then using that directory tree as the
# source of the second run.
#
# E.g. cl-unicode creating .txt files during compilation
build-with-compile-into-pwd =
args:
let
args' = if isDerivation args then args.drvAttrs else args;
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;
}
);
# Makes it so packages imported from Quicklisp can be re-used as
# lispLibs ofpackages in this file.
ql = quicklispPackagesFor spec;
packages = ql.overrideScope (
self: super:
{
cl-unicode = build-with-compile-into-pwd {
inherit (super.cl-unicode)
pname
version
src
systems
;
lispLibs = super.cl-unicode.lispLibs ++ [ self.flexi-streams ];
};
jzon = super.com_dot_inuoe_dot_jzon;
_40ants-routes = super._40ants-routes.overrideLispAttrs (o: {
systems = o.systems ++ [ "40ants-routes/handler" ];
});
reblocks-ui2 = super.reblocks-ui2.overrideLispAttrs (o: {
systems = o.systems ++ [
"reblocks-ui2/themes/color"
"reblocks-ui2/themes/tailwind"
"reblocks-ui2/utils/padding"
"reblocks-ui2/utils/align"
"reblocks-ui2/card"
"reblocks-ui2/card/view"
];
});
april = super.april.overrideLispAttrs (o: {
systems = o.systems ++ [ "cape" ];
});
cl-notify = build-asdf-system {
pname = "cl-notify";
version = "20080904-138ca7038";
src = pkgs.fetchzip {
url = "https://repo.or.cz/cl-notify.git/snapshot/138ca703861f4a1fbccbed557f92cf4d213668a1.tar.gz";
sha256 = "0k6ns6fzvjcbpsqgx85r4g5m25fvrdw9481i9vyabwym9q8bbqwx";
};
lispLibs = [
self.cffi
];
nativeLibs = [
pkgs.libnotify
];
};
cl-liballegro-nuklear = build-with-compile-into-pwd super.cl-liballegro-nuklear;
lessp = build-asdf-system {
pname = "lessp";
version = "0.2-f8a9e4664";
src = pkgs.fetchzip {
url = "https://github.com/facts-db/cl-lessp/archive/632217602b85b679e8d420654a0aa39e798ca3b5.tar.gz";
sha256 = "0i3ia14dzqwjpygd0zn785ff5vqnnmkn75psfpyx0ni3jr71lkq9";
};
};
rollback = build-asdf-system {
pname = "rollback";
version = "0.1-5d3f21fda";
src = pkgs.fetchzip {
url = "https://github.com/facts-db/cl-rollback/archive/5d3f21fda8f04f35c5e9d20ee3b87db767915d15.tar.gz";
sha256 = "12dpxsbm2al633y87i8p784k2dn4bbskz6sl40v9f5ljjmjqjzxf";
};
};
facts = build-asdf-system {
pname = "facts";
version = "0.1-632217602";
src = pkgs.fetchzip {
url = "https://beta.quicklisp.org/archive/cl-facts/2022-11-06/cl-facts-20221106-git.tgz";
sha256 = "sha256-PBpyyJYkq1NjKK9VikSAL4TmrGRwUJlEWRSeKj/f4Sc=";
};
lispLibs = [
self.lessp
self.rollback
self.local-time
];
};
cl-fuse = build-with-compile-into-pwd {
inherit (super.cl-fuse)
pname
version
src
lispLibs
;
nativeBuildInputs = [ pkgs.fuse ];
nativeLibs = [ pkgs.fuse ];
};
cl-containers = build-asdf-system {
inherit (super.cl-containers) pname version src;
lispLibs = super.cl-containers.lispLibs ++ [ self.moptilities ];
systems = [
"cl-containers"
"cl-containers/with-moptilities"
];
};
swank = build-with-compile-into-pwd rec {
inherit (super.swank) pname lispLibs;
version = "2.29.1";
src = pkgs.fetchFromGitHub {
owner = "slime";
repo = "slime";
rev = "v${version}";
hash = "sha256-5hNB5XxbTER4HX3dn4umUGnw6UeiTQkczmggFz4uWoE=";
};
systems = [
"swank"
"swank/exts"
];
patches = [ ./patches/swank-pure-paths.patch ];
postConfigure = ''
substituteAllInPlace swank-loader.lisp
'';
};
slynk = build-asdf-system {
pname = "slynk";
version = "trunk";
src = pkgs.fetchFromGitHub {
owner = "joaotavora";
repo = "sly";
rev = "ba40c8f054ec3b7040a6c36a1ef3e9596b936421";
hash = "sha256-hoaCZtyezuXptDPnAvBTT0SZ14M9Ifrmki3beBOwFmI=";
};
systems = [
"slynk"
"slynk/arglists"
"slynk/fancy-inspector"
"slynk/package-fu"
"slynk/mrepl"
"slynk/trace-dialog"
"slynk/profiler"
"slynk/stickers"
"slynk/indentation"
"slynk/retro"
];
};
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
'';
};
clx-truetype = build-asdf-system {
pname = "clx-truetype";
version = "20160825-git";
src = pkgs.fetchzip {
url = "http://beta.quicklisp.org/archive/clx-truetype/2016-08-25/clx-truetype-20160825-git.tgz";
sha256 = "079hyp92cjkdfn6bhkxsrwnibiqbz4y4af6nl31lzw6nm91j5j37";
};
lispLibs = with self; [
alexandria
bordeaux-threads
cl-aa
cl-fad
cl-paths
cl-paths-ttf
cl-store
cl-vectors
clx
trivial-features
zpb-ttf
];
};
mathkit = build-asdf-system {
inherit (super.mathkit)
pname
version
src
asds
;
lispLibs = super.mathkit.lispLibs ++ [ super.sb-cga ];
};
stumpwm = super.stumpwm.overrideLispAttrs {
inherit (pkgs.stumpwm) src version;
meta = {
inherit (pkgs.stumpwm.meta) description license homepage;
};
};
clfswm = super.clfswm.overrideAttrs (o: {
buildScript = pkgs.writeText "build-clfswm.lisp" ''
(load "${o.asdfFasl}/asdf.${o.faslExt}")
(asdf:load-system 'clfswm)
(sb-ext:save-lisp-and-die
"clfswm"
:executable t
#+sb-core-compression :compression
#+sb-core-compression t
:toplevel #'clfswm:main)
'';
installPhase = o.installPhase + ''
mkdir -p $out/bin
mv $out/clfswm $out/bin
'';
});
magicl = build-with-compile-into-pwd {
inherit (super.magicl)
pname
version
src
lispLibs
;
nativeBuildInputs = [ pkgs.gfortran ];
nativeLibs = [ pkgs.openblas ];
};
cl-gtk4 = build-asdf-system {
pname = "cl-gtk4";
version = "1.0.0";
src = pkgs.fetchFromGitHub {
owner = "bohonghuang";
repo = "cl-gtk4";
rev = "ff60e3495cdbba5c09d0bb8aa49f3184cc060c8e";
hash = "sha256-06cyPf+5z+GE3YvZEJ67kC281nkwRz/hoaykTISsni0=";
};
lispLibs = with self; [
cl-gobject-introspection-wrapper
cl-glib
cl-gio
cl-gobject
];
nativeBuildInputs = [
pkgs.gobject-introspection
pkgs.gtk4
];
nativeLibs = [
pkgs.gtk4
];
};
cl-gtk4_dot_adw = build-asdf-system {
pname = "cl-gtk4.adw";
version = self.cl-gtk4.version;
src = self.cl-gtk4.src;
lispLibs = with self; [
cl-gobject-introspection-wrapper
cl-gtk4
];
nativeBuildInputs = [
pkgs.libadwaita
];
nativeLibs = [
pkgs.libadwaita
];
};
cl-gtk4_dot_webkit = build-asdf-system {
pname = "cl-gtk4.webkit";
version = self.cl-gtk4.version;
src = self.cl-gtk4.src;
lispLibs = with self; [
cl-gobject-introspection-wrapper
cl-gtk4
];
nativeBuildInputs = [
pkgs.webkitgtk_6_0
];
nativeLibs = [
pkgs.webkitgtk_6_0
];
};
cl-avro = build-asdf-system {
pname = "cl-avro";
version = "trunk";
src = pkgs.fetchFromGitHub {
owner = "SahilKang";
repo = "cl-avro";
rev = "b8fa26320fa0ae88390215140d57f9cca937f691";
hash = "sha256-acXsotvKWuffrLbrG9YJ8yZc5E6WC8N0qCFCAiX6N0Q=";
};
lispLibs = with self; [
alexandria
babel
chipz
closer-mop
ieee-floats
flexi-streams
local-time
local-time-duration
md5
salza2
st-json
time-interval
trivial-extensible-sequences
];
};
frugal-uuid = super.frugal-uuid.overrideLispAttrs (o: {
systems = [
"frugal-uuid"
"frugal-uuid/non-frugal"
"frugal-uuid/benchmark"
"frugal-uuid/test"
];
lispLibs =
o.lispLibs
++ (with self; [
ironclad
babel
trivial-clock
trivial-benchmark
fiveam
]);
});
duckdb = super.duckdb.overrideLispAttrs (o: {
systems = [
"duckdb"
"duckdb/test"
"duckdb/benchmark"
];
});
polyclot = build-asdf-system {
pname = "polyclot";
version = "trunk";
src = pkgs.fetchfossil {
url = "https://fossil.turtleware.eu/fossil.turtleware.eu/polyclot";
rev = "18500c968b1fc1e2a915b5c70b8cddc4a2b54de51da4eedc5454e42bfea3b479";
sha256 = "sha256-KgBL1QQN4iG6d8E9GlKAuxSwkrY6Zy7e1ZzEDGKad+A=";
};
systems = [
"eu.turtleware.polyclot"
"eu.turtleware.polyclot/demo"
];
lispLibs = with self; [
clim
mcclim
mcclim-layouts
];
};
kons-9 = build-asdf-system {
pname = "kons-9";
version = "trunk";
src = pkgs.fetchFromGitHub {
owner = "kaveh808";
repo = "kons-9";
rev = "08770e7fbb839b91fd035f1cd4a50ecc81b42d57";
sha256 = "sha256-Tit/qmOU5+zp43/ecIXGbh4CtgWzltWM7tHdVWkga0k=";
};
systems = [
"kons-9"
"kons-9/testsuite"
];
patches = [ ./patches/kons-9-fix-testsuite-compilation.patch ];
lispLibs = with self; [
closer-mop
trivial-main-thread
trivial-backtrace
cffi
cl-opengl
cl-glu
cl-glfw3
cl-paths-ttf
zpb-ttf
cl-vectors
origin
clobber
shasht
org_dot_melusina_dot_confidence
];
};
nsb-cga = super.nsb-cga.overrideLispAttrs (oa: {
lispLibs = oa.lispLibs ++ [ self.sb-cga ];
});
qlot-cli = build-asdf-system rec {
pname = "qlot";
version = "1.5.2";
src = pkgs.fetchFromGitHub {
owner = "fukamachi";
repo = "qlot";
rev = "refs/tags/${version}";
hash = "sha256-j9iT25Yz9Z6llCKwwiHlVNKLqwuKvY194LrAzXuljsE=";
};
lispLibs = with self; [
archive
deflate
dexador
fuzzy-match
ironclad
lparallel
yason
];
nativeLibs = [
pkgs.openssl
];
nativeBuildInputs = [
pkgs.makeWrapper
];
buildScript = pkgs.writeText "build-qlot-cli" ''
(load "${self.qlot-cli.asdfFasl}/asdf.${self.qlot-cli.faslExt}")
(asdf:load-system :qlot/command)
(asdf:load-system :qlot/subcommands)
;; Use uiop:dump-image instead of sb-ext:dump-image for the image restore hooks
(setf uiop:*image-entry-point* #'qlot/cli:main)
(uiop:dump-image "qlot"
:executable t
#+sb-core-compression :compression
#+sb-core-compression t)
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp qlot.asd $out
rm *.asd
cp -r * $out
mv $out/qlot $out/bin
wrapProgram $out/bin/qlot \
--prefix LD_LIBRARY_PATH : $LD_LIBRARY_PATH
runHook postInstall
'';
meta.mainProgram = "qlot";
};
fset = super.fset.overrideLispAttrs (oa: {
systems = [
"fset"
"fset/test"
];
meta = {
description = "Functional collections library";
homepage = "https://gitlab.common-lisp.net/fset/fset/-/wikis/home";
license = pkgs.lib.licenses.llgpl21;
};
});
thih-coalton = self.coalton;
quil-coalton = self.coalton;
coalton = super.coalton.overrideLispAttrs (oa: {
systems = [
"coalton"
"thih-coalton"
"quil-coalton"
"thih-coalton/tests"
"quil-coalton/tests"
"coalton/tests"
];
lispLibs = oa.lispLibs ++ [ self.fiasco ];
nativeLibs = [ pkgs.mpfr ];
meta = {
description = "Statically typed functional programming language that supercharges Common Lisp";
homepage = "https://coalton-lang.github.io";
license = pkgs.lib.licenses.mit;
};
});
}
// optionalAttrs pkgs.config.allowAliases {
cl-glib_dot_gio = throw "cl-glib_dot_gio was replaced by cl-gio";
cl-gtk4_dot_webkit2 = throw "cl-gtk4_dot_webkit2 was replaced by cl-gtk4_dot_webkit";
stumpwm-unwrapped = throw "stumpwm-unwrapped is now just stumpwm";
}
);
in
packages

View File

@@ -0,0 +1,21 @@
--- a/cephes.asd
+++ b/cephes.asd
@@ -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"

View File

@@ -0,0 +1,14 @@
--- a/libffi/libffi-types.lisp
+++ b/libffi/libffi-types.lisp
@@ -43,9 +43,6 @@
(pkg-config-cflags "libffi" :optional t)
-#+darwin
-(include "ffi/ffi.h")
-#-darwin
(include "ffi.h")
(cenum status
Diff finished. Sun Nov 13 00:23:10 2022

View File

@@ -0,0 +1,16 @@
--- a/src/ffi/grovel/grovel-freetype.h
+++ b/src/ffi/grovel/grovel-freetype.h
@@ -2,7 +2,7 @@
#include <ft2build.h>
#include FT_FREETYPE_H
-#include <ftsystem.h>
-#include <fttypes.h>
-#include <ftlist.h>
-#include <ftimage.h>
+#include <freetype/ftsystem.h>
+#include <freetype/fttypes.h>
+#include <freetype/ftlist.h>
+#include <freetype/ftimage.h>
Diff finished. Mon Nov 14 22:41:57 2022

View File

@@ -0,0 +1,26 @@
From 2040fcab5a7be2f28add46a1412bef62ac5ccf11 Mon Sep 17 00:00:00 2001
From: Maximilian Marx <mmarx@wh2.tu-dresden.de>
Date: Thu, 24 Nov 2022 20:00:33 +0100
Subject: [PATCH] Use glucose binary from PATH if present
---
src/package.lisp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/package.lisp b/src/package.lisp
index b6e26ac..bdb2581 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -13,7 +13,9 @@
(defvar *glucose-home* (asdf:system-relative-pathname :cl-sat.glucose "glucose-syrup/"))
(defun glucose-binary (&optional (*glucose-home* *glucose-home*))
- (merge-pathnames "simp/glucose_static" *glucose-home*))
+ (if (trivial-package-manager:which "glucose")
+ "glucose"
+ (merge-pathnames "simp/glucose_static" *glucose-home*)))
(defmethod solve ((input pathname) (solver (eql :glucose)) &rest options &key debug &allow-other-keys)
(remf options :debug)
--
2.36.2

View File

@@ -0,0 +1,22 @@
--- a/testsuite/assertions.lisp
+++ b/testsuite/assertions.lisp
@@ -13,7 +13,7 @@
relation when computing with floating point numbers. Two floating point numbers are
essentially equal when they are in a neighbourhood whose size is based
on the magnitude orders of these floating point numbers and the inaccuracy."
- (:report
+ :report
(lambda (stream)
(flet ((maybe-report (name float1 float2)
(unless (float-is-essentially-equal (p:y point1) (p:y point2) :inaccuracy inaccuracy)
@@ -29,7 +29,7 @@
inaccuracy (confidence::float-comparison-threshold 'single-float max inaccuracy float1 float2)))))
(maybe-report "X" (p:x point1) (p:x point2))
(maybe-report "Y" (p:y point1) (p:y point2))
- (maybe-report "Z" (p:z point1) (p:z point2)))))
+ (maybe-report "Z" (p:z point1) (p:z point2))))
(and (float-is-essentially-equal (p:x point1) (p:x point2) :inaccuracy inaccuracy)
(float-is-essentially-equal (p:y point1) (p:y point2) :inaccuracy inaccuracy)
(float-is-essentially-equal (p:z point1) (p:z point2) :inaccuracy inaccuracy)))
Diff finished. Sun Oct 20 03:05:54 2024

View File

@@ -0,0 +1,32 @@
--- a/src/gnuplot/gnuplot.lisp
+++ b/src/gnuplot/gnuplot.lisp
@@ -24,8 +24,13 @@
(in-package :math/gnuplot)
-(defparameter *default-gnuplot-direcroty*
- (ensure-directories-exist #P"~/gnuplot/"))
+
+
+(defun default-gnuplot-directory ()
+ (let ((directory (merge-pathnames
+ (make-pathname :directory '(:relative "gnuplot"))
+ (user-homedir-pathname))))
+ (ensure-directories-exist directory)))
;;;; (directory-namestring *default-gnuplot-direcroty*)
@@ -33,9 +38,9 @@
(assert (stringp f-name))
(assert (stringp f-ext))
(if (string= "" f-ext)
- (concatenate 'string (directory-namestring *default-gnuplot-direcroty*)
+ (concatenate 'string (directory-namestring (default-gnuplot-directory))
f-name f-ext)
- (concatenate 'string (directory-namestring *default-gnuplot-direcroty*)
+ (concatenate 'string (directory-namestring (default-gnuplot-directory))
f-name "." f-ext)))
(defun find-font-family (&key (family "Times New Roman"))
Diff finished. Fri Mar 10 20:05:26 2023

View File

@@ -0,0 +1,28 @@
Prevent swank from attempting write into storeDir
--- a/swank-loader.lisp
+++ b/swank-loader.lisp
@@ -162,7 +162,7 @@
,(unique-dir-name)))
(user-homedir-pathname)))
-(defvar *fasl-directory* (default-fasl-dir)
+(defvar *fasl-directory* #P"@out@/fasl/"
"The directory where fasl files should be placed.")
(defun binary-pathname (src-pathname binary-dir)
@@ -284,12 +284,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)
- (let ((fasl (binary-pathname src fasl-dir)))
- (when (and (probe-file fasl)
- (<= (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*))
Diff finished. Sat Jan 22 23:57:27 2022

View File

@@ -0,0 +1,6 @@
(load (sb-ext:posix-getenv "ASDF"))
(pushnew (truename "./import") asdf:*central-registry*)
(asdf:load-system :org.lispbuilds.nix)
(load "./import/main.lisp")
(org.lispbuilds.nix/main::main)

View File

@@ -0,0 +1,322 @@
{
pkgs,
lib,
stdenv,
build-asdf-system,
...
}:
let
# FIXME: automatically add nativeLibs based on conditions signalled
overrides = (
self: super: {
cl_plus_ssl = super.cl_plus_ssl.overrideLispAttrs (o: {
nativeLibs = [ pkgs.openssl ];
});
cl-cffi-gtk-glib = super.cl-cffi-gtk-glib.overrideLispAttrs (o: {
nativeLibs = [ pkgs.glib ];
});
cl-cffi-gtk-cairo = super.cl-cffi-gtk-cairo.overrideLispAttrs (o: {
nativeLibs = [ pkgs.cairo ];
});
cl-cairo2 = super.cl-cairo2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.cairo ];
});
cl-cairo2-xlib = super.cl-cairo2-xlib.overrideLispAttrs (o: {
nativeLibs = [ pkgs.gtk2-x11 ];
});
cl-freeimage = super.cl-freeimage.overrideLispAttrs (o: {
nativeLibs = [ pkgs.freeimage ];
});
cl-freetype2 = super.cl-freetype2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.freetype ];
nativeBuildInputs = [ pkgs.freetype ];
patches = [ ./patches/cl-freetype2-fix-grovel-includes.patch ];
});
cl-pango = super.cl-pango.overrideLispAttrs (o: {
nativeLibs = [ pkgs.pango ];
});
cl-gtk2-gdk = super.cl-gtk2-gdk.overrideLispAttrs (o: {
nativeLibs = [ pkgs.gtk2-x11 ];
});
cl-gtk2-glib = super.cl-gtk2-glib.overrideLispAttrs (o: {
nativeLibs = [ pkgs.glib ];
});
cl-gtk2-pango = super.cl-gtk2-pango.overrideLispAttrs (o: {
nativeLibs = [ pkgs.pango ];
});
cl-rsvg2 = super.cl-rsvg2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.librsvg ];
});
cl-cffi-gtk-gdk = super.cl-cffi-gtk-gdk.overrideLispAttrs (o: {
nativeLibs = [ pkgs.gtk3 ];
});
cl-cffi-gtk-gdk-pixbuf = super.cl-cffi-gtk-gdk-pixbuf.overrideLispAttrs (o: {
nativeLibs = [ pkgs.gdk-pixbuf ];
});
cl-cffi-gtk-pango = super.cl-cffi-gtk-pango.overrideLispAttrs (o: {
nativeLibs = [ pkgs.pango ];
});
cl-gobject-introspection = super.cl-gobject-introspection.overrideLispAttrs (o: {
nativeLibs = [
pkgs.glib
pkgs.gobject-introspection
];
});
cl-mysql = super.cl-mysql.overrideLispAttrs (o: {
nativeLibs = [ pkgs.mariadb.client ];
});
clsql-postgresql = super.clsql-postgresql.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libpq ];
});
clsql-sqlite3 = super.clsql-sqlite3.overrideLispAttrs (o: {
nativeLibs = [ pkgs.sqlite ];
});
cl-webkit2 = super.cl-webkit2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.webkitgtk_4_1 ];
});
dbd-mysql = super.dbd-mysql.overrideLispAttrs (o: {
nativeLibs = [ pkgs.mariadb.client ];
});
lla = super.lla.overrideLispAttrs (o: {
nativeLibs = [ pkgs.openblas ];
});
cffi = super.cffi.overrideLispAttrs (o: {
javaLibs = [
(pkgs.fetchMavenArtifact {
groupId = "net.java.dev.jna";
artifactId = "jna";
version = "5.9.0";
sha256 = "0qbis8acv04fi902qzak1mbagqaxcsv2zyp7b8y4shs5nj0cgz7a";
})
];
});
cffi-libffi = super.cffi-libffi.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.libffi ];
nativeLibs = [ pkgs.libffi ];
patches = lib.optionals stdenv.hostPlatform.isDarwin [ ./patches/cffi-libffi-darwin-ffi-h.patch ];
});
cl-rabbit = super.cl-rabbit.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.rabbitmq-c ];
nativeLibs = [ pkgs.rabbitmq-c ];
});
trivial-ssh-libssh2 = super.trivial-ssh-libssh2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libssh2 ];
});
sqlite = super.sqlite.overrideLispAttrs (o: {
nativeLibs = [ pkgs.sqlite ];
});
duckdb = super.duckdb.overrideLispAttrs (o: {
nativeLibs = [ pkgs.duckdb ];
});
cl-libuv = super.cl-libuv.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.libuv ];
nativeLibs = [ pkgs.libuv ];
});
cl-liballegro = super.cl-liballegro.overrideLispAttrs (o: {
nativeLibs = [ pkgs.allegro5 ];
});
cl-ode = super.cl-ode.overrideLispAttrs (o: {
nativeLibs =
let
ode' = pkgs.ode.overrideAttrs (o: {
configureFlags = [
"--enable-shared"
"--enable-double-precision"
];
});
in
[ ode' ];
});
classimp = super.classimp.overrideLispAttrs (o: {
nativeLibs = [ pkgs.assimp ];
});
sdl2 = super.sdl2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.SDL2 ];
});
sdl2-image = super.sdl2-image.overrideLispAttrs (o: {
nativeLibs = [ pkgs.SDL2_image ];
});
sdl2-mixer = super.sdl2-mixer.overrideLispAttrs (o: {
nativeLibs = [ pkgs.SDL2_mixer ];
});
sdl2-ttf = super.sdl2-ttf.overrideLispAttrs (o: {
nativeLibs = [ pkgs.SDL2_ttf ];
});
lispbuilder-sdl-cffi = super.lispbuilder-sdl-cffi.overrideLispAttrs (o: {
nativeLibs = [ pkgs.SDL ];
});
cl-opengl = super.cl-opengl.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libGL ];
});
cl-glu = super.cl-glu.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libGLU ];
});
cl-glut = super.cl-glut.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libglut ];
});
cl-glfw = super.cl-glfw.overrideLispAttrs (o: {
nativeLibs = [ pkgs.glfw ];
});
cl-glfw-opengl-core = super.cl-glfw-opengl-core.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libGL ];
});
cl-glfw3 = super.cl-glfw3.overrideLispAttrs (o: {
nativeLibs = [ pkgs.glfw ];
});
lev = super.lev.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libev ];
});
cl-rdkafka = super.cl-rdkafka.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.rdkafka ];
nativeLibs = [ pkgs.rdkafka ];
});
cl-async-ssl = super.cl-async-ssl.overrideLispAttrs (o: {
nativeLibs = [ pkgs.openssl ];
});
iolib = super.iolib.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.libfixposix ];
nativeLibs = [ pkgs.libfixposix ];
systems = [
"iolib"
"iolib/os"
"iolib/pathnames"
];
});
cl-ana_dot_hdf-cffi = super.cl-ana_dot_hdf-cffi.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.hdf5 ];
nativeLibs = [ pkgs.hdf5 ];
NIX_LDFLAGS = [ "-lhdf5" ];
});
gsll = super.gsll.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.gsl ];
nativeLibs = [ pkgs.gsl ];
});
cl-libyaml = super.cl-libyaml.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libyaml ];
});
cl-libxml2 = super.cl-libxml2.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libxml2 ];
});
cl-readline = super.cl-readline.overrideLispAttrs (o: {
nativeLibs = [ pkgs.readline ];
});
md5 = super.md5.overrideLispAttrs (o: {
lispLibs = [ super.flexi-streams ];
});
pzmq = super.pzmq.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.zeromq ];
nativeLibs = [ pkgs.zeromq ];
});
pzmq-compat = super.pzmq-compat.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.zeromq ];
nativeLibs = [ pkgs.zeromq ];
});
pzmq-examples = super.pzmq-examples.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.zeromq ];
nativeLibs = [ pkgs.zeromq ];
});
pzmq-test = super.pzmq-test.overrideLispAttrs (o: {
nativeBuildInputs = [ pkgs.zeromq ];
nativeLibs = [ pkgs.zeromq ];
});
cl-git = super.cl-git.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libgit2 ];
});
trivial-package-manager = super.trivial-package-manager.overrideLispAttrs (o: {
propagatedBuildInputs = [ pkgs.which ];
});
cl-sat_dot_glucose = super.cl-sat_dot_glucose.overrideLispAttrs (o: {
propagatedBuildInputs = [ pkgs.glucose ];
patches = [ ./patches/cl-sat-binary-from-path.patch ];
});
cl-sat_dot_minisat = super.cl-sat_dot_minisat.overrideLispAttrs (o: {
propagatedBuildInputs = [ pkgs.minisat ];
});
hu_dot_dwim_dot_graphviz = super.hu_dot_dwim_dot_graphviz.overrideLispAttrs (o: {
nativeLibs = [ pkgs.graphviz ];
});
math = super.math.overrideLispAttrs (o: {
patches = [ ./patches/math-no-compile-time-directory.patch ];
nativeLibs = [ pkgs.fontconfig ];
});
mcclim-fonts = super.mcclim-fonts.overrideLispAttrs (o: {
lispLibs = o.lispLibs ++ [
super.cl-dejavu
super.zpb-ttf
super.cl-vectors
super.cl-paths-ttf
super.flexi-streams
];
systems = [
"mcclim-fonts"
"mcclim-fonts/truetype"
];
});
mcclim-render = super.mcclim-render.overrideLispAttrs (o: {
lispLibs = o.lispLibs ++ [
self.mcclim-fonts
];
});
mcclim-layouts = super.mcclim-layouts.overrideLispAttrs (o: {
systems = [
"mcclim-layouts"
"mcclim-layouts/tab"
];
lispLibs = o.lispLibs ++ [
self.mcclim
];
});
cl-charms = super.cl-charms.overrideLispAttrs (o: {
nativeLibs = [ pkgs.ncurses ];
});
libusb-ffi = super.libusb-ffi.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libusb-compat-0_1 ];
});
jpeg-turbo = super.jpeg-turbo.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libjpeg_turbo ];
});
vorbisfile-ffi = super.vorbisfile-ffi.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libvorbis ];
});
png = super.png.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libpng ];
});
zmq = super.zmq.overrideLispAttrs (o: {
nativeLibs = [ pkgs.czmq ];
});
consfigurator = super.consfigurator.overrideLispAttrs (o: {
nativeLibs = [
pkgs.acl
pkgs.libcap
];
});
cl-gss = super.cl-gss.overrideLispAttrs (o: {
nativeLibs = [ pkgs.libkrb5 ];
});
magicffi = super.magicffi.overrideLispAttrs (o: {
nativeLibs = [ pkgs.file ];
});
keystone = super.keystone.overrideLispAttrs (o: {
nativeLibs = [ pkgs.keystone ];
});
capstone = super.capstone.overrideLispAttrs (o: {
nativeLibs = [ pkgs.capstone ];
});
vk = super.vk.overrideLispAttrs (o: {
nativeLibs = [ pkgs.vulkan-loader ];
});
_3d-math = super._3d-math.overrideLispAttrs (o: {
flags = o.flags ++ (if o.program == "sbcl" then [ "--dynamic-space-size 4096" ] else [ ]);
});
}
);
qlpkgs = lib.optionalAttrs (builtins.pathExists ./imported.nix) (
pkgs.callPackage ./imported.nix { inherit build-asdf-system; }
);
in
qlpkgs.overrideScope overrides

View File

@@ -0,0 +1,56 @@
# This setup hook adds every propagated lisp system to CL_SOURCE_REGISTRY
buildAsdfPath () {
declare -A seen=()
for dep in $propagatedBuildInputs; do
_addToAsdfPath $dep
done
}
addFileToSearchPathWithCustomDelimiter() {
local delimiter="$1"
local varName="$2"
local file="$3"
if [[ -f "$file" && "${!varName:+${delimiter}${!varName}${delimiter}}" \
!= *"${delimiter}${file}${delimiter}"* ]]; then
export "${varName}=${!varName:+${!varName}${delimiter}}${file}"
fi
}
addFileToSearchPath() {
addFileToSearchPathWithCustomDelimiter ":" "$@"
}
_addToAsdfPath () {
local dep="$1"
if [ -v seen[$dep] ]; then
return
else
seen[$dep]=1
local path="$dep"
# FIXME slow
while read file; do
case "${file##*.}" in
jar) addFileToSearchPath "CLASSPATH" "$file" ;;
class) addToSearchPath "CLASSPATH" "${file%/*}" ;;
so) addToSearchPath "LD_LIBRARY_PATH" "${file%/*}" ;;
dylib) addToSearchPath "DYLD_LIBRARY_PATH" "${file%/*}" ;;
asd) addToSearchPath "CL_SOURCE_REGISTRY" "$path//" ;;
esac
done < <(find "$path" -type f,l -name '*.asd' -o -name '*.jar' \
-o -name '*.class' -o -name '*.so' -o -name '*.dylib')
local prop="$dep/nix-support/propagated-build-inputs"
if [ -e "$prop" ]; then
local new_system
for new_system in $(cat $prop); do
_addToAsdfPath "$new_system"
done
fi
fi
}
# addEnvHooks "$targetOffset" buildAsdfPath

View File

@@ -0,0 +1,23 @@
let
pkgs = import ../../../. { };
inherit (pkgs) mkShellNoCC sbcl nixfmt-rfc-style;
in
mkShellNoCC {
packages = [
nixfmt-rfc-style
(sbcl.withPackages (
ps:
builtins.attrValues {
inherit (ps)
alexandria
str
dexador
cl-ppcre
sqlite
arrow-macros
jzon
;
}
))
];
}