2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv
|
2019-11-07 19:01:21 +01:00
|
|
|
, substituteAll
|
|
|
|
, fetchurl
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, gettext
|
|
|
|
, makeWrapper
|
2021-01-17 10:17:16 +01:00
|
|
|
, pkg-config
|
2019-11-07 19:01:21 +01:00
|
|
|
, vala
|
|
|
|
, wrapGAppsHook
|
|
|
|
, dbus
|
|
|
|
, dconf ? null
|
|
|
|
, glib
|
|
|
|
, gdk-pixbuf
|
|
|
|
, gobject-introspection
|
|
|
|
, gtk2
|
|
|
|
, gtk3
|
|
|
|
, gtk-doc
|
2020-06-02 22:34:59 +02:00
|
|
|
, runCommand
|
2019-11-07 19:01:21 +01:00
|
|
|
, isocodes
|
2019-11-07 19:06:23 +01:00
|
|
|
, cldr-emoji-annotation
|
|
|
|
, unicode-character-database
|
|
|
|
, unicode-emoji
|
2019-11-07 19:01:21 +01:00
|
|
|
, python3
|
|
|
|
, json-glib
|
|
|
|
, libnotify ? null
|
|
|
|
, enablePython2Library ? false
|
|
|
|
, enableUI ? true
|
|
|
|
, withWayland ? false
|
|
|
|
, libxkbcommon ? null
|
|
|
|
, wayland ? null
|
|
|
|
, buildPackages
|
|
|
|
, runtimeShell
|
2019-11-07 15:05:42 +01:00
|
|
|
, nixosTests
|
2019-11-07 19:01:21 +01:00
|
|
|
}:
|
2017-11-01 15:38:45 +01:00
|
|
|
|
|
|
|
assert withWayland -> wayland != null && libxkbcommon != null;
|
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
with lib;
|
2014-01-25 17:05:33 +01:00
|
|
|
|
2017-05-23 04:09:48 +02:00
|
|
|
let
|
2017-11-01 15:38:45 +01:00
|
|
|
python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
|
|
|
|
python3BuildEnv = python3.buildEnv.override {
|
2017-10-01 11:56:08 +02:00
|
|
|
# ImportError: No module named site
|
|
|
|
postBuild = ''
|
2017-11-01 15:38:45 +01:00
|
|
|
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-10-01 11:56:08 +02:00
|
|
|
'';
|
2017-08-28 20:58:49 +02:00
|
|
|
};
|
2020-06-02 22:34:59 +02:00
|
|
|
# make-dconf-override-db.sh needs to execute dbus-launch in the sandbox,
|
|
|
|
# it will fail to read /etc/dbus-1/session.conf unless we add this flag
|
|
|
|
dbus-launch = runCommand "sandbox-dbus-launch" {
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
} ''
|
|
|
|
makeWrapper ${dbus}/bin/dbus-launch $out/bin/dbus-launch \
|
|
|
|
--add-flags --config-file=${dbus.daemon}/share/dbus-1/session.conf
|
|
|
|
'';
|
2017-11-01 15:38:45 +01:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ibus";
|
2021-02-23 05:40:05 +01:00
|
|
|
version = "1.5.24";
|
2014-01-25 17:05:33 +01:00
|
|
|
|
2017-11-01 15:38:45 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ibus";
|
|
|
|
repo = "ibus";
|
|
|
|
rev = version;
|
2021-02-23 05:40:05 +01:00
|
|
|
sha256 = "sha256-1qx06MlEUjSS067FdQG1Bdi4ZAh3hPcNjUX5PIiC3Sk=";
|
2014-01-25 17:05:33 +01:00
|
|
|
};
|
|
|
|
|
2019-06-01 14:33:32 +02:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
pythonInterpreter = python3Runtime.interpreter;
|
|
|
|
pythonSitePackages = python3.sitePackages;
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2019-11-07 15:05:42 +01:00
|
|
|
outputs = [ "out" "dev" "installedTests" ];
|
2019-09-25 12:44:52 +02:00
|
|
|
|
2016-02-27 00:30:01 +01:00
|
|
|
postPatch = ''
|
2020-06-02 22:34:59 +02:00
|
|
|
patchShebangs --build data/dconf/make-dconf-override-db.sh
|
2018-10-29 16:15:19 +01:00
|
|
|
cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
|
2016-02-27 00:30:01 +01:00
|
|
|
'';
|
|
|
|
|
2017-11-01 15:38:45 +01:00
|
|
|
preAutoreconf = "touch ChangeLog";
|
|
|
|
|
2016-02-27 00:30:01 +01:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-memconf"
|
2017-11-01 15:38:45 +01:00
|
|
|
(enableFeature (dconf != null) "dconf")
|
|
|
|
(enableFeature (libnotify != null) "libnotify")
|
|
|
|
(enableFeature withWayland "wayland")
|
2019-06-01 15:03:42 +02:00
|
|
|
(enableFeature enablePython2Library "python-library")
|
|
|
|
(enableFeature enablePython2Library "python2") # XXX: python2 library does not work anyway
|
2017-11-01 15:38:45 +01:00
|
|
|
(enableFeature enableUI "ui")
|
2019-11-07 15:05:42 +01:00
|
|
|
"--enable-install-tests"
|
2019-11-07 19:06:23 +01: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-27 00:30:01 +01:00
|
|
|
];
|
2014-01-25 17:05:33 +01:00
|
|
|
|
2019-11-07 15:05:42 +01:00
|
|
|
makeFlags = [
|
2021-01-24 10:19:10 +01:00
|
|
|
"test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus"
|
|
|
|
"test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus"
|
2019-11-07 15:05:42 +01:00
|
|
|
];
|
|
|
|
|
2017-11-01 15:38:45 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2018-02-25 03:23:58 +01:00
|
|
|
gtk-doc
|
2019-04-03 13:20:00 +02:00
|
|
|
gettext
|
2017-11-01 15:38:45 +01:00
|
|
|
makeWrapper
|
2021-01-17 10:17:16 +01:00
|
|
|
pkg-config
|
2017-11-01 15:38:45 +01:00
|
|
|
python3BuildEnv
|
|
|
|
vala
|
|
|
|
wrapGAppsHook
|
2020-06-02 22:34:59 +02:00
|
|
|
dbus-launch
|
2014-01-25 17:05:33 +01:00
|
|
|
];
|
|
|
|
|
2019-11-07 19:01:21 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
2016-08-22 05:11:18 +02:00
|
|
|
|
2017-11-01 15:38:45 +01:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
|
|
|
dconf
|
2019-05-22 13:03:39 +02:00
|
|
|
gdk-pixbuf
|
2018-12-02 12:41:15 +01:00
|
|
|
gobject-introspection
|
2019-06-01 14:59:25 +02:00
|
|
|
python3.pkgs.pygobject3 # for pygobject overrides
|
2017-11-01 15:38:45 +01:00
|
|
|
gtk2
|
|
|
|
gtk3
|
|
|
|
isocodes
|
2018-02-25 03:23:58 +01:00
|
|
|
json-glib
|
2017-11-01 15:38:45 +01:00
|
|
|
libnotify
|
|
|
|
] ++ optionals withWayland [
|
|
|
|
libxkbcommon
|
|
|
|
wayland
|
|
|
|
];
|
2017-03-20 15:18:56 +01:00
|
|
|
|
2017-03-25 21:53:01 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-04-25 05:20:18 +02:00
|
|
|
doCheck = false; # requires X11 daemon
|
2016-09-30 02:57:51 +02:00
|
|
|
doInstallCheck = true;
|
2019-11-07 19:01:21 +01:00
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/ibus version
|
|
|
|
'';
|
2016-09-30 02:57:51 +02:00
|
|
|
|
2019-11-07 15:05:42 +01: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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-11-01 15:38:45 +01:00
|
|
|
meta = {
|
2019-11-07 19:01:21 +01:00
|
|
|
homepage = "https://github.com/ibus/ibus";
|
2017-11-01 15:38:45 +01:00
|
|
|
description = "Intelligent Input Bus, input method framework";
|
|
|
|
license = licenses.lgpl21Plus;
|
2016-02-27 00:30:01 +01:00
|
|
|
platforms = platforms.linux;
|
2017-11-01 15:38:45 +01:00
|
|
|
maintainers = with maintainers; [ ttuegel yegortimoshenko ];
|
2014-01-25 17:05:33 +01:00
|
|
|
};
|
|
|
|
}
|