2024-01-02 11:29:13 +00:00
|
|
|
{ lib
|
|
|
|
, llvmPackages_15
|
|
|
|
, fetchFromGitHub
|
|
|
|
, sbcl
|
|
|
|
, git
|
|
|
|
, pkg-config
|
|
|
|
, fmt_9
|
|
|
|
, gmpxx
|
|
|
|
, libelf
|
|
|
|
, boost
|
|
|
|
, libunwind
|
|
|
|
, ninja
|
|
|
|
, cacert
|
|
|
|
}:
|
2023-04-12 12:48:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
let
|
2024-01-02 11:29:13 +00:00
|
|
|
inherit (llvmPackages_15) stdenv llvm libclang;
|
|
|
|
|
|
|
|
# Gathered from https://github.com/clasp-developers/clasp/raw/2.2.0/repos.sexp
|
|
|
|
dependencies = import ./dependencies.nix {
|
|
|
|
inherit fetchFromGitHub;
|
|
|
|
};
|
|
|
|
|
|
|
|
# Shortened version of `_defaultUnpack`
|
|
|
|
unpackDependency = elem: ''
|
|
|
|
mkdir -p "source/${elem.directory}"
|
|
|
|
cp -pr --reflink=auto -- ${elem.src}/* "source/${elem.directory}"
|
|
|
|
chmod -R u+w -- "source/${elem.directory}"
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "clasp";
|
|
|
|
version = "2.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
patches = [
|
|
|
|
./clasp-pin-repos-commits.patch
|
|
|
|
./remove-unused-command-line-argument.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
nativeBuildInputs = [
|
2023-04-12 12:48:02 +00:00
|
|
|
sbcl
|
|
|
|
git
|
|
|
|
pkg-config
|
2023-07-15 17:15:38 +00:00
|
|
|
fmt_9
|
2023-04-12 12:48:02 +00:00
|
|
|
gmpxx
|
|
|
|
libelf
|
|
|
|
boost
|
|
|
|
libunwind
|
|
|
|
ninja
|
|
|
|
llvm
|
|
|
|
libclang
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
ninjaFlags = [ "-C" "build" ];
|
|
|
|
|
|
|
|
postUnpack = lib.concatStringsSep "\n" (builtins.map unpackDependency dependencies);
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
configurePhase = ''
|
2024-01-02 11:29:13 +00:00
|
|
|
export SOURCE_DATE_EPOCH=1
|
|
|
|
export ASDF_OUTPUT_TRANSLATIONS=$(pwd):$(pwd)/__fasls
|
|
|
|
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
|
|
|
|
'';
|
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'
|
2024-01-02 11:29:13 +00:00
|
|
|
broken = stdenv.isDarwin;
|
2023-04-12 12:48:02 +00:00
|
|
|
homepage = "https://github.com/clasp-developers/clasp";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|