2017-12-29 16:42:10 +01:00
|
|
|
with import <nixpkgs> {};
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "gemma";
|
|
|
|
|
|
|
|
src = ./.;
|
|
|
|
|
2019-08-15 17:07:11 +02:00
|
|
|
# For the time being, Gemma can not be built because it requires an
|
|
|
|
# older version of Elm than what is available and Elm upgrade paths
|
|
|
|
# are painful.
|
|
|
|
broken = true;
|
|
|
|
|
2017-12-29 16:42:10 +01:00
|
|
|
buildInputs = with lispPackages; [
|
|
|
|
sbcl
|
|
|
|
quicklisp
|
|
|
|
hunchentoot
|
|
|
|
cl-json
|
|
|
|
local-time
|
|
|
|
elmPackages.elm
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
# The build phase has three distinct things it needs to do:
|
|
|
|
#
|
|
|
|
# 1. "Compile" the Elm source into something useful to browsers.
|
|
|
|
#
|
|
|
|
# 2. Configure the Lisp part of the application to serve the compiled Elm
|
|
|
|
#
|
|
|
|
# 3. Build (and don't strip!) an executable out of the Lisp backend.
|
|
|
|
buildPhase = ''
|
2018-01-03 16:54:45 +01:00
|
|
|
mkdir -p $out/share/gemma $out/bin
|
2017-12-29 16:42:10 +01:00
|
|
|
mkdir .home && export HOME="$PWD/.home"
|
|
|
|
|
|
|
|
# Build Elm
|
|
|
|
cd frontend
|
|
|
|
elm-make --yes Main.elm --output $out/share/gemma/index.html
|
|
|
|
|
|
|
|
# Build Lisp
|
|
|
|
cd $src
|
|
|
|
quicklisp init
|
2018-01-03 17:10:07 +01:00
|
|
|
env GEMMA_BIN_TARGET=$out/bin/gemma sbcl --load build.lisp
|
2017-12-29 16:42:10 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = "true";
|
|
|
|
|
|
|
|
# Stripping an SBCL executable removes the application, which is unfortunate.
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Tool for tracking recurring tasks";
|
|
|
|
homepage = "https://github.com/tazjin/gemma";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
};
|
|
|
|
}
|