1 { lib, stdenv, fetchurl, fetchpatch, makeDesktopItem
2 , libX11, libXt, libXft, libXrender, libXext
3 , ncurses, fontconfig, freetype
4 , pkg-config, gdk-pixbuf, perl
7 , gdkPixbufSupport ? true
8 , unicode3Support ? true
14 pname = "rxvt-unicode";
16 description = "A clone of the well-known terminal emulator rxvt";
18 desktopItem = makeDesktopItem {
21 icon = "utilities-terminal";
22 comment = description;
23 desktopName = "URxvt";
25 categories = [ "System" "TerminalEmulator" ];
28 fetchPatchFromAUR = { package, name, rev, sha256 }:
30 url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=${package}&id=${rev}";
39 name = "${pname}-unwrapped-${version}";
40 inherit pname version;
43 url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
44 sha256 = "qqE/y8FJ/g8/OR+TMnlYD3Spb9MS1u0GuP8DwtRmcug=";
47 nativeBuildInputs = [ pkg-config ];
49 [ libX11 libXt libXft ncurses # required to build the terminfo file
50 fontconfig freetype libXrender
52 ] ++ optionals perlSupport [ perl libXext ]
53 ++ optional gdkPixbufSupport gdk-pixbuf;
55 outputs = [ "out" "terminfo" ];
57 patches = (if emojiSupport then [
58 # the required patches to libXft are in nixpkgs by default, see
59 # ../../../servers/x11/xorg/overrides.nix
61 name = "enable-wide-glyphs.patch";
62 package = "rxvt-unicode-truecolor-wide-glyphs";
63 rev = "69701a09c2c206233952b84bc966407f6774f1dc";
64 sha256 = "0jfcj0ahky4dxdfrhqvh1v83mblhf5nak56dk1vq3bhyifdg7ffq";
67 name = "improve-font-rendering.patch";
68 package = "rxvt-unicode-truecolor-wide-glyphs";
69 rev = "69701a09c2c206233952b84bc966407f6774f1dc";
70 sha256 = "1jj5ai2182nq912279adihi4zph1w4dvbdqa1pwacy4na6y0fz9y";
73 ./patches/9.06-font-width.patch
75 ./patches/256-color-resources.patch
76 ] ++ optional (perlSupport && versionAtLeast perl.version "5.38") (fetchpatch {
77 name = "perl538-locale-c.patch";
78 url = "https://github.com/exg/rxvt-unicode/commit/16634bc8dd5fc4af62faf899687dfa8f27768d15.patch";
79 excludes = [ "Changes" ];
80 sha256 = "sha256-JVqzYi3tcWIN2j5JByZSztImKqbbbB3lnfAwUXrumHM=";
81 }) ++ optional stdenv.isDarwin ./patches/makefile-phony.patch;
84 "--with-terminfo=${placeholder "terminfo"}/share/terminfo"
86 (enableFeature perlSupport "perl")
87 (enableFeature unicode3Support "unicode3")
88 ] ++ optional emojiSupport "--enable-wide-glyphs";
90 LDFLAGS = [ "-lfontconfig" "-lXrender" "-lpthread" ];
91 CFLAGS = [ "-I${freetype.dev}/include/freetype2" ];
95 # without this the terminfo won't be compiled by tic, see man tic
96 mkdir -p $terminfo/share/terminfo
97 export TERMINFO=$terminfo/share/terminfo
99 + lib.optionalString perlSupport ''
100 # make urxvt find its perl file lib/perl5/site_perl
101 # is added to PERL5LIB automatically
102 mkdir -p $out/$(dirname ${perl.libPrefix})
103 ln -s $out/lib/urxvt $out/${perl.libPrefix}
107 mkdir -p $out/nix-support
108 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
109 cp -r ${desktopItem}/share/applications/ $out/share/
112 passthru.tests.test = nixosTests.terminal-emulators.urxvt;
116 homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html";
117 downloadPage = "http://dist.schmorp.de/rxvt-unicode/Attic/";
118 maintainers = with maintainers; [ rnhmjoj ];
119 platforms = platforms.unix;
120 license = licenses.gpl3;