diff options
author | Philip Taron <philip.taron@gmail.com> | 2023-12-12 10:10:39 -0800 |
---|---|---|
committer | Philip Taron <philip.taron@gmail.com> | 2023-12-13 23:40:35 -0800 |
commit | 3023b2d0bafcb115e3794543fdf321af7a3f184a (patch) | |
tree | 11323bee98f0d3e6e9962f9028971a9ffa180723 /pkgs/development/compilers | |
parent | aa9d4729cbc99dabacb50e3994dcefb3ea0f7447 (diff) |
clasp-common-lisp: use callPackage style instead of `with pkgs;`
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r-- | pkgs/development/compilers/clasp/default.nix | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/pkgs/development/compilers/clasp/default.nix b/pkgs/development/compilers/clasp/default.nix index c9fecafbd4600..a80f7c58aed60 100644 --- a/pkgs/development/compilers/clasp/default.nix +++ b/pkgs/development/compilers/clasp/default.nix @@ -1,7 +1,20 @@ -{ pkgs, lib, fetchFromGitHub, llvmPackages_15 }: - +{ lib +, llvmPackages_15 +, fetchFromGitHub +, sbcl +, git +, pkg-config +, fmt_9 +, gmpxx +, libelf +, boost +, libunwind +, ninja +, cacert +}: let + inherit (llvmPackages_15) stdenv llvm libclang; src = fetchFromGitHub { owner = "clasp-developers"; @@ -19,16 +32,20 @@ let "src/libatomic_ops" ]; - reposTarball = llvmPackages_15.stdenv.mkDerivation { + reposTarball = stdenv.mkDerivation { pname = "clasp-repos"; version = "tarball"; + inherit src; + patches = [ ./clasp-pin-repos-commits.patch ]; - nativeBuildInputs = with pkgs; [ + + nativeBuildInputs = [ sbcl git cacert ]; + buildPhase = '' export SOURCE_DATE_EPOCH=1 export ASDF_OUTPUT_TRANSLATIONS=$(pwd):$(pwd)/__fasls @@ -37,21 +54,27 @@ let find $x -type d -name .git -exec rm -rvf {} \; || true done ''; + installPhase = '' tar --owner=0 --group=0 --numeric-owner --format=gnu \ --sort=name --mtime="@$SOURCE_DATE_EPOCH" \ -czf $out ${lib.concatStringsSep " " reposDirs} ''; + outputHashMode = "flat"; outputHashAlgo = "sha256"; outputHash = "sha256-vgwThjn2h3nKnShtKoHgaPdH/FDHv28fLMQvKFEwG6o="; }; -in llvmPackages_15.stdenv.mkDerivation { +in + +stdenv.mkDerivation { pname = "clasp"; version = "2.2.0"; + inherit src; - nativeBuildInputs = (with pkgs; [ + + nativeBuildInputs = [ sbcl git pkg-config @@ -61,30 +84,32 @@ in llvmPackages_15.stdenv.mkDerivation { boost libunwind ninja - ]) ++ (with llvmPackages_15; [ llvm libclang - ]); + ]; + configurePhase = '' - export SOURCE_DATE_EPOCH=1 - export ASDF_OUTPUT_TRANSLATIONS=$(pwd):$(pwd)/__fasls - tar xf ${reposTarball} - sbcl --script koga \ - --skip-sync \ - --cc=$NIX_CC/bin/cc \ - --cxx=$NIX_CC/bin/c++ \ - --reproducible-build \ - --package-path=/ \ - --bin-path=$out/bin \ - --lib-path=$out/lib \ - --share-path=$out/share -''; + export SOURCE_DATE_EPOCH=1 + export ASDF_OUTPUT_TRANSLATIONS=$(pwd):$(pwd)/__fasls + tar xf ${reposTarball} + sbcl --script koga \ + --skip-sync \ + --cc=$NIX_CC/bin/cc \ + --cxx=$NIX_CC/bin/c++ \ + --reproducible-build \ + --package-path=/ \ + --bin-path=$out/bin \ + --lib-path=$out/lib \ + --share-path=$out/share + ''; + buildPhase = '' - ninja -C build -''; + ninja -C build + ''; + installPhase = '' - ninja -C build install -''; + ninja -C build install + ''; meta = { description = "A Common Lisp implementation based on LLVM with C++ integration"; @@ -93,9 +118,7 @@ in llvmPackages_15.stdenv.mkDerivation { platforms = ["x86_64-linux" "x86_64-darwin"]; # Upstream claims support, but breaks with: # error: use of undeclared identifier 'aligned_alloc' - broken = llvmPackages_15.stdenv.isDarwin; + broken = stdenv.isDarwin; homepage = "https://github.com/clasp-developers/clasp"; }; - } - |