2023-04-12 12:48:02 +00:00
|
|
|
{ pkgs, lib, fetchFromGitHub, llvmPackages_15 }:
|
|
|
|
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-04-12 12:48:02 +00:00
|
|
|
owner = "clasp-developers";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "clasp";
|
2023-04-12 12:48:02 +00:00
|
|
|
rev = "2.2.0";
|
|
|
|
hash = "sha256-gvUqUb0dftW1miiBcAPJur0wOunox4y2SUYeeJpR9R4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
reposDirs = [
|
|
|
|
"dependencies"
|
|
|
|
"src/lisp/kernel/contrib"
|
|
|
|
"src/lisp/modules/asdf"
|
|
|
|
"src/mps"
|
|
|
|
"src/bdwgc"
|
|
|
|
"src/libatomic_ops"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
reposTarball = llvmPackages_15.stdenv.mkDerivation {
|
|
|
|
pname = "clasp-repos";
|
|
|
|
version = "tarball";
|
|
|
|
inherit src;
|
|
|
|
patches = [ ./clasp-pin-repos-commits.patch ];
|
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
sbcl
|
|
|
|
git
|
|
|
|
cacert
|
|
|
|
];
|
|
|
|
buildPhase = ''
|
|
|
|
export SOURCE_DATE_EPOCH=1
|
|
|
|
export ASDF_OUTPUT_TRANSLATIONS=$(pwd):$(pwd)/__fasls
|
|
|
|
sbcl --script koga --help
|
|
|
|
for x in {${lib.concatStringsSep "," reposDirs}}; do
|
|
|
|
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=";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
in llvmPackages_15.stdenv.mkDerivation {
|
|
|
|
pname = "clasp";
|
|
|
|
version = "2.2.0";
|
|
|
|
inherit src;
|
|
|
|
nativeBuildInputs = (with pkgs; [
|
|
|
|
sbcl
|
|
|
|
git
|
|
|
|
pkg-config
|
|
|
|
fmt
|
|
|
|
gmpxx
|
|
|
|
libelf
|
|
|
|
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
|
|
|
|
'';
|
|
|
|
buildPhase = ''
|
|
|
|
ninja -C build
|
|
|
|
'';
|
|
|
|
installPhase = ''
|
|
|
|
ninja -C build install
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = {
|
2021-01-17 00:15:33 +00:00
|
|
|
description = "A Common Lisp implementation based on LLVM with C++ integration";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.lgpl21Plus ;
|
2023-04-12 12:48:02 +00:00
|
|
|
maintainers = lib.teams.lisp.members;
|
|
|
|
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;
|
|
|
|
homepage = "https://github.com/clasp-developers/clasp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
2023-04-12 12:48:02 +00:00
|
|
|
|