1 { lib, stdenv, fetchgit, fetchpatch, autoreconfHook, pkg-config, gtk-doc, xkeyboard_config, libxml2, xorg, docbook_xsl
2 , glib, isocodes, gobject-introspection
3 , withDoc ? (stdenv.buildPlatform == stdenv.hostPlatform)
6 stdenv.mkDerivation rec {
11 url = "https://gitlab.freedesktop.org/archived-projects/libxklavier.git";
12 rev = "${pname}-${version}";
13 sha256 = "1w1x5mrgly2ldiw3q2r6y620zgd89gk7n90ja46775lhaswxzv7a";
17 ./honor-XKB_CONFIG_ROOT.patch
18 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
20 url = "https://gitlab.freedesktop.org/archived-projects/libxklavier/-/commit/1387c21a788ec1ea203c8392ea1460fc29d83f70.patch";
21 sha256 = "sha256-fyWu7sVfDv/ozjhLSLCVsv+iNFawWgJqHUsQHHSkQn4=";
25 outputs = [ "out" "dev" ] ++ lib.optionals withDoc [ "devdoc" ];
27 # TODO: enable xmodmap support, needs xmodmap DB
28 propagatedBuildInputs = with xorg; [ libX11 libXi xkeyboard_config libxml2 libICE glib libxkbfile isocodes ];
30 nativeBuildInputs = [ autoreconfHook pkg-config gtk-doc docbook_xsl gobject-introspection ];
38 "--with-xkb-base=${xkeyboard_config}/etc/X11/xkb"
39 "--with-xkb-bin-base=${xorg.xkbcomp}/bin"
40 "--disable-xmodmap-support"
41 "${if withDoc then "--enable-gtk-doc" else "--disable-gtk-doc"}"
45 description = "Library providing high-level API for X Keyboard Extension known as XKB";
46 homepage = "http://freedesktop.org/wiki/Software/LibXklavier";
47 license = licenses.lgpl2Plus;
48 platforms = platforms.unix;