2016-09-06 04:25:18 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, bundlerEnv, ruby
|
2016-08-31 04:26:23 +01:00
|
|
|
, withPostgresql ? true, postgresql
|
|
|
|
, withSqlite ? false, sqlite
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
_name = "ledger-web";
|
|
|
|
cmd = "ledger_web";
|
|
|
|
|
|
|
|
env = bundlerEnv {
|
2016-09-06 04:25:18 +01:00
|
|
|
name = "${_name}-env";
|
2016-08-31 04:26:23 +01:00
|
|
|
inherit ruby;
|
|
|
|
gemfile = ./Gemfile;
|
|
|
|
lockfile = ./Gemfile.lock;
|
|
|
|
gemset = ./gemset.nix;
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = https://github.com/peterkeen/ledger-web;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ peterhoeg ];
|
|
|
|
license = licenses.mit;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "${_name}-${version}";
|
|
|
|
version = "1.5.2";
|
|
|
|
|
2016-09-06 04:25:18 +01:00
|
|
|
buildInputs = [ env ruby ]
|
2016-08-31 04:26:23 +01:00
|
|
|
++ lib.optional withPostgresql postgresql
|
|
|
|
++ lib.optional withSqlite sqlite;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "peterkeen";
|
|
|
|
repo = _name;
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0an4d46h3pp7a8s96jl0dnw1imwdgnb2j474b9wrbidwc6cmfrm7";
|
|
|
|
};
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
installPhase = ''
|
2016-09-06 04:25:18 +01:00
|
|
|
mkdir -p $out/bin
|
2016-08-31 04:26:23 +01:00
|
|
|
|
2016-09-06 04:25:18 +01:00
|
|
|
cp --no-preserve=mode -r lib $out
|
2016-08-31 04:26:23 +01:00
|
|
|
|
2016-09-06 04:25:18 +01:00
|
|
|
ln -s ${env}/bin/${cmd} $out/bin/${cmd}
|
2016-08-31 04:26:23 +01:00
|
|
|
'';
|
|
|
|
}
|