2019-11-15 16:26:08 +01:00
|
|
|
{ pkgs, ... }:
|
2017-12-29 16:42:10 +01:00
|
|
|
|
2019-11-15 16:26:08 +01:00
|
|
|
let
|
|
|
|
inherit (pkgs) stdenv sbcl lispPackages elmPackages makeWrapper openssl;
|
2019-09-02 03:14:39 +02:00
|
|
|
|
2019-11-15 16:26:08 +01:00
|
|
|
frontend = stdenv.mkDerivation {
|
|
|
|
name = "gemma-frontend";
|
|
|
|
src = ./frontend;
|
|
|
|
buildInputs = [ elmPackages.elm ];
|
|
|
|
|
|
|
|
phases = [ "unpackPhase" "buildPhase" ];
|
|
|
|
buildPhase = ''
|
|
|
|
mkdir .home && export HOME="$PWD/.home"
|
|
|
|
mkdir -p $out
|
|
|
|
elm-make --yes Main.elm --output $out/index.html
|
|
|
|
'';
|
|
|
|
};
|
2019-09-02 03:14:39 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2017-12-29 16:42:10 +01:00
|
|
|
name = "gemma";
|
|
|
|
src = ./.;
|
|
|
|
|
2019-09-02 03:14:39 +02:00
|
|
|
nativeBuildInputs = with lispPackages; [
|
2017-12-29 16:42:10 +01:00
|
|
|
sbcl
|
|
|
|
hunchentoot
|
|
|
|
cl-json
|
2019-09-02 03:14:39 +02:00
|
|
|
cffi
|
|
|
|
cl-prevalence
|
2017-12-29 16:42:10 +01:00
|
|
|
local-time
|
2019-09-02 03:14:39 +02:00
|
|
|
makeWrapper
|
2017-12-29 16:42:10 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
buildPhase = ''
|
2018-01-03 16:54:45 +01:00
|
|
|
mkdir -p $out/share/gemma $out/bin
|
2017-12-29 16:42:10 +01:00
|
|
|
|
2019-09-02 03:14:39 +02:00
|
|
|
# Build Lisp using the Nix-provided wrapper which sets the load
|
|
|
|
# paths correctly.
|
2017-12-29 16:42:10 +01:00
|
|
|
cd $src
|
2019-09-02 03:14:39 +02:00
|
|
|
env GEMMA_BIN_TARGET=$out/bin/gemma common-lisp.sh --load build.lisp
|
|
|
|
|
|
|
|
# Wrap gemma to find OpenSSL at runtime:
|
|
|
|
wrapProgram $out/bin/gemma --prefix LD_LIBRARY_PATH : "${openssl.out}/lib"
|
|
|
|
|
|
|
|
# and finally copy the frontend to the appropriate spot
|
|
|
|
cp ${frontend}/index.html $out/share/gemma/index.html
|
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;
|
2019-09-22 18:20:00 +02:00
|
|
|
|
|
|
|
# Lisp builds are broken for some reason (2019-09-22)
|
|
|
|
broken = true;
|
2017-12-29 16:42:10 +01:00
|
|
|
};
|
|
|
|
}
|