-
-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
47 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,42 @@ | ||
{ stdenv, fetchFromGitHub, lib, pkgconfig, vte, gtk3, ncurses, makeWrapper, wrapGAppsHook, symlinkJoin | ||
, configFile ? null | ||
}: | ||
{ stdenv, fetchFromGitHub, pkgconfig, vte, gtk3, ncurses, wrapGAppsHook }: | ||
|
||
let | ||
stdenv.mkDerivation rec { | ||
name = "termite-${version}"; | ||
version = "13"; | ||
termite = stdenv.mkDerivation { | ||
name = "termite-${version}"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "thestinger"; | ||
repo = "termite"; | ||
rev = "v${version}"; | ||
sha256 = "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"; | ||
fetchSubmodules = true; | ||
}; | ||
src = fetchFromGitHub { | ||
owner = "thestinger"; | ||
repo = "termite"; | ||
rev = "v${version}"; | ||
sha256 = "02cn70ygl93ghhkhs3xdxn5b1yadc255v3yp8cmhhyzsv5027hvj"; | ||
fetchSubmodules = true; | ||
}; | ||
|
||
# https://github.com/thestinger/termite/pull/516 | ||
patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch | ||
] ++ lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch; | ||
# https://github.com/thestinger/termite/pull/516 | ||
patches = [ ./url_regexp_trailing.patch ./add_errno_header.patch | ||
] ++ stdenv.lib.optional stdenv.isDarwin ./remove_ldflags_macos.patch; | ||
|
||
makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; | ||
makeFlags = [ "VERSION=v${version}" "PREFIX=" "DESTDIR=$(out)" ]; | ||
|
||
buildInputs = [ vte gtk3 ncurses ]; | ||
buildInputs = [ vte gtk3 ncurses ]; | ||
|
||
nativeBuildInputs = [ wrapGAppsHook pkgconfig ]; | ||
nativeBuildInputs = [ wrapGAppsHook pkgconfig ]; | ||
|
||
outputs = [ "out" "terminfo" ]; | ||
outputs = [ "out" "terminfo" ]; | ||
|
||
postInstall = '' | ||
mkdir -p $terminfo/share | ||
mv $out/share/terminfo $terminfo/share/terminfo | ||
postInstall = '' | ||
mkdir -p $terminfo/share | ||
mv $out/share/terminfo $terminfo/share/terminfo | ||
mkdir -p $out/nix-support | ||
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages | ||
''; | ||
mkdir -p $out/nix-support | ||
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages | ||
''; | ||
|
||
meta = with stdenv.lib; { | ||
description = "A simple VTE-based terminal"; | ||
license = licenses.lgpl2Plus; | ||
homepage = https://github.com/thestinger/termite/; | ||
maintainers = with maintainers; [ koral garbas ]; | ||
platforms = platforms.all; | ||
}; | ||
meta = with stdenv.lib; { | ||
description = "A simple VTE-based terminal"; | ||
license = licenses.lgpl2Plus; | ||
homepage = https://github.com/thestinger/termite/; | ||
maintainers = with maintainers; [ koral garbas ]; | ||
platforms = platforms.all; | ||
}; | ||
in if configFile == null then termite else symlinkJoin { | ||
name = "termite-with-config-${version}"; | ||
paths = [ termite ]; | ||
nativeBuildInputs = [ makeWrapper ]; | ||
postBuild = '' | ||
wrapProgram $out/bin/termite \ | ||
--add-flags "--config ${configFile}" | ||
''; | ||
passthru.terminfo = termite.terminfo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ makeWrapper, wrapGAppsHook, symlinkJoin, configFile ? null, termite }: | ||
|
||
if configFile == null then termite else symlinkJoin { | ||
name = "termite-with-config-${termite.version}"; | ||
|
||
paths = [ termite ]; | ||
nativeBuildInputs = [ makeWrapper ]; | ||
|
||
postBuild = '' | ||
wrapProgram $out/bin/termite \ | ||
--add-flags "--config ${configFile}" | ||
''; | ||
|
||
passthru.terminfo = termite.terminfo; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters