git.iko.soy/typeable/nixpkgs
on master help sign in
termite: factor wrapper out into its own file (#43691)

Until now it's impossible to override the attrs of the actual build instruction for the `termite` package like this: ``` termite.overrideAttrs (_: { # ... }) ``` This issue occurs since the `termite/default.nix` expressions returns the `symlinkJoin` expression when I override termite (e.g. to provide a config file). I recently patched termite and wanted to apply this patch to my local termite installation in my system config which is impossible this, so splitting the wrapper and the build instruction into their own files makes this way easier to maintian.

commit134c5cc8dbf317584b2e53273e4bacd59e20b9f7 authorMaximilian Bosch <maximilian@mbosch.me> dateWed 1 Aug 2018, 16:09 (8 years ago) parent2b75a72
3 files changed+47−43
pkgs/applications/misc/termite/default.nix+29−42 pkgs/applications/misc/termite/wrapper.nix+15 pkgs/top-level/all-packages.nix+3−1
pkgs/applications/misc/termite/default.nix+29−42
@@ -1,55 +1,42 @@
1−{ stdenv, fetchFromGitHub, lib, pkgconfig, vte, gtk3, ncurses, makeWrapper, wrapGAppsHook, symlinkJoin
2−, configFile ? null
3−}:
1+{ stdenv, fetchFromGitHub, pkgconfig, vte, gtk3, ncurses, wrapGAppsHook }:
42
5−let
3+stdenv.mkDerivation rec {
4+ name = "termite-${version}";
65 version = "13";
7− termite = stdenv.mkDerivation {
8− name = "termite-${version}";
96
10− src = fetchFromGitHub {
11− owner = "thestinger";
12− repo = "termite";
13− rev = "v${version}";
14− sha256 = "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj";
15− fetchSubmodules = true;
16− };
7+ src = fetchFromGitHub {
8+ owner = "thestinger";
9+ repo = "termite";
10+ rev = "v${version}";
11+ sha256 = "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj";
12+ fetchSubmodules = true;
13+ };
1714
18− # https://github.com/thestinger/termite/pull/516
19− patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch
20− ] ++ lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch;
15+ # https://github.com/thestinger/termite/pull/516
16+ patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch
17+ ] ++ stdenv.lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch;
2118
22− makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
19+ makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ];
2320
24− buildInputs = [ vte gtk3 ncurses ];
21+ buildInputs = [ vte gtk3 ncurses ];
2522
26− nativeBuildInputs = [ wrapGAppsHook pkgconfig ];
23+ nativeBuildInputs = [ wrapGAppsHook pkgconfig ];
2724
28− outputs = [ "out" "terminfo" ];
25+ outputs = [ "out" "terminfo" ];
2926
30− postInstall = ''
31− mkdir -p $terminfo/share
32− mv $out/share/terminfo $terminfo/share/terminfo
27+ postInstall = ''
28+ mkdir -p $terminfo/share
29+ mv $out/share/terminfo $terminfo/share/terminfo
3330
34− mkdir -p $out/nix-support
35− echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
36− '';
31+ mkdir -p $out/nix-support
32+ echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
33+ '';
3734
38− meta = with stdenv.lib; {
39− description = "A simple VTE-based terminal";
40− license = licenses.lgpl2Plus;
41− homepage = https://github.com/thestinger/termite/;
42− maintainers = with maintainers; [ koral garbas ];
43− platforms = platforms.all;
44− };
35+ meta = with stdenv.lib; {
36+ description = "A simple VTE-based terminal";
37+ license = licenses.lgpl2Plus;
38+ homepage = https://github.com/thestinger/termite/;
39+ maintainers = with maintainers; [ koral garbas ];
40+ platforms = platforms.all;
4541 };
46−in if configFile == null then termite else symlinkJoin {
47− name = "termite-with-config-${version}";
48− paths = [ termite ];
49− nativeBuildInputs = [ makeWrapper ];
50− postBuild = ''
51− wrapProgram $out/bin/termite \
52− --add-flags "--config ${configFile}"
53− '';
54− passthru.terminfo = termite.terminfo;
5542}
pkgs/applications/misc/termite/wrapper.nixnew file+15
@@ -0,0 +1,15 @@
1+{ makeWrapper, wrapGAppsHook, symlinkJoin, configFile ? null, termite }:
2+
3+if configFile == null then termite else symlinkJoin {
4+ name = "termite-with-config-${termite.version}";
5+
6+ paths = [ termite ];
7+ nativeBuildInputs = [ makeWrapper ];
8+
9+ postBuild = ''
10+ wrapProgram $out/bin/termite \
11+ --add-flags "--config ${configFile}"
12+ '';
13+
14+ passthru.terminfo = termite.terminfo;
15+}
pkgs/top-level/all-packages.nix+3−1
@@ -18549,10 +18549,12 @@ with pkgs;
1854918549 vte = gnome3.vte;
1855018550 };
1855118551
18552− termite = callPackage ../applications/misc/termite {
18552+ termite-unwrapped = callPackage ../applications/misc/termite {
1855318553 vte = gnome3.vte-ng;
1855418554 };
1855518555
18556+ termite = callPackage ../applications/misc/termite/wrapper.nix { termite = termite-unwrapped; };
18557+
1855618558 termtosvg = callPackage ../tools/misc/termtosvg { };
1855718559
1855818560 tesseract = callPackage ../applications/graphics/tesseract { };