2024-02-29 20:09:43 +00:00
|
|
|
{ lib, stdenv, fetchgit, fetchpatch, gcc, unstableGitUpdater }:
|
2021-01-09 10:05:03 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "cakelisp";
|
2024-02-29 20:09:43 +00:00
|
|
|
# using unstable as it's the only version that builds against gcc-13
|
|
|
|
version = "0.3.0-unstable-2023-12-18";
|
2021-01-09 10:05:03 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://macoy.me/code/macoy/cakelisp";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = "866fa2806d3206cc9dd398f0e86640db5be42bd6";
|
|
|
|
hash = "sha256-vwMZUNy+updwk69ahA/D9LhO68eV6wH0Prq+o/i1Q/A=";
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gcc ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace runtime/HotReloading.cake \
|
|
|
|
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
|
|
|
|
substituteInPlace src/ModuleManager.cpp \
|
|
|
|
--replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
|
2021-02-05 17:12:51 +00:00
|
|
|
'' + lib.optionalString stdenv.isDarwin ''
|
2021-01-09 10:05:03 +00:00
|
|
|
substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic'
|
|
|
|
substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic'
|
|
|
|
substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic'
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook preBuild
|
2021-01-09 10:05:03 +00:00
|
|
|
./Build.sh
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook postBuild
|
2021-01-09 10:05:03 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook preInstall
|
2021-01-09 10:05:03 +00:00
|
|
|
install -Dm755 bin/cakelisp -t $out/bin
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook postInstall
|
2021-01-09 10:05:03 +00:00
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.updateScript = unstableGitUpdater {
|
|
|
|
url = "https://macoy.me/code/macoy/cakelisp";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2021-01-09 10:05:03 +00:00
|
|
|
description = "A performance-oriented Lisp-like language";
|
2023-05-24 13:37:59 +00:00
|
|
|
homepage = "https://macoy.me/code/macoy/cakelisp";
|
2021-01-09 10:05:03 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.darwin ++ platforms.linux;
|
|
|
|
maintainers = [ maintainers.sbond75 ];
|
2022-12-17 10:02:37 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2021-01-09 10:05:03 +00:00
|
|
|
};
|
|
|
|
}
|