nixpkgs/pkgs/tools/inputmethods/ibus/default.nix

165 lines
3.8 KiB
Nix
Raw Normal View History

2019-11-07 18:01:21 +00:00
{ stdenv
, substituteAll
, fetchurl
, fetchFromGitHub
, autoreconfHook
, gettext
, makeWrapper
, pkgconfig
, vala
, wrapGAppsHook
, dbus
, dconf ? null
, glib
, gdk-pixbuf
, gobject-introspection
, gtk2
, gtk3
, gtk-doc
, isocodes
2019-11-07 18:06:23 +00:00
, cldr-emoji-annotation
, unicode-character-database
, unicode-emoji
2019-11-07 18:01:21 +00:00
, python3
, json-glib
, libnotify ? null
, enablePython2Library ? false
, enableUI ? true
, withWayland ? false
, libxkbcommon ? null
, wayland ? null
, buildPackages
, runtimeShell
2019-11-07 14:05:42 +00:00
, nixosTests
2019-11-07 18:01:21 +00:00
}:
assert withWayland -> wayland != null && libxkbcommon != null;
with stdenv.lib;
2014-01-25 16:05:33 +00:00
let
python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
python3BuildEnv = python3.buildEnv.override {
# ImportError: No module named site
postBuild = ''
makeWrapper ${glib.dev}/bin/gdbus-codegen $out/bin/gdbus-codegen --unset PYTHONPATH
makeWrapper ${glib.dev}/bin/glib-genmarshal $out/bin/glib-genmarshal --unset PYTHONPATH
makeWrapper ${glib.dev}/bin/glib-mkenums $out/bin/glib-mkenums --unset PYTHONPATH
'';
2017-08-28 18:58:49 +00:00
};
in
stdenv.mkDerivation rec {
pname = "ibus";
2020-02-22 00:12:32 +00:00
version = "1.5.22";
2014-01-25 16:05:33 +00:00
src = fetchFromGitHub {
owner = "ibus";
repo = "ibus";
rev = version;
2020-02-22 00:12:32 +00:00
sha256 = "09ynn7gq84q18hhbg6wq2yrliwil42qbzxbwbpggry1s955jg5xb";
2014-01-25 16:05:33 +00:00
};
2019-06-01 12:33:32 +00:00
patches = [
(substituteAll {
src = ./fix-paths.patch;
pythonInterpreter = python3Runtime.interpreter;
pythonSitePackages = python3.sitePackages;
})
];
2019-11-07 14:05:42 +00:00
outputs = [ "out" "dev" "installedTests" ];
2016-02-26 23:30:01 +00:00
postPatch = ''
echo \#!${runtimeShell} > data/dconf/make-dconf-override-db.sh
cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
2016-02-26 23:30:01 +00:00
'';
preAutoreconf = "touch ChangeLog";
2016-02-26 23:30:01 +00:00
configureFlags = [
"--disable-memconf"
(enableFeature (dconf != null) "dconf")
(enableFeature (libnotify != null) "libnotify")
(enableFeature withWayland "wayland")
(enableFeature enablePython2Library "python-library")
(enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway
(enableFeature enableUI "ui")
2019-11-07 14:05:42 +00:00
"--enable-install-tests"
2019-11-07 18:06:23 +00:00
"--with-unicode-emoji-dir=${unicode-emoji}/share/unicode/emoji"
"--with-emoji-annotation-dir=${cldr-emoji-annotation}/share/unicode/cldr/common/annotations"
"--with-ucd-dir=${unicode-character-database}/share/unicode"
2016-02-26 23:30:01 +00:00
];
2014-01-25 16:05:33 +00:00
2019-11-07 14:05:42 +00:00
makeFlags = [
"test_execsdir=${placeholder ''installedTests''}/libexec/installed-tests/ibus"
"test_sourcesdir=${placeholder ''installedTests''}/share/installed-tests/ibus"
];
nativeBuildInputs = [
autoreconfHook
gtk-doc
2019-04-03 11:20:00 +00:00
gettext
makeWrapper
pkgconfig
python3BuildEnv
vala
wrapGAppsHook
2014-01-25 16:05:33 +00:00
];
2019-11-07 18:01:21 +00:00
propagatedBuildInputs = [
glib
];
2016-08-22 03:11:18 +00:00
buildInputs = [
dbus
dconf
2019-05-22 11:03:39 +00:00
gdk-pixbuf
gobject-introspection
2019-06-01 12:59:25 +00:00
python3.pkgs.pygobject3 # for pygobject overrides
gtk2
gtk3
isocodes
json-glib
libnotify
] ++ optionals withWayland [
libxkbcommon
wayland
];
enableParallelBuilding = true;
doCheck = false; # requires X11 daemon
doInstallCheck = true;
2019-11-07 18:01:21 +00:00
installCheckPhase = ''
$out/bin/ibus version
'';
2019-11-07 14:05:42 +00:00
postInstall = ''
# It has some hardcoded FHS paths and also we do not use it
# since we set up the environment in NixOS tests anyway.
moveToOutput "bin/ibus-desktop-testing-runner" "$installedTests"
'';
postFixup = ''
# set necessary environment also for tests
for f in $installedTests/libexec/installed-tests/ibus/*; do
wrapGApp $f
done
'';
passthru = {
tests = {
installed-tests = nixosTests.installed-tests.ibus;
};
};
meta = {
2019-11-07 18:01:21 +00:00
homepage = "https://github.com/ibus/ibus";
description = "Intelligent Input Bus, input method framework";
license = licenses.lgpl21Plus;
2016-02-26 23:30:01 +00:00
platforms = platforms.linux;
maintainers = with maintainers; [ ttuegel yegortimoshenko ];
2014-01-25 16:05:33 +00:00
};
}