2021-01-15 09:19:50 +00:00
|
|
|
{ lib, stdenv
|
2019-11-07 18:01:21 +00:00
|
|
|
, substituteAll
|
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, gettext
|
|
|
|
, makeWrapper
|
2021-01-17 09:17:16 +00:00
|
|
|
, pkg-config
|
2019-11-07 18:01:21 +00:00
|
|
|
, vala
|
|
|
|
, wrapGAppsHook
|
|
|
|
, dbus
|
2022-03-14 12:01:30 +00:00
|
|
|
, systemd
|
2019-11-07 18:01:21 +00:00
|
|
|
, dconf ? null
|
|
|
|
, glib
|
|
|
|
, gdk-pixbuf
|
|
|
|
, gobject-introspection
|
|
|
|
, gtk2
|
|
|
|
, gtk3
|
2022-03-14 12:01:30 +00:00
|
|
|
, gtk4
|
2019-11-07 18:01:21 +00:00
|
|
|
, gtk-doc
|
2020-06-02 20:34:59 +00:00
|
|
|
, runCommand
|
2019-11-07 18:01:21 +00:00
|
|
|
, isocodes
|
2022-03-28 23:46:39 +00:00
|
|
|
, cldr-annotations
|
2019-11-07 18:06:23 +00:00
|
|
|
, unicode-character-database
|
|
|
|
, unicode-emoji
|
2019-11-07 18:01:21 +00:00
|
|
|
, python3
|
|
|
|
, json-glib
|
|
|
|
, libnotify ? null
|
|
|
|
, enableUI ? true
|
|
|
|
, withWayland ? false
|
2022-08-19 16:34:50 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
2019-11-07 18:01:21 +00:00
|
|
|
, buildPackages
|
|
|
|
, runtimeShell
|
2019-11-07 14:05:42 +00:00
|
|
|
, nixosTests
|
2019-11-07 18:01:21 +00:00
|
|
|
}:
|
2017-11-01 14:38:45 +00:00
|
|
|
|
2017-05-23 02:09:48 +00:00
|
|
|
let
|
2017-11-01 14:38:45 +00:00
|
|
|
python3Runtime = python3.withPackages (ps: with ps; [ pygobject3 ]);
|
|
|
|
python3BuildEnv = python3.buildEnv.override {
|
2017-10-01 09:56:08 +00:00
|
|
|
# ImportError: No module named site
|
|
|
|
postBuild = ''
|
2017-11-01 14:38:45 +00: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 09:56:08 +00:00
|
|
|
'';
|
2017-08-28 18:58:49 +00:00
|
|
|
};
|
2020-06-02 20:34:59 +00: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 \
|
2022-11-21 02:03:50 +00:00
|
|
|
--add-flags --config-file=${dbus}/share/dbus-1/session.conf
|
2020-06-02 20:34:59 +00:00
|
|
|
'';
|
2017-11-01 14:38:45 +00:00
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "ibus";
|
2022-08-22 19:31:17 +00:00
|
|
|
version = "1.5.27";
|
2014-01-25 16:05:33 +00:00
|
|
|
|
2017-11-01 14:38:45 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ibus";
|
|
|
|
repo = "ibus";
|
|
|
|
rev = version;
|
2022-08-22 19:31:17 +00:00
|
|
|
sha256 = "sha256-DwX7SYRb18C0Lz2ySPS3yV99Q1xQezs0Ls2P7Rbtk5Q=";
|
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;
|
|
|
|
})
|
2023-02-20 19:01:58 +00:00
|
|
|
./build-without-dbus-launch.patch
|
2019-06-01 12:33:32 +00:00
|
|
|
];
|
|
|
|
|
2019-11-07 14:05:42 +00:00
|
|
|
outputs = [ "out" "dev" "installedTests" ];
|
2019-09-25 10:44:52 +00:00
|
|
|
|
2016-02-26 23:30:01 +00:00
|
|
|
postPatch = ''
|
2020-06-02 20:34:59 +00:00
|
|
|
patchShebangs --build data/dconf/make-dconf-override-db.sh
|
2018-10-29 15:15:19 +00:00
|
|
|
cp ${buildPackages.gtk-doc}/share/gtk-doc/data/gtk-doc.make .
|
2022-06-08 08:33:58 +00:00
|
|
|
substituteInPlace bus/services/org.freedesktop.IBus.session.GNOME.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
|
|
|
|
substituteInPlace bus/services/org.freedesktop.IBus.session.generic.service.in --replace "ExecStart=sh" "ExecStart=${runtimeShell}"
|
2016-02-26 23:30:01 +00:00
|
|
|
'';
|
|
|
|
|
2017-11-01 14:38:45 +00:00
|
|
|
preAutoreconf = "touch ChangeLog";
|
|
|
|
|
2016-02-26 23:30:01 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--disable-memconf"
|
2023-01-24 16:35:54 +00:00
|
|
|
(lib.enableFeature (dconf != null) "dconf")
|
|
|
|
(lib.enableFeature (libnotify != null) "libnotify")
|
|
|
|
(lib.enableFeature withWayland "wayland")
|
|
|
|
(lib.enableFeature enableUI "ui")
|
2022-03-14 12:01:30 +00:00
|
|
|
"--enable-gtk4"
|
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"
|
2022-03-28 23:46:39 +00:00
|
|
|
"--with-emoji-annotation-dir=${cldr-annotations}/share/unicode/cldr/common/annotations"
|
2019-11-07 18:06:23 +00:00
|
|
|
"--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 = [
|
2021-01-24 09:19:10 +00:00
|
|
|
"test_execsdir=${placeholder "installedTests"}/libexec/installed-tests/ibus"
|
|
|
|
"test_sourcesdir=${placeholder "installedTests"}/share/installed-tests/ibus"
|
2019-11-07 14:05:42 +00:00
|
|
|
];
|
|
|
|
|
2017-11-01 14:38:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
2018-02-25 02:23:58 +00:00
|
|
|
gtk-doc
|
2019-04-03 11:20:00 +00:00
|
|
|
gettext
|
2017-11-01 14:38:45 +00:00
|
|
|
makeWrapper
|
2021-01-17 09:17:16 +00:00
|
|
|
pkg-config
|
2017-11-01 14:38:45 +00:00
|
|
|
python3BuildEnv
|
|
|
|
vala
|
|
|
|
wrapGAppsHook
|
2020-06-02 20:34:59 +00:00
|
|
|
dbus-launch
|
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
|
|
|
|
2017-11-01 14:38:45 +00:00
|
|
|
buildInputs = [
|
|
|
|
dbus
|
2022-03-14 12:01:30 +00:00
|
|
|
systemd
|
2017-11-01 14:38:45 +00:00
|
|
|
dconf
|
2019-05-22 11:03:39 +00:00
|
|
|
gdk-pixbuf
|
2018-12-02 11:41:15 +00:00
|
|
|
gobject-introspection
|
2019-06-01 12:59:25 +00:00
|
|
|
python3.pkgs.pygobject3 # for pygobject overrides
|
2017-11-01 14:38:45 +00:00
|
|
|
gtk2
|
|
|
|
gtk3
|
2022-03-14 12:01:30 +00:00
|
|
|
gtk4
|
2017-11-01 14:38:45 +00:00
|
|
|
isocodes
|
2018-02-25 02:23:58 +00:00
|
|
|
json-glib
|
2017-11-01 14:38:45 +00:00
|
|
|
libnotify
|
2023-01-24 16:35:54 +00:00
|
|
|
] ++ lib.optionals withWayland [
|
2017-11-01 14:38:45 +00:00
|
|
|
libxkbcommon
|
|
|
|
wayland
|
|
|
|
];
|
2017-03-20 14:18:56 +00:00
|
|
|
|
2017-03-25 20:53:01 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-04-25 03:20:18 +00:00
|
|
|
doCheck = false; # requires X11 daemon
|
2016-09-30 00:57:51 +00:00
|
|
|
doInstallCheck = true;
|
2019-11-07 18:01:21 +00:00
|
|
|
installCheckPhase = ''
|
|
|
|
$out/bin/ibus version
|
|
|
|
'';
|
2016-09-30 00:57:51 +00:00
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-01-24 16:35:54 +00:00
|
|
|
meta = with lib; {
|
2019-11-07 18:01:21 +00:00
|
|
|
homepage = "https://github.com/ibus/ibus";
|
2017-11-01 14:38:45 +00:00
|
|
|
description = "Intelligent Input Bus, input method framework";
|
|
|
|
license = licenses.lgpl21Plus;
|
2016-02-26 23:30:01 +00:00
|
|
|
platforms = platforms.linux;
|
2021-12-31 18:48:55 +00:00
|
|
|
maintainers = with maintainers; [ ttuegel yana ];
|
2014-01-25 16:05:33 +00:00
|
|
|
};
|
|
|
|
}
|