biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / applications / terminal-emulators / termite / default.nix
blobab854a2f99069eb5872bb2a3a70c236c56d151f1
1 { lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, vte, gtk3, ncurses, pcre2, wrapGAppsHook, nixosTests }:
3 let
5   # termite requires VTE with some internals exposed
6   # https://github.com/thestinger/vte-ng
7   #
8   # three of the patches have been locally modified to cleanly apply on 0.62
9   vte-ng =  vte.overrideAttrs (attrs: {
10     patches = attrs.patches or [] ++ [
11       (fetchpatch {
12         name = "0001-expose-functions-for-pausing-unpausing-output.patch";
13         url = "https://github.com/thestinger/vte-ng/commit/342e26574f50dcd40bbeaad9e839c2a6144d0c1c.patch";
14         sha256 = "1b0k9ys545q85vfki417p21kis9f36yd0hyp12phayynss6fn715";
15       })
16       # Derived from https://github.com/thestinger/vte-ng/commit/5ae3acb69474fe5bc43767a4a3625e9ed23607a1.patch
17       ./vte-ng-modified-patches/vte-0002-expose-function-for-setting-cursor-position.patch
18       # Derived from https://github.com/thestinger/vte-ng/commit/742d57ecf15e24f6a5f2133a81b6c70acc8ff03c.patch
19       ./vte-ng-modified-patches/vte-0003-add-function-for-setting-the-text-selections.patch
20       (fetchpatch {
21         name = "0004-add-functions-to-get-set-block-selection-mode.patch";
22         url = "https://github.com/thestinger/vte-ng/commit/08748fd9cb82bd191e5c476b1682ca71f7732572.patch";
23         sha256 = "1cnhd8f7ywdgcyd6xmcd2nn39jjxzkxp4d0zsj2k7m5v74nhcs1g";
24       })
25       # Derived from "https://github.com/thestinger/vte-ng/commit/dd74ae7c06e8888af2fc090ac6f8920a9d8227fb.patch";
26       ./vte-ng-modified-patches/vte-0005-expose-function-for-getting-the-selected-text.patch
27     ];
28   });
30 in stdenv.mkDerivation rec {
31   pname = "termite";
32   version = "15";
34   src = fetchFromGitHub {
35     owner = "thestinger";
36     repo = "termite";
37     rev = "v${version}";
38     sha256 = "0hp1x6lj098m3jgna274wv5dv60lnzg22297di68g4hw9djjyd2k";
39     fetchSubmodules = true;
40   };
42   # https://github.com/thestinger/termite/pull/516
43   patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch
44     # Fix off-by-one in select_text() on libvte >= 0.55.0
45     # Expected to be included in next release (16).
46     (fetchpatch {
47       url = "https://github.com/thestinger/termite/commit/7e9a93b421b9596f8980645a46ac2ad5468dac06.patch";
48       sha256 = "0vph2m5919f7w1xnc8i6z0j44clsm1chxkfg7l71nahxyfw5yh4j";
49     })
50   ] ++ lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch;
52   makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
54   buildInputs = [ vte-ng gtk3 ncurses pcre2 ];
56   nativeBuildInputs = [ wrapGAppsHook pkg-config ];
58   outputs = [ "out" "terminfo" ];
60   passthru = {
61     inherit vte-ng;
62     tests = nixosTests.terminal-emulators.termite;
63   };
65   postInstall = ''
66     mkdir -p $terminfo/share
67     mv $out/share/terminfo $terminfo/share/terminfo
69     mkdir -p $out/nix-support
70     echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
71   '';
73   meta = with lib; {
74     description = "A simple VTE-based terminal";
75     license = licenses.lgpl2Plus;
76     homepage = "https://github.com/thestinger/termite/";
77     maintainers = with maintainers; [ koral ];
78     platforms = platforms.all;
79     mainProgram = "termite";
80   };