nixpkgs/pkgs/applications/office/ledger-web/default.nix

49 lines
1.0 KiB
Nix
Raw Normal View History

{ 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 {
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";
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 = ''
mkdir -p $out/bin
2016-08-31 04:26:23 +01:00
cp --no-preserve=mode -r lib $out
2016-08-31 04:26:23 +01:00
ln -s ${env}/bin/${cmd} $out/bin/${cmd}
2016-08-31 04:26:23 +01:00
'';
}