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