lisp-modules-new: bring over changes from nix-cl

Based on 60dbe8f643
This commit is contained in:
Kasper Gałkowski 2022-09-30 21:04:59 +02:00
parent f95f16a312
commit 3185bc7036
8 changed files with 9263 additions and 4114 deletions

View file

@ -130,5 +130,7 @@ in {")
(:symbol "pkgs")))
(remove "asdf"
(str:split-omit-nulls #\, deps)
:test #'string=))))))))))
:test #'string=))))
,@(when (find #\/ name)
'(("meta" (:attrs ("broken" (:symbol "true"))))))))))))
(format f "~%}~%"))))

View file

@ -22,7 +22,7 @@
(make-instance
'quicklisp-repository
:dist-url
"https://beta.quicklisp.org/dist/quicklisp/2021-12-30/"))
"https://beta.quicklisp.org/dist/quicklisp/2022-07-08/"))
(defun run-importers ()
(import-lisp-packages *quicklisp* *sqlite*)

File diff suppressed because it is too large Load diff

View file

@ -42,6 +42,8 @@ let
optionalString
makeLibraryPath
makeSearchPath
recurseIntoAttrs
dontRecurseIntoAttrs
;
inherit (builtins)
@ -55,11 +57,13 @@ let
# This is probably causing performance problems...
flattenedDeps = lispLibs:
let
toSet = list: builtins.listToAttrs (map (d: { name = d.pname; value = d; }) list);
toList = attrValues;
walk = acc: node:
if length node.lispLibs == 0
then acc
else foldl walk (acc ++ node.lispLibs) node.lispLibs;
in unique (walk [] { inherit lispLibs; });
else builtins.foldl' walk (acc // toSet node.lispLibs) node.lispLibs;
in toList (walk {} { inherit lispLibs; });
# Stolen from python-packages.nix
# Actually no idea how this works
@ -207,11 +211,12 @@ let
# from storeDir. Otherwise it could try to recompile lisp deps.
export ASDF_OUTPUT_TRANSLATIONS="${src}:$(pwd):${storeDir}:${storeDir}"
# Make Nix track the dependencies so that graphs can be generated with
# nix-store -q --graph
echo "$lispLibs" >> nix-drvs
echo "$nativeLibs" >> nix-drvs
echo "$javaLibs" >> nix-drvs
# track lisp dependencies for graph generation
# TODO: Do the propagation like for lisp, native and java like this:
# https://github.com/teu5us/nix-lisp-overlay/blob/e30dafafa5c1b9a5b0ccc9aaaef9d285d9f0c46b/pkgs/development/lisp-modules/setup-hook.sh
# Then remove the "echo >> nix-drvs" from buildScript
echo $lispLibs >> __nix-drvs
# Finally, compile the systems
${lisp} $buildScript
@ -389,19 +394,6 @@ let
lispPackagesFor
lispWithPackages;
# Uncomment for debugging/development
# inherit
# flattenedDeps
# concatMap
# attrNames
# getAttr
# filterAttrs
# filter
# elem
# unique
# makeAttrName
# length;
# TODO: uncomment clasp when clasp 1.0.0 is packaged
# There's got to be a better way than this...
@ -416,10 +408,10 @@ let
# Manually defined packages shadow the ones imported from quicklisp
sbclPackages = lispPackagesFor sbcl;
eclPackages = lispPackagesFor ecl;
abclPackages = lispPackagesFor abcl;
cclPackages = lispPackagesFor ccl;
sbclPackages = recurseIntoAttrs (lispPackagesFor sbcl);
eclPackages = dontRecurseIntoAttrs (lispPackagesFor ecl);
abclPackages = dontRecurseIntoAttrs (lispPackagesFor abcl);
cclPackages = dontRecurseIntoAttrs (lispPackagesFor ccl);
# claspPackages = lispPackagesFor clasp;
sbclWithPackages = lispWithPackages sbcl;

View file

@ -110,34 +110,6 @@ let
];
};
quri = build-asdf-system {
src = pkgs.stdenv.mkDerivation {
pname = "patched";
version = "source";
src = pkgs.fetchzip {
url = "http://beta.quicklisp.org/archive/quri/2021-04-11/quri-20210411-git.tgz";
sha256 = "1pkvpiwwhx2fcknr7x47h7036ypkg8xzsskqbl5z315ipfmi8s2m";
};
# fix build with ABCL
buildPhase = ''
sed -i "s,[#][.](asdf.*,#P\"$out/data/effective_tld_names.dat\")," src/etld.lisp
'';
installPhase = ''
mkdir -pv $out
cp -r * $out
'';
};
version = "20210411";
pname = "quri";
lispLibs = with ql; [
alexandria
babel
cl-utilities
split-sequence
];
};
jzon = build-asdf-system {
src = pkgs.fetchzip {
url = "https://github.com/Zulu-Inuoe/jzon/archive/6b201d4208ac3f9721c461105b282c94139bed29.tar.gz";
@ -166,6 +138,15 @@ let
];
};
cl-liballegro-nuklear = build-with-compile-into-pwd {
inherit (ql.cl-liballegro-nuklear) pname version src;
nativeBuildInputs = [ pkgs.allegro5 ];
nativeLibs = [ pkgs.allegro5 ];
lispLibs = ql.cl-liballegro-nuklear.lispLibs ++ [ ql.cl-liballegro ];
patches = [ ./patches/cl-liballegro-nuklear-missing-dll.patch ];
};
tuple = build-asdf-system {
pname = "tuple";
version = "b74bd067d";
@ -229,6 +210,35 @@ let
];
};
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://github.com/facts-db/cl-lessp/archive/632217602b85b679e8d420654a0aa39e798ca3b5.tar.gz";
sha256 = "09z1vwzjm7hlb529jl3hcjnfd11gh128lmdg51im7ar4jv4746iw";
};
lispLibs = [ lessp rollback ] ++ [ ql.local-time ];
};
cl-fuse = build-with-compile-into-pwd {
inherit (ql.cl-fuse) pname version src lispLibs;
nativeBuildInputs = [ pkgs.fuse ];
@ -262,35 +272,6 @@ let
];
};
mgl = build-asdf-system {
pname = "mgl";
version = "2021-10-07";
src = pkgs.fetchzip {
url = "https://github.com/melisgl/mgl/archive/e697791a9bcad3b6e7b3845246a2aa55238cfef7.tar.gz";
sha256 = "09sf7nq7nmf9q7bh3a5ygl2i2n0nhrx5fk2kv5ili0ckv7g9x72s";
};
lispLibs = with ql; [
alexandria closer-mop array-operations lla cl-reexport mgl-pax
named-readtables pythonic-string-reader
] ++ [ mgl-mat ];
systems = [ "mgl" "mgl/test" ];
};
mgl-mat = build-asdf-system {
pname = "mgl-mat";
version = "2021-10-11";
src = pkgs.fetchzip {
url = "https://github.com/melisgl/mgl-mat/archive/3710858bc876b1b86e50f1db2abe719e92d810e7.tar.gz";
sha256 = "1aa2382mi55rp8pd31dz4d94yhfzh30vkggcvmvdfrr4ngffj0dx";
};
lispLibs = with ql; [
alexandria bordeaux-threads cffi cffi-grovel cl-cuda
flexi-streams ieee-floats lla mgl-pax static-vectors
trivial-garbage cl-fad
];
systems = [ "mgl-mat" "mgl-mat/test" ];
};
mathkit = build-asdf-system {
inherit (ql.mathkit) pname version src asds lisp;
lispLibs = ql.mathkit.lispLibs ++ [ ql.sb-cga ];
@ -351,18 +332,6 @@ let
version = "f19162e76";
});
s-sql_slash_tests = ql.s-sql_slash_tests.overrideLispAttrs (o: {
lispLibs = o.lispLibs ++ [
ql.cl-postgres_slash_tests
];
});
simple-date_slash_postgres-glue = ql.simple-date_slash_postgres-glue.overrideLispAttrs (o: {
lispLibs = o.lispLibs ++ [
ql.cl-postgres_slash_tests
];
});
};
in packages

View file

@ -0,0 +1,17 @@
Fix system not loading due to:
Unhandled CFFI:LOAD-FOREIGN-LIBRARY-ERROR
Unable to load foreign library (LIBALLEGRO-NUKLEAR).
Error opening shared object "/build/source/src/liballegro_nuklear.so":
/build/source/src/liballegro_nuklear.so: undefined symbol: al_draw_ellipse.
--- a/cl-liballegro-nuklear.asd
+++ b/cl-liballegro-nuklear.asd
@@ -12,7 +12,7 @@
:description "CFFI wrapper for the Nuklear IM GUI library with liballegro backend, to be used with cl-liballegro."
:author "Andrew Kravchuk <awkravchuk@gmail.com>"
:license "MIT"
- :depends-on (:cffi :cffi-libffi :trivial-features)
+ :depends-on (:cl-liballegro :cffi :cffi-libffi :trivial-features)
:pathname "src"
:serial t
:components ((:makefile "Makefile")

View file

@ -11,7 +11,7 @@ let
extras = {
"cl+ssl" = pkg: {
nativeLibs = [ openssl ];
nativeLibs = [ openssl_1_1 ];
};
cl-cffi-gtk-glib = pkg: {
nativeLibs = [ glib ];
@ -72,6 +72,16 @@ let
# weird...
nativeLibs = [ allegro5 ];
};
cl-ode = pkg: {
nativeLibs = let
ode' = ode.overrideAttrs (o: {
configureFlags = [
"--enable-shared"
"--enable-double-precision"
];
});
in [ ode' ];
};
classimp = pkg: {
nativeLibs = [ assimp ];
};
@ -107,7 +117,7 @@ let
nativeLibs = [ rdkafka ];
};
cl-async-ssl = pkg: {
nativeLibs = [ openssl ];
nativeLibs = [ openssl_1_1 ];
};
osicat = pkg: {
LD_LIBRARY_PATH = "${pkg}/posix/";
@ -121,7 +131,6 @@ let
qlpkgs =
if builtins.pathExists ./imported.nix
# then filterAttrs (n: v: all (check: !(check n v)) broken) (import ./imported.nix { inherit pkgs; })
then import ./imported.nix { inherit (pkgs) runCommand fetchzip; pkgs = builtQlpkgs; }
else {};

View file

@ -22738,7 +22738,8 @@ with pkgs;
quicklispPackages = quicklispPackagesSBCL;
# Alternative lisp-modules implementation
lispPackages_new = callPackage ../development/lisp-modules-new/lisp-packages.nix {};
lispPackages_new = recurseIntoAttrs (callPackage ../development/lisp-modules-new/lisp-packages.nix {});
### DEVELOPMENT / PERL MODULES