1{ lib, stdenv, fetchFromGitHub, gcc }:
2
3stdenv.mkDerivation rec {
4 pname = "cakelisp";
5 version = "0.1.0";
6
7 src = fetchFromGitHub {
8 owner = "makuto";
9 repo = "cakelisp";
10 rev = "v${version}";
11 sha256 = "126va59jy7rvy6c2wrf8j44m307f2d8jixqkc49s9wllxprj1dmg";
12 };
13
14 buildInputs = [ gcc ];
15
16 postPatch = ''
17 substituteInPlace runtime/HotReloading.cake \
18 --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
19 substituteInPlace src/ModuleManager.cpp \
20 --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
21 '' + lib.optionalString stdenv.isDarwin ''
22 substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic'
23 substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic'
24 substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic'
25 '';
26
27 buildPhase = ''
28 ./Build.sh
29 '';
30
31 installPhase = ''
32 install -Dm755 bin/cakelisp -t $out/bin
33 '';
34
35 meta = with lib; {
36 description = "A performance-oriented Lisp-like language";
37 homepage = "https://github.com/makuto/cakelisp";
38 license = licenses.gpl3Plus;
39 platforms = platforms.darwin ++ platforms.linux;
40 maintainers = [ maintainers.sbond75 ];
41 };
42}