onboard: init at 1.4.1

Add testing reqs, but keep tests disabled

Tests are runnable but still produce errors.

To get tests working, add locale setting, replace killall
and add nose package. To run the tests enable 'doCheck'.

Hunspell needs to be explicitly installed to use.

Patch SpellCheck.py to put hunspell in system datadir location.
For example, '/var/run/current-system/sw/share/hunspell/'
or '${HOME}/.nix-profile/share/hunspell/'

To get rid of atspi errors set
'services.gnome3.at-spi2-core.enable = true'

+178
+156
pkgs/applications/misc/onboard/default.nix
··· 1 + { fetchurl 2 + , stdenv 3 + , aspellWithDicts 4 + , at_spi2_core ? null 5 + , atspiSupport ? true 6 + , bash 7 + , glib 8 + , glibcLocales 9 + , gnome3 10 + , gobjectIntrospection 11 + , gsettings_desktop_schemas 12 + , gtk3 13 + , hunspell 14 + , hunspellDicts 15 + , hunspellWithDicts 16 + , intltool 17 + , isocodes 18 + , libcanberra_gtk3 19 + , libudev 20 + , libxkbcommon 21 + , pkgconfig 22 + , procps 23 + , python3 24 + , wrapGAppsHook 25 + , xorg 26 + , yelp 27 + }: 28 + 29 + let 30 + customHunspell = hunspellWithDicts [hunspellDicts.en-us]; 31 + majorVersion = "1.4"; 32 + version = "${majorVersion}.1"; 33 + in python3.pkgs.buildPythonApplication rec { 34 + name = "onboard-${version}"; 35 + src = fetchurl { 36 + url = "https://launchpad.net/onboard/${majorVersion}/${version}/+download/${name}.tar.gz"; 37 + sha256 = "01cae1ac5b1ef1ab985bd2d2d79ded6fc99ee04b1535cc1bb191e43a231a3865"; 38 + }; 39 + 40 + patches = [ 41 + # Allow loading hunspell dictionaries installed in NixOS system path 42 + ./hunspell-use-xdg-datadirs.patch 43 + ]; 44 + 45 + # For tests 46 + LC_ALL = "en_US.UTF-8"; 47 + doCheck = false; 48 + checkInputs = [ 49 + # for Onboard.SpellChecker.aspell_cmd doctests 50 + (aspellWithDicts (dicts: with dicts; [ en ])) 51 + 52 + # for Onboard.SpellChecker.hunspell_cmd doctests 53 + customHunspell 54 + 55 + # for Onboard.SpellChecker.hunspell doctests 56 + hunspellDicts.en-us 57 + hunspellDicts.es-es 58 + hunspellDicts.it-it 59 + 60 + python3.pkgs.nose 61 + ]; 62 + 63 + propagatedBuildInputs = [ 64 + glib 65 + python3 66 + python3.pkgs.dbus-python 67 + python3.pkgs.distutils_extra 68 + python3.pkgs.pyatspi 69 + python3.pkgs.pycairo 70 + python3.pkgs.pygobject3 71 + python3.pkgs.systemd 72 + ]; 73 + 74 + buildInputs = [ 75 + bash 76 + gnome3.dconf 77 + gsettings_desktop_schemas 78 + gtk3 79 + hunspell 80 + isocodes 81 + libcanberra_gtk3 82 + libudev 83 + libxkbcommon 84 + wrapGAppsHook 85 + xorg.libXtst 86 + xorg.libxkbfile 87 + ] ++ stdenv.lib.optional atspiSupport at_spi2_core; 88 + 89 + nativeBuildInputs = [ 90 + glibcLocales 91 + intltool 92 + pkgconfig 93 + ]; 94 + 95 + propagatedUserEnvPkgs = [ 96 + gnome3.dconf 97 + ]; 98 + 99 + preBuild = '' 100 + # Unnecessary file, has been removed upstream 101 + # https://github.com/NixOS/nixpkgs/pull/24986#issuecomment-296114062 102 + rm -r Onboard/pypredict/attic 103 + 104 + substituteInPlace ./scripts/sokSettings.py \ 105 + --replace "#!/usr/bin/python3" "" \ 106 + --replace "PYTHON_EXECUTABLE," "\"$out/bin/onboard-settings\"" \ 107 + --replace '"-cfrom Onboard.settings import Settings\ns = Settings(False)"' "" 108 + 109 + chmod -x ./scripts/sokSettings.py 110 + 111 + patchShebangs . 112 + 113 + substituteInPlace ./Onboard/LanguageSupport.py \ 114 + --replace "/usr/share/xml/iso-codes" "${isocodes}/share/xml/iso-codes" \ 115 + --replace "/usr/bin/yelp" "${yelp}/bin/yelp" 116 + 117 + substituteInPlace ./Onboard/Indicator.py \ 118 + --replace "/usr/bin/yelp" "${yelp}/bin/yelp" 119 + 120 + substituteInPlace ./gnome/Onboard_Indicator@onboard.org/extension.js \ 121 + --replace "/usr/bin/yelp" "${yelp}/bin/yelp" 122 + 123 + substituteInPlace ./Onboard/SpellChecker.py \ 124 + --replace "/usr/lib" "$out/lib" 125 + 126 + substituteInPlace ./data/org.onboard.Onboard.service \ 127 + --replace "/usr/bin" "$out/bin" 128 + 129 + substituteInPlace ./Onboard/utils.py \ 130 + --replace "/usr/share" "$out/share" 131 + substituteInPlace ./onboard-defaults.conf.example \ 132 + --replace "/usr/share" "$out/share" 133 + substituteInPlace ./Onboard/Config.py \ 134 + --replace "/usr/share/onboard" "$out/share/onboard" 135 + 136 + substituteInPlace ./Onboard/WordSuggestions.py \ 137 + --replace "/usr/bin" "$out/bin" 138 + 139 + # killall is dangerous on non-gnu platforms. Use pkill instead. 140 + substituteInPlace ./setup.py \ 141 + --replace '"killall",' '"${procps}/bin/pkill", "-x",' 142 + ''; 143 + 144 + postInstall = '' 145 + cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override 146 + 147 + glib-compile-schemas $out/share/glib-2.0/schemas/ 148 + ''; 149 + 150 + meta = { 151 + homepage = https://launchpad.net/onboard; 152 + description = "An onscreen keyboard useful for tablet PC users and for mobility impaired users."; 153 + maintainers = with stdenv.lib.maintainers; [ johnramsden ]; 154 + license = stdenv.lib.licenses.gpl3; 155 + }; 156 + }
+20
pkgs/applications/misc/onboard/hunspell-use-xdg-datadirs.patch
··· 1 + diff --git a/Onboard/SpellChecker.py b/Onboard/SpellChecker.py 2 + index 6a92757..46e755e 100644 3 + --- a/Onboard/SpellChecker.py 4 + +++ b/Onboard/SpellChecker.py 5 + @@ -506,6 +506,10 @@ class hunspell(SCBackend): 6 + if dicpath: 7 + paths.extend(dicpath.split(pathsep)) 8 + 9 + + datadirs = os.getenv("XDG_DATA_DIRS") 10 + + if datadirs: 11 + + paths.extend(map(lambda datadir: os.path.join(datadir, 'hunspell'), datadirs.split(pathsep))) 12 + + 13 + paths.extend(LIBDIRS) 14 + 15 + home = os.getenv("HOME") 16 + @@ -723,4 +727,3 @@ class aspell_cmd(SCBackend): 17 + _logger.error(_format("Failed to execute '{}', {}", \ 18 + " ".join(args), e)) 19 + return [id for id in dict_ids if id] 20 + -
+2
pkgs/top-level/all-packages.nix
··· 1186 1186 1187 1187 nfdump = callPackage ../tools/networking/nfdump { }; 1188 1188 1189 + onboard = callPackage ../applications/misc/onboard { }; 1190 + 1189 1191 patdiff = callPackage ../tools/misc/patdiff { }; 1190 1192 1191 1193 playerctl = callPackage ../tools/audio/playerctl { };