From 7b937e9152989c6f6e8c7a44f014cbc84aed640f Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Sat, 29 Jan 2022 12:36:58 +0100 Subject: [PATCH] rxvt-unicode-emoji: init as variant of rxvt-unicode, with wide glyph (emoji) support Patches adapted from https://aur.archlinux.org/packages/rxvt-unicode-truecolor-wide-glyphs/ See also https://github.com/blueyed/PKGBUILD-rxvt-unicode-wide/commit/a7241b714da18259621a8d404817ac60f8849ee8 --- .../rxvt-unicode/default.nix | 33 ++++++++++++++++--- pkgs/top-level/all-packages.nix | 8 +++++ 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix index 70ff4a4555d7..0e9402cf4953 100644 --- a/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix +++ b/pkgs/applications/terminal-emulators/rxvt-unicode/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, makeDesktopItem +{ lib, stdenv, fetchurl, fetchpatch, makeDesktopItem , libX11, libXt, libXft, libXrender , ncurses, fontconfig, freetype , pkg-config, gdk-pixbuf, perl @@ -6,6 +6,7 @@ , perlSupport ? true , gdkPixbufSupport ? true , unicode3Support ? true +, emojiSupport ? false }: let @@ -22,6 +23,13 @@ let genericName = pname; categories = "System;TerminalEmulator;"; }; + + fetchPatchFromAUR = { package, name, rev, sha256 }: + fetchpatch rec { + url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=${package}&id=${rev}"; + extraPrefix = ""; + inherit name sha256; + }; in with lib; @@ -44,18 +52,33 @@ stdenv.mkDerivation { outputs = [ "out" "terminfo" ]; - patches = [ + patches = (if emojiSupport then [ + # the required patches to libXft are in nixpkgs by default, see + # ../../../servers/x11/xorg/overrides.nix + (fetchPatchFromAUR { + name = "enable-wide-glyphs.patch"; + package = "rxvt-unicode-truecolor-wide-glyphs"; + rev = "69701a09c2c206233952b84bc966407f6774f1dc"; + sha256 = "0jfcj0ahky4dxdfrhqvh1v83mblhf5nak56dk1vq3bhyifdg7ffq"; + }) + (fetchPatchFromAUR { + name = "improve-font-rendering.patch"; + package = "rxvt-unicode-truecolor-wide-glyphs"; + rev = "69701a09c2c206233952b84bc966407f6774f1dc"; + sha256 = "1jj5ai2182nq912279adihi4zph1w4dvbdqa1pwacy4na6y0fz9y"; + }) + ] else [ ./patches/9.06-font-width.patch + ]) ++ [ ./patches/256-color-resources.patch - ] ++ optional stdenv.isDarwin ./patches/makefile-phony.patch; - + ]++ optional stdenv.isDarwin ./patches/makefile-phony.patch; configureFlags = [ "--with-terminfo=${placeholder "terminfo"}/share/terminfo" "--enable-256-color" (enableFeature perlSupport "perl") (enableFeature unicode3Support "unicode3") - ]; + ] ++ optional emojiSupport "--enable-wide-glyphs"; LDFLAGS = [ "-lfontconfig" "-lXrender" "-lpthread" ]; CFLAGS = [ "-I${freetype.dev}/include/freetype2" ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0bb3cbe5ec3b..d538e047070c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1160,10 +1160,18 @@ with pkgs; rxvt-unicode = callPackage ../applications/terminal-emulators/rxvt-unicode/wrapper.nix { }; + rxvt-unicode-emoji = rxvt-unicode.override { + rxvt-unicode-unwrapped = rxvt-unicode-unwrapped-emoji; + }; + rxvt-unicode-plugins = import ../applications/terminal-emulators/rxvt-unicode-plugins { inherit callPackage; }; rxvt-unicode-unwrapped = callPackage ../applications/terminal-emulators/rxvt-unicode { }; + rxvt-unicode-unwrapped-emoji = rxvt-unicode-unwrapped.override { + emojiSupport = true; + }; + sakura = callPackage ../applications/terminal-emulators/sakura { }; st = callPackage ../applications/terminal-emulators/st {