stockholm/krebs/5pkgs/htgen/default.nix

29 lines
670 B
Nix
Raw Normal View History

2017-04-13 14:25:17 +00:00
{ coreutils, dash, fetchgit, gnused, stdenv, ucspi-tcp }:
2017-03-16 19:56:08 +00:00
with import <stockholm/lib>;
let
2017-04-13 14:25:17 +00:00
version = "1.2.2";
2017-03-16 19:56:08 +00:00
in stdenv.mkDerivation {
name = "htgen-${version}";
src = fetchgit {
url = "http://cgit.krebsco.de/htgen";
2017-03-16 20:53:05 +00:00
rev = "refs/tags/v${version}";
2017-04-13 14:25:17 +00:00
sha256 = "0a8vn35vq6pxgk6d3d2cjp0vdxzq9nqf0zgkvnd6668v4cmdf91b";
2017-03-16 19:56:08 +00:00
};
installPhase = ''
mkdir -p $out/bin
{
2017-04-13 14:25:17 +00:00
echo '#! ${dash}/bin/dash'
2017-03-16 19:56:08 +00:00
echo 'export PATH=${makeBinPath [
coreutils
gnused
2017-04-13 14:25:17 +00:00
ucspi-tcp
2017-03-16 20:53:05 +00:00
]}''${PATH+":$PATH"}'
2017-04-13 14:25:17 +00:00
sed 's:^Server=htgen$:&/${version}:' htgen
2017-03-16 19:56:08 +00:00
} > $out/bin/htgen
chmod +x $out/bin/htgen
2017-03-16 20:53:05 +00:00
cp -r examples $out
2017-03-16 19:56:08 +00:00
'';
}