From 5a3c528ccef74589d9fd6f705cbe038f76cc0b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Ga=C5=82kowski?= Date: Wed, 1 Mar 2023 21:27:12 +0100 Subject: [PATCH] lisp-modules: wrap lisps --- pkgs/development/compilers/abcl/default.nix | 24 ++++- pkgs/development/compilers/ccl/default.nix | 26 ++++- pkgs/development/compilers/ecl/16.1.2.nix | 21 +++- pkgs/development/compilers/ecl/default.nix | 22 ++++- pkgs/development/compilers/sbcl/2.x.nix | 22 ++++- .../interpreters/clisp/default.nix | 21 +++- pkgs/development/interpreters/clisp/hg.nix | 21 +++- pkgs/top-level/all-packages.nix | 96 +++++++++++-------- 8 files changed, 196 insertions(+), 57 deletions(-) diff --git a/pkgs/development/compilers/abcl/default.nix b/pkgs/development/compilers/abcl/default.nix index 2ecd08426eba..7e7d110d4b42 100644 --- a/pkgs/development/compilers/abcl/default.nix +++ b/pkgs/development/compilers/abcl/default.nix @@ -1,5 +1,12 @@ -{lib, stdenv, fetchurl, ant, jre, jdk}: -stdenv.mkDerivation rec { +{lib, stdenv, fetchurl, ant, jre, jdk +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "abcl"; program = "abcl"; flags = ""; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {})}: +let abcl = stdenv.mkDerivation rec { pname = "abcl"; version = "1.9.0"; # or fetchFromGitHub(owner,repo,rev) or fetchgit(rev) @@ -40,4 +47,15 @@ stdenv.mkDerivation rec { platforms = lib.platforms.linux; homepage = "https://common-lisp.net/project/armedbear/"; }; -} + + # For packages + passthru = let + spec' = spec // { pkg = abcl; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; +}; +in abcl diff --git a/pkgs/development/compilers/ccl/default.nix b/pkgs/development/compilers/ccl/default.nix index 89c6b784b458..7e29b3e286fc 100644 --- a/pkgs/development/compilers/ccl/default.nix +++ b/pkgs/development/compilers/ccl/default.nix @@ -1,4 +1,12 @@ -{ lib, stdenv, fetchurl, fetchpatch, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }: +{ lib, stdenv, fetchurl, fetchpatch, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "lx64fsl"; program = "ccl"; flags = ""; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) +}: let options = rec { @@ -48,9 +56,7 @@ let tar czf $out ccl ''; -in - -stdenv.mkDerivation rec { +ccl = stdenv.mkDerivation rec { pname = "ccl"; version = "1.12"; @@ -125,4 +131,14 @@ stdenv.mkDerivation rec { broken = (stdenv.isDarwin && stdenv.isx86_64); license = licenses.asl20; }; -} + + passthru = let + spec' = spec // { pkg = ccl; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; + +}; in ccl diff --git a/pkgs/development/compilers/ecl/16.1.2.nix b/pkgs/development/compilers/ecl/16.1.2.nix index ef00bb19d411..e7960c153b95 100644 --- a/pkgs/development/compilers/ecl/16.1.2.nix +++ b/pkgs/development/compilers/ecl/16.1.2.nix @@ -14,9 +14,16 @@ , threadSupport ? false , useBoehmgc ? true , boehmgc +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "fas"; program = "ecl"; flags = ""; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) }: -stdenv.mkDerivation rec { +let ecl = stdenv.mkDerivation rec { pname = "ecl"; version = "16.1.2"; @@ -96,4 +103,14 @@ stdenv.mkDerivation rec { # never built on aarch64-darwin since first introduction in nixpkgs broken = stdenv.isDarwin && stdenv.isAarch64; }; -} + + passthru = let + spec' = spec // { pkg = ecl; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; +}; +in ecl diff --git a/pkgs/development/compilers/ecl/default.nix b/pkgs/development/compilers/ecl/default.nix index c442364d198e..c0bb2d6ce17c 100644 --- a/pkgs/development/compilers/ecl/default.nix +++ b/pkgs/development/compilers/ecl/default.nix @@ -15,9 +15,16 @@ , threadSupport ? true , useBoehmgc ? false , boehmgc +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "fas"; program = "ecl"; flags = ""; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) }: -stdenv.mkDerivation rec { +let ecl = stdenv.mkDerivation rec { pname = "ecl"; version = "21.2.1"; @@ -83,4 +90,15 @@ stdenv.mkDerivation rec { platforms = platforms.unix; changelog = "https://gitlab.com/embeddable-common-lisp/ecl/-/raw/${version}/CHANGELOG"; }; -} + + # For packages + passthru = let + spec' = spec // { pkg = ecl; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; + +}; in ecl diff --git a/pkgs/development/compilers/sbcl/2.x.nix b/pkgs/development/compilers/sbcl/2.x.nix index 4fcccbf97041..04e4a9322f27 100644 --- a/pkgs/development/compilers/sbcl/2.x.nix +++ b/pkgs/development/compilers/sbcl/2.x.nix @@ -10,6 +10,13 @@ , coreCompression ? lib.versionAtLeast version "2.2.6" , texinfo , version +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "fasl"; program = "sbcl"; flags = ""; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) }: let @@ -67,7 +74,7 @@ let }; }; -in with versionMap.${version}; +sbcl = with versionMap.${version}; stdenv.mkDerivation rec { pname = "sbcl"; @@ -219,4 +226,15 @@ stdenv.mkDerivation rec { ''); meta = sbclBootstrap.meta; -} + + # For packages + passthru = let + spec' = spec // { pkg = sbcl; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; +}; +in sbcl diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix index bdd15fd4fcc1..830d642a3a7d 100644 --- a/pkgs/development/interpreters/clisp/default.nix +++ b/pkgs/development/interpreters/clisp/default.nix @@ -18,12 +18,19 @@ ] ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ] ++ lib.optional x11Support "clx/new-clx" +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "fas"; program = "clisp"; flags = "-E UTF-8"; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) }: assert x11Support -> (libX11 != null && libXau != null && libXt != null && libXpm != null && xorgproto != null && libXext != null); -stdenv.mkDerivation rec { +let clisp = stdenv.mkDerivation rec { version = "2.49"; pname = "clisp"; @@ -105,4 +112,14 @@ stdenv.mkDerivation rec { broken = stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64; license = lib.licenses.gpl2; }; -} + + passthru = let + spec' = spec // { pkg = clisp; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; + +}; in clisp diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix index 8ad72842dc78..53ccbcef558b 100644 --- a/pkgs/development/interpreters/clisp/hg.nix +++ b/pkgs/development/interpreters/clisp/hg.nix @@ -17,12 +17,19 @@ ] ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ] ++ lib.optional x11Support "clx/new-clx" +# For packages +, asdf_3_3 +, commonLispPackagesFor +, lispWithPackages +, build-asdf-system +, spec ? { faslExt = "fas"; program = "clisp"; flags = "-E UTF-8"; asdf = asdf_3_3; } +, packageOverrides ? (self: super: {}) }: assert x11Support -> (libX11 != null && libXau != null && libXt != null && libXpm != null && xorgproto != null && libXext != null); -stdenv.mkDerivation rec { +let clisp = stdenv.mkDerivation rec { version = "2.50pre20171114"; pname = "clisp"; @@ -95,4 +102,14 @@ stdenv.mkDerivation rec { # problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062 platforms = lib.platforms.linux; }; -} + + passthru = let + spec' = spec // { pkg = clisp; }; + pkgs = (commonLispPackagesFor spec').overrideScope' packageOverrides; + in { + inherit pkgs; + withPackages = lispWithPackages pkgs; + buildASDFSystem = args: build-asdf-system (args // spec'); + }; + +}; in clisp diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a422416b371b..3f4cb29bb3a9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -14046,8 +14046,6 @@ with pkgs; _4th = callPackage ../development/compilers/4th { }; - abcl = callPackage ../development/compilers/abcl { }; - temurin-bin-19 = javaPackages.compiler.temurin-bin.jdk-19; temurin-jre-bin-19 = javaPackages.compiler.temurin-bin.jre-19; @@ -14188,10 +14186,6 @@ with pkgs; cc65 = callPackage ../development/compilers/cc65 { }; - ccl = callPackage ../development/compilers/ccl { - inherit (buildPackages.darwin) bootstrap_cmds; - }; - cdb = callPackage ../development/tools/database/cdb { stdenv = gccStdenv; }; @@ -14292,11 +14286,6 @@ with pkgs; libcxxStdenv = if stdenv.isDarwin then stdenv else lowPrio llvmPackages.libcxxStdenv; rocmClangStdenv = llvmPackages_rocm.rocmClangStdenv; - clasp-common-lisp = callPackage ../development/compilers/clasp { - llvmPackages = llvmPackages_6; - stdenv = llvmPackages_6.stdenv; - }; - clean = callPackage ../development/compilers/clean { }; clickable = python3Packages.callPackage ../development/tools/clickable { }; @@ -14362,9 +14351,6 @@ with pkgs; dictu = callPackage ../development/compilers/dictu { }; - ecl = callPackage ../development/compilers/ecl { }; - ecl_16_1_2 = callPackage ../development/compilers/ecl/16.1.2.nix { }; - eli = callPackage ../development/compilers/eli { }; eql = callPackage ../development/compilers/eql {}; @@ -16034,22 +16020,6 @@ with pkgs; sagittarius-scheme = callPackage ../development/compilers/sagittarius-scheme {}; - sbclBootstrap = callPackage ../development/compilers/sbcl/bootstrap.nix {}; - sbcl_2_0_8 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.0.8"; }; - sbcl_2_0_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.0.9"; }; - sbcl_2_1_1 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.1"; }; - sbcl_2_1_2 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.2"; }; - sbcl_2_1_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.9"; }; - sbcl_2_1_10 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.10"; }; - sbcl_2_1_11 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.11"; }; - sbcl_2_2_4 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.4"; }; - sbcl_2_2_6 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.6"; }; - sbcl_2_2_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.9"; }; - sbcl_2_2_10 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.10"; }; - sbcl_2_2_11 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.11"; }; - sbcl_2_3_0 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.3.0"; }; - sbcl = sbcl_2_3_0; - roswell = callPackage ../development/tools/roswell { }; scala_2_10 = callPackage ../development/compilers/scala/2.x.nix { majorVersion = "2.10"; jre = jdk8; }; @@ -16369,15 +16339,6 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Security; }; - clisp = callPackage ../development/interpreters/clisp { - # On newer readline8 fails as: - # # - # does not have the required size or alignment - readline = readline63; - }; - - clisp-tip = callPackage ../development/interpreters/clisp/hg.nix { }; - clojupyter = callPackage ../applications/editors/jupyter-kernels/clojupyter { jre = jre8; }; @@ -24211,6 +24172,63 @@ with pkgs; asdf_3_1 = callPackage ../development/lisp-modules/asdf/3.1.nix { texLive = null; }; + # Latest + asdf_3_3 = callPackage ../development/lisp-modules/asdf/3.3.nix { + texLive = null; + }; + + inherit (callPackage ../development/lisp-modules/nix-cl.nix {}) + commonLispPackagesFor + lispWithPackages + build-asdf-system + ; + + # Armed Bear Common Lisp + abcl = callPackage ../development/compilers/abcl { }; + + # Clozure Common Lisp + ccl = callPackage ../development/compilers/ccl { + inherit (buildPackages.darwin) bootstrap_cmds; + }; + + # Clasp Common Lisp + clasp-common-lisp = callPackage ../development/compilers/clasp { + llvmPackages = llvmPackages_15; + stdenv = llvmPackages_15.stdenv; + }; + + # CLISP + clisp = callPackage ../development/interpreters/clisp { + # On newer readline8 fails as: + # # + # does not have the required size or alignment + readline = readline63; + }; + + clisp-tip = callPackage ../development/interpreters/clisp/hg.nix { }; + + # Embeddable Common Lisp + ecl = callPackage ../development/compilers/ecl { }; + ecl_16_1_2 = callPackage ../development/compilers/ecl/16.1.2.nix { }; + + # Steel Bank Common Lisp + sbclBootstrap = callPackage ../development/compilers/sbcl/bootstrap.nix {}; + sbcl_2_0_8 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.0.8"; }; + sbcl_2_0_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.0.9"; }; + sbcl_2_1_1 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.1"; }; + sbcl_2_1_2 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.2"; }; + sbcl_2_1_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.9"; }; + sbcl_2_1_10 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.10"; }; + sbcl_2_1_11 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.1.11"; }; + sbcl_2_2_4 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.4"; }; + sbcl_2_2_6 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.6"; }; + sbcl_2_2_9 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.9"; }; + sbcl_2_2_10 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.10"; }; + sbcl_2_2_11 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.2.11"; }; + sbcl_2_3_0 = callPackage ../development/compilers/sbcl/2.x.nix { version = "2.3.0"; }; + sbcl = sbcl_2_3_0; + + sbclPackages = recurseIntoAttrs sbcl.pkgs; ### DEVELOPMENT / PERL MODULES