Skip to content

Commit

Permalink
Merge pull request #67915 from worldofpeace/pantheon-onboard
Browse files Browse the repository at this point in the history
Add onboard to Pantheon
  • Loading branch information
worldofpeace authored Sep 2, 2019
2 parents 5f07745 + b1326ff commit 74b42e2
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 48 deletions.
1 change: 1 addition & 0 deletions nixos/modules/services/x11/desktop-managers/pantheon.nix
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ in
gtk3.out
hicolor-icon-theme
lightlocker
onboard
plank
qgnomeplatform
shared-mime-info
Expand Down
107 changes: 62 additions & 45 deletions pkgs/applications/misc/onboard/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,22 @@
}:

let
customHunspell = hunspellWithDicts [hunspellDicts.en-us];

customHunspell = hunspellWithDicts [
hunspellDicts.en-us
];

majorVersion = "1.4";

in

python3.pkgs.buildPythonApplication rec {
pname = "onboard";
version = "${majorVersion}.1";
in python3.pkgs.buildPythonApplication rec {
name = "onboard-${version}";

src = fetchurl {
url = "https://launchpad.net/onboard/${majorVersion}/${version}/+download/${name}.tar.gz";
sha256 = "01cae1ac5b1ef1ab985bd2d2d79ded6fc99ee04b1535cc1bb191e43a231a3865";
url = "https://launchpad.net/onboard/${majorVersion}/${version}/+download/${pname}-${version}.tar.gz";
sha256 = "0r9q38ikmr4in4dwqd8m9gh9xjbgxnfxglnjbfcapw8ybfnf3jh1";
};

patches = [
Expand All @@ -48,62 +56,62 @@ in python3.pkgs.buildPythonApplication rec {
./hunspell-use-xdg-datadirs.patch
];

# For tests
LC_ALL = "en_US.UTF-8";
doCheck = false;
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
];

propagatedBuildInputs = [
glib
python3
python3.pkgs.dbus-python
python3.pkgs.distutils_extra
python3.pkgs.pyatspi
python3.pkgs.pycairo
python3.pkgs.pygobject3
python3.pkgs.systemd
nativeBuildInputs = [
gobject-introspection
intltool
pkgconfig
wrapGAppsHook
];

buildInputs = [
bash
glib
gnome3.dconf
gsettings-desktop-schemas
gtk3
hunspell
isocodes
libcanberra-gtk3
libxkbcommon
mousetweaks
udev
libxkbcommon
wrapGAppsHook
xorg.libXtst
xorg.libxkbfile
] ++ stdenv.lib.optional atspiSupport at-spi2-core;

nativeBuildInputs = [
glibcLocales
gobject-introspection # populate GI_TYPELIB_PATH
intltool
pkgconfig
propagatedBuildInputs = with python3.pkgs; [
dbus-python
distutils_extra
pyatspi
pycairo
pygobject3
systemd
];

propagatedUserEnvPkgs = [
gnome3.dconf
];

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;

preBuild = ''
# Unnecessary file, has been removed upstream
# https://github.com/NixOS/nixpkgs/pull/24986#issuecomment-296114062
Expand All @@ -118,6 +126,9 @@ in python3.pkgs.buildPythonApplication rec {
patchShebangs .
substituteInPlace setup.py \
--replace "/etc" "$out/etc"
substituteInPlace ./Onboard/LanguageSupport.py \
--replace "/usr/share/xml/iso-codes" "${isocodes}/share/xml/iso-codes" \
--replace "/usr/bin/yelp" "${yelp}/bin/yelp"
Expand Down Expand Up @@ -149,16 +160,22 @@ in python3.pkgs.buildPythonApplication rec {
--replace '"killall",' '"${procps}/bin/pkill", "-x",'
'';

postInstall = ''
cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override
installPhase = ''
${python3.interpreter} setup.py install --prefix="$out"
cp onboard-default-settings.gschema.override.example $out/share/glib-2.0/schemas/10_onboard-default-settings.gschema.override
glib-compile-schemas $out/share/glib-2.0/schemas/
'';

meta = {
# Remove ubuntu icons.
postFixup = ''
rm -rf $out/share/icons/ubuntu-mono-*
'';

meta = with stdenv.lib; {
homepage = https://launchpad.net/onboard;
description = "An onscreen keyboard useful for tablet PC users and for mobility impaired users.";
maintainers = with stdenv.lib.maintainers; [ johnramsden ];
license = stdenv.lib.licenses.gpl3;
description = "Onscreen keyboard useful for tablet PC users and for mobility impaired users";
maintainers = with maintainers; [ johnramsden ];
license = licenses.gpl3;
};
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv
, substituteAll
, fetchFromGitHub
, pantheon
, meson
Expand All @@ -9,6 +10,7 @@
, granite
, gtk3
, switchboard
, onboard
}:

stdenv.mkDerivation rec {
Expand All @@ -22,6 +24,13 @@ stdenv.mkDerivation rec {
sha256 = "1wh46lrsliii5bbvfc4xnzgnii2v7sqxnbn43ylmyqppfv9mk1wd";
};

patches = [
(substituteAll {
src = ./fix-paths.patch;
inherit onboard;
})
];

passthru = {
updateScript = pantheon.updateScript {
repoName = pname;
Expand Down
13 changes: 13 additions & 0 deletions pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/fix-paths.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/src/Panes/Typing.vala b/src/Panes/Typing.vala
index b4ae8b0..5b8fd7e 100644
--- a/src/Panes/Typing.vala
+++ b/src/Panes/Typing.vala
@@ -83,7 +83,7 @@ public class Accessibility.Panes.Typing : Categories.Pane {

onboard_settings_label.clicked.connect (() => {
try {
- var appinfo = AppInfo.create_from_commandline ("onboard-settings", null, AppInfoCreateFlags.NONE);
+ var appinfo = AppInfo.create_from_commandline ("@onboard@/bin/onboard-settings", null, AppInfoCreateFlags.NONE);
appinfo.launch (null, null);
} catch (Error e) {
warning ("%s\n", e.message);
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, gnome-session
, wingpanel
, orca
, onboard
, at-spi2-core
, elementary-default-settings
, writeShellScriptBin
Expand Down Expand Up @@ -85,9 +86,9 @@ stdenv.mkDerivation rec {
cp -av ${./pantheon-mimeapps.list} $out/share/applications/pantheon-mimeapps.list
mkdir -p $out/etc/xdg/autostart
cp -av ${gnome-keyring}/etc/xdg/autostart/* $out/etc/xdg/autostart
cp -av ${orca}/etc/xdg/autostart/* $out/etc/xdg/autostart
cp -av ${at-spi2-core}/etc/xdg/autostart/* $out/etc/xdg/autostart
for package in ${gnome-keyring} ${orca} ${onboard} ${at-spi2-core}; do
cp -av $package/etc/xdg/autostart/* $out/etc/xdg/autostart
done
cp "${dockitemAutostart}" $out/etc/xdg/autostart/default-elementary-dockitems.desktop
Expand Down

0 comments on commit 74b42e2

Please sign in to comment.