2017-07-17 07:30:09 +02:00
|
|
|
{ fetchurl
|
2021-01-25 09:26:54 +01:00
|
|
|
, lib
|
2019-04-25 00:11:57 +02:00
|
|
|
, substituteAll
|
2017-07-17 07:30:09 +02:00
|
|
|
, aspellWithDicts
|
2018-02-25 03:23:58 +01:00
|
|
|
, at-spi2-core ? null
|
2017-07-17 07:30:09 +02:00
|
|
|
, atspiSupport ? true
|
|
|
|
, bash
|
|
|
|
, glib
|
2019-12-01 00:11:47 +01:00
|
|
|
, dconf
|
2018-12-02 12:41:15 +01:00
|
|
|
, gobject-introspection
|
2018-02-25 03:23:58 +01:00
|
|
|
, gsettings-desktop-schemas
|
2017-07-17 07:30:09 +02:00
|
|
|
, gtk3
|
|
|
|
, hunspell
|
|
|
|
, hunspellDicts
|
|
|
|
, hunspellWithDicts
|
|
|
|
, intltool
|
|
|
|
, isocodes
|
2021-10-14 00:27:54 +02:00
|
|
|
, libappindicator-gtk3
|
2018-02-25 03:23:58 +01:00
|
|
|
, libcanberra-gtk3
|
2019-04-25 00:11:57 +02:00
|
|
|
, mousetweaks
|
2018-07-17 22:11:16 +02:00
|
|
|
, udev
|
2017-07-17 07:30:09 +02:00
|
|
|
, libxkbcommon
|
2021-01-17 03:09:27 +01:00
|
|
|
, pkg-config
|
2017-07-17 07:30:09 +02:00
|
|
|
, procps
|
|
|
|
, python3
|
|
|
|
, wrapGAppsHook
|
|
|
|
, xorg
|
|
|
|
, yelp
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2019-09-02 05:30:06 +02:00
|
|
|
|
|
|
|
customHunspell = hunspellWithDicts [
|
|
|
|
hunspellDicts.en-us
|
|
|
|
];
|
|
|
|
|
2017-07-17 07:30:09 +02:00
|
|
|
majorVersion = "1.4";
|
2019-09-02 05:30:06 +02:00
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
python3.pkgs.buildPythonApplication rec {
|
|
|
|
pname = "onboard";
|
2017-07-17 07:30:09 +02:00
|
|
|
version = "${majorVersion}.1";
|
2019-09-02 05:30:06 +02:00
|
|
|
|
2017-07-17 07:30:09 +02:00
|
|
|
src = fetchurl {
|
2019-09-02 05:30:06 +02:00
|
|
|
url = "https://launchpad.net/onboard/${majorVersion}/${version}/+download/${pname}-${version}.tar.gz";
|
|
|
|
sha256 = "0r9q38ikmr4in4dwqd8m9gh9xjbgxnfxglnjbfcapw8ybfnf3jh1";
|
2017-07-17 07:30:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2019-04-25 00:11:57 +02:00
|
|
|
(substituteAll {
|
|
|
|
src = ./fix-paths.patch;
|
|
|
|
inherit mousetweaks;
|
|
|
|
})
|
2017-07-17 07:30:09 +02:00
|
|
|
# Allow loading hunspell dictionaries installed in NixOS system path
|
|
|
|
./hunspell-use-xdg-datadirs.patch
|
|
|
|
];
|
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
|
|
|
intltool
|
2021-01-17 03:09:27 +01:00
|
|
|
pkg-config
|
2019-09-02 05:30:06 +02:00
|
|
|
wrapGAppsHook
|
2017-07-17 07:30:09 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
bash
|
2019-09-02 05:30:06 +02:00
|
|
|
glib
|
2019-12-01 00:11:47 +01:00
|
|
|
dconf
|
2018-02-25 03:23:58 +01:00
|
|
|
gsettings-desktop-schemas
|
2017-07-17 07:30:09 +02:00
|
|
|
gtk3
|
|
|
|
hunspell
|
|
|
|
isocodes
|
2021-10-14 00:27:54 +02:00
|
|
|
libappindicator-gtk3
|
2018-02-25 03:23:58 +01:00
|
|
|
libcanberra-gtk3
|
2019-09-02 05:30:06 +02:00
|
|
|
libxkbcommon
|
2019-04-25 00:11:57 +02:00
|
|
|
mousetweaks
|
2018-07-17 22:11:16 +02:00
|
|
|
udev
|
2017-07-17 07:30:09 +02:00
|
|
|
xorg.libXtst
|
|
|
|
xorg.libxkbfile
|
2021-01-15 06:42:41 +01:00
|
|
|
] ++ lib.optional atspiSupport at-spi2-core;
|
2017-07-17 07:30:09 +02:00
|
|
|
|
2021-10-14 00:29:00 +02:00
|
|
|
pythonPath = with python3.pkgs; [
|
2019-09-02 05:30:06 +02:00
|
|
|
dbus-python
|
|
|
|
distutils_extra
|
|
|
|
pyatspi
|
|
|
|
pycairo
|
|
|
|
pygobject3
|
|
|
|
systemd
|
2017-07-17 07:30:09 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedUserEnvPkgs = [
|
2019-12-01 00:11:47 +01:00
|
|
|
dconf
|
2017-07-17 07:30:09 +02:00
|
|
|
];
|
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
checkInputs = [
|
|
|
|
# for Onboard.SpellChecker.aspell_cmd doctests
|
|
|
|
(aspellWithDicts (dicts: with dicts; [ en ]))
|
|
|
|
|
|
|
|
# for Onboard.SpellChecker.hunspell_cmd doctests
|
|
|
|
customHunspell
|
|
|
|
|
|
|
|
# for Onboard.SpellChecker.hunspell doctests
|
|
|
|
hunspellDicts.en-us
|
|
|
|
hunspellDicts.es-es
|
|
|
|
hunspellDicts.it-it
|
|
|
|
|
|
|
|
python3.pkgs.nose
|
|
|
|
];
|
|
|
|
|
|
|
|
# Temporary fix, see https://github.com/NixOS/nixpkgs/issues/56943
|
|
|
|
strictDeps = false;
|
|
|
|
|
|
|
|
doCheck = false;
|
|
|
|
|
2017-07-17 07:30:09 +02:00
|
|
|
preBuild = ''
|
|
|
|
# Unnecessary file, has been removed upstream
|
|
|
|
# https://github.com/NixOS/nixpkgs/pull/24986#issuecomment-296114062
|
|
|
|
rm -r Onboard/pypredict/attic
|
|
|
|
|
|
|
|
substituteInPlace ./scripts/sokSettings.py \
|
|
|
|
--replace "#!/usr/bin/python3" "" \
|
|
|
|
--replace "PYTHON_EXECUTABLE," "\"$out/bin/onboard-settings\"" \
|
|
|
|
--replace '"-cfrom Onboard.settings import Settings\ns = Settings(False)"' ""
|
|
|
|
|
|
|
|
chmod -x ./scripts/sokSettings.py
|
|
|
|
|
|
|
|
patchShebangs .
|
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "/etc" "$out/etc"
|
|
|
|
|
2017-07-17 07:30:09 +02:00
|
|
|
substituteInPlace ./Onboard/LanguageSupport.py \
|
2021-02-22 01:14:31 +01:00
|
|
|
--replace "/usr/share/xml/iso-codes" "${isocodes}/share/xml/iso-codes"
|
2017-07-17 07:30:09 +02:00
|
|
|
|
|
|
|
substituteInPlace ./Onboard/Indicator.py \
|
|
|
|
--replace "/usr/bin/yelp" "${yelp}/bin/yelp"
|
|
|
|
|
|
|
|
substituteInPlace ./gnome/Onboard_Indicator@onboard.org/extension.js \
|
|
|
|
--replace "/usr/bin/yelp" "${yelp}/bin/yelp"
|
|
|
|
|
|
|
|
substituteInPlace ./Onboard/SpellChecker.py \
|
|
|
|
--replace "/usr/lib" "$out/lib"
|
|
|
|
|
|
|
|
substituteInPlace ./data/org.onboard.Onboard.service \
|
|
|
|
--replace "/usr/bin" "$out/bin"
|
|
|
|
|
|
|
|
substituteInPlace ./Onboard/utils.py \
|
|
|
|
--replace "/usr/share" "$out/share"
|
|
|
|
substituteInPlace ./onboard-defaults.conf.example \
|
|
|
|
--replace "/usr/share" "$out/share"
|
|
|
|
substituteInPlace ./Onboard/Config.py \
|
|
|
|
--replace "/usr/share/onboard" "$out/share/onboard"
|
|
|
|
|
|
|
|
substituteInPlace ./Onboard/WordSuggestions.py \
|
|
|
|
--replace "/usr/bin" "$out/bin"
|
|
|
|
|
|
|
|
# killall is dangerous on non-gnu platforms. Use pkill instead.
|
|
|
|
substituteInPlace ./setup.py \
|
|
|
|
--replace '"killall",' '"${procps}/bin/pkill", "-x",'
|
|
|
|
'';
|
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
installPhase = ''
|
|
|
|
${python3.interpreter} setup.py install --prefix="$out"
|
2017-07-17 07:30:09 +02:00
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override
|
2017-07-17 07:30:09 +02:00
|
|
|
glib-compile-schemas $out/share/glib-2.0/schemas/
|
|
|
|
'';
|
|
|
|
|
2019-09-02 05:30:06 +02:00
|
|
|
# Remove ubuntu icons.
|
|
|
|
postFixup = ''
|
|
|
|
rm -rf $out/share/icons/ubuntu-mono-*
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://launchpad.net/onboard";
|
2019-09-02 05:30:06 +02:00
|
|
|
description = "Onscreen keyboard useful for tablet PC users and for mobility impaired users";
|
|
|
|
maintainers = with maintainers; [ johnramsden ];
|
|
|
|
license = licenses.gpl3;
|
2017-07-17 07:30:09 +02:00
|
|
|
};
|
|
|
|
}
|