2016-09-28 11:11:50 +01:00
|
|
|
{ stdenv, fetchgit, pkgconfig, vte, gtk3, ncurses, makeWrapper, symlinkJoin
|
2016-05-17 00:50:43 +01:00
|
|
|
, configFile ? null
|
|
|
|
}:
|
2014-09-18 22:07:35 +01:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
let
|
2016-10-03 07:19:57 +01:00
|
|
|
version = "12";
|
2016-05-17 00:50:43 +01:00
|
|
|
termite = stdenv.mkDerivation {
|
|
|
|
name = "termite-${version}";
|
2014-09-18 22:07:35 +01:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/thestinger/termite";
|
|
|
|
rev = "refs/tags/v${version}";
|
2016-10-03 07:19:57 +01:00
|
|
|
sha256 = "0s6dyg3vcqk5qcx90bs24wdnd3p56rdjdcanx4pcxvp6ksjl61jz";
|
2016-05-17 00:50:43 +01:00
|
|
|
};
|
2014-09-18 22:07:35 +01:00
|
|
|
|
2016-06-19 09:18:30 +01:00
|
|
|
postPatch = "sed '1i#include <math.h>' -i termite.cc";
|
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
|
2014-09-18 22:07:35 +01:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
buildInputs = [ pkgconfig vte gtk3 ncurses ];
|
2014-09-18 22:07:35 +01:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
outputs = [ "out" "terminfo" ];
|
2016-02-25 21:52:13 +00:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $terminfo/share
|
|
|
|
mv $out/share/terminfo $terminfo/share/terminfo
|
2016-02-25 21:52:13 +00:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
2016-02-25 21:52:13 +00:00
|
|
|
|
2016-05-17 00:50:43 +01:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A simple VTE-based terminal";
|
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
homepage = https://github.com/thestinger/termite/;
|
2016-05-17 07:08:32 +01:00
|
|
|
maintainers = with maintainers; [ koral garbas ];
|
2016-05-17 00:50:43 +01:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2014-09-18 22:07:35 +01:00
|
|
|
};
|
2016-09-28 11:11:50 +01:00
|
|
|
in if configFile == null then termite else symlinkJoin {
|
2016-05-17 00:50:43 +01:00
|
|
|
name = "termite-with-config-${version}";
|
2016-09-28 11:11:50 +01:00
|
|
|
paths = [ termite ];
|
2016-05-17 00:50:43 +01:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2016-09-28 11:11:50 +01:00
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/termite \
|
|
|
|
--add-flags "--config ${configFile}"
|
2016-05-17 00:50:43 +01:00
|
|
|
'';
|
|
|
|
passthru.terminfo = termite.terminfo;
|
2014-09-18 22:07:35 +01:00
|
|
|
}
|