mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +00:00
rxvt-unicode: rewrite plugin system
This commit is contained in:
parent
7a15db35d8
commit
27b3df0840
20
pkgs/applications/misc/rxvt-unicode-plugins/default.nix
Normal file
20
pkgs/applications/misc/rxvt-unicode-plugins/default.nix
Normal file
@ -0,0 +1,20 @@
|
||||
{ callPackage }:
|
||||
|
||||
{
|
||||
autocomplete-all-the-things = callPackage ./urxvt-autocomplete-all-the-things { };
|
||||
|
||||
bidi = callPackage ./urxvt-bidi { };
|
||||
|
||||
font-size = callPackage ./urxvt-font-size { };
|
||||
|
||||
perl = callPackage ./urxvt-perl { };
|
||||
|
||||
perls = callPackage ./urxvt-perls { };
|
||||
|
||||
tabbedex = callPackage ./urxvt-tabbedex { };
|
||||
|
||||
theme-switch = callPackage ./urxvt-theme-switch { };
|
||||
|
||||
vtwheel = callPackage ./urxvt-vtwheel { };
|
||||
|
||||
}
|
@ -16,6 +16,8 @@ perlPackages.buildPerlPackage rec {
|
||||
install -Dm555 misc/bidi "$out/lib/urxvt/perl/bidi"
|
||||
'';
|
||||
|
||||
passthru.perlPackages = [ "self" ];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Text::Bidi Perl package using fribidi, providing a urxvt plugin";
|
||||
homepage = "https://github.com/mkamensky/Text-Bidi";
|
46
pkgs/applications/misc/rxvt-unicode/wrapper.nix
Normal file
46
pkgs/applications/misc/rxvt-unicode/wrapper.nix
Normal file
@ -0,0 +1,46 @@
|
||||
{ callPackage
|
||||
, symlinkJoin
|
||||
, makeWrapper
|
||||
, lib
|
||||
, rxvt-unicode-unwrapped
|
||||
, perlPackages
|
||||
}:
|
||||
|
||||
let
|
||||
availablePlugins = import ../rxvt-unicode-plugins { inherit callPackage; };
|
||||
|
||||
wrapper =
|
||||
{ configure ? { availablePlugins, ... }:
|
||||
{ plugins = builtins.attrValues availablePlugins;
|
||||
extraDeps = [ ];
|
||||
perlDeps = [ ];
|
||||
}
|
||||
}:
|
||||
|
||||
let
|
||||
config = configure { inherit availablePlugins; };
|
||||
plugins = config.plugins or (builtins.attrValues availablePlugins);
|
||||
extraDeps = config.extraDeps or [ ];
|
||||
perlDeps = (config.perlDeps or [ ]) ++ lib.concatMap (p: p.perlPackages or [ ]) plugins;
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "rxvt-unicode-${rxvt-unicode-unwrapped.version}";
|
||||
|
||||
paths = [ rxvt-unicode-unwrapped ] ++ plugins ++ extraDeps;
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/urxvt \
|
||||
--prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
|
||||
--suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
|
||||
wrapProgram $out/bin/urxvtd \
|
||||
--prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
|
||||
--suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
|
||||
'';
|
||||
|
||||
passthru.plugins = plugins;
|
||||
};
|
||||
|
||||
in
|
||||
lib.makeOverridable wrapper { }
|
@ -1,23 +0,0 @@
|
||||
{ symlinkJoin, rxvt_unicode, makeWrapper, plugins, perlPackages, perlDeps ? []}:
|
||||
|
||||
let
|
||||
rxvt_name = builtins.parseDrvName rxvt_unicode.name;
|
||||
|
||||
in symlinkJoin {
|
||||
name = "${rxvt_name.name}-with-plugins-${rxvt_name.version}";
|
||||
|
||||
paths = [ rxvt_unicode ] ++ plugins;
|
||||
|
||||
buildInputs = [ makeWrapper ];
|
||||
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/urxvt \
|
||||
--prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
|
||||
--suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
|
||||
wrapProgram $out/bin/urxvtd \
|
||||
--prefix PERL5LIB : "${perlPackages.makePerlPath perlDeps}" \
|
||||
--suffix-each URXVT_PERL_LIB ':' "$out/lib/urxvt/perl"
|
||||
'';
|
||||
|
||||
passthru.plugins = plugins;
|
||||
}
|
@ -21229,35 +21229,9 @@ in
|
||||
|
||||
rxvt = callPackage ../applications/misc/rxvt { };
|
||||
|
||||
# urxvt
|
||||
rxvt_unicode = callPackage ../applications/misc/rxvt_unicode { };
|
||||
rxvt-unicode = callPackage ../applications/misc/rxvt-unicode/wrapper.nix { };
|
||||
|
||||
rxvt_unicode-with-plugins = callPackage ../applications/misc/rxvt_unicode/wrapper.nix {
|
||||
plugins = [
|
||||
urxvt_autocomplete_all_the_things
|
||||
urxvt_perl
|
||||
urxvt_perls
|
||||
urxvt_tabbedex
|
||||
urxvt_font_size
|
||||
urxvt_theme_switch
|
||||
urxvt_vtwheel
|
||||
urxvt_bidi
|
||||
];
|
||||
perlDeps = [
|
||||
# This needs the perl module it self provides
|
||||
urxvt_bidi
|
||||
];
|
||||
};
|
||||
|
||||
# urxvt plugins
|
||||
urxvt_autocomplete_all_the_things = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-autocomplete-all-the-things { };
|
||||
urxvt_perl = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-perl { };
|
||||
urxvt_perls = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-perls { };
|
||||
urxvt_tabbedex = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-tabbedex { };
|
||||
urxvt_font_size = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-font-size { };
|
||||
urxvt_theme_switch = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-theme-switch { };
|
||||
urxvt_vtwheel = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-vtwheel.nix { };
|
||||
urxvt_bidi = callPackage ../applications/misc/rxvt_unicode-plugins/urxvt-bidi { };
|
||||
rxvt-unicode-unwrapped = callPackage ../applications/misc/rxvt-unicode { };
|
||||
|
||||
uade123 = callPackage ../applications/audio/uade123 {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user