From 896da41892351fa3a40f746ec5813c221a897dce Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 1 Sep 2019 23:30:06 -0400 Subject: [PATCH 1/4] onboard: cleanups * workaround #56943 * fix xdg autostart installed to site-packages * delete ubuntu icons --- pkgs/applications/misc/onboard/default.nix | 107 ++++++++++++--------- 1 file changed, 62 insertions(+), 45 deletions(-) diff --git a/pkgs/applications/misc/onboard/default.nix b/pkgs/applications/misc/onboard/default.nix index de2f86e9f9a22..79e3317e64daa 100644 --- a/pkgs/applications/misc/onboard/default.nix +++ b/pkgs/applications/misc/onboard/default.nix @@ -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 = [ @@ -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 @@ -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" @@ -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; }; } From 5c04758bf764dd797005f9369a881e7fc41844eb Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 1 Sep 2019 23:44:32 -0400 Subject: [PATCH 2/4] pantheon.elementary-session-settings: add onboard autostart --- .../desktop/elementary-session-settings/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix b/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix index c262fb37dbc54..df12fba645f21 100644 --- a/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix +++ b/pkgs/desktops/pantheon/desktop/elementary-session-settings/default.nix @@ -7,6 +7,7 @@ , gnome-session , wingpanel , orca +, onboard , at-spi2-core , elementary-default-settings , writeShellScriptBin @@ -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 From 81a1bd6cfd6e7033870f319c332ffcab3585d955 Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Sun, 1 Sep 2019 23:54:55 -0400 Subject: [PATCH 3/4] pantheon.switchboard-plug-a11y: hardcode path to onboard-settings --- .../apps/switchboard-plugs/a11y/default.nix | 9 +++++++++ .../apps/switchboard-plugs/a11y/fix-paths.patch | 13 +++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/fix-paths.patch diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/default.nix b/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/default.nix index a03594b7b18be..3b85b123fd036 100644 --- a/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/default.nix +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/default.nix @@ -1,4 +1,5 @@ { stdenv +, substituteAll , fetchFromGitHub , pantheon , meson @@ -9,6 +10,7 @@ , granite , gtk3 , switchboard +, onboard }: stdenv.mkDerivation rec { @@ -22,6 +24,13 @@ stdenv.mkDerivation rec { sha256 = "1wh46lrsliii5bbvfc4xnzgnii2v7sqxnbn43ylmyqppfv9mk1wd"; }; + patches = [ + (substituteAll { + src = ./fix-paths.patch; + inherit onboard; + }) + ]; + passthru = { updateScript = pantheon.updateScript { repoName = pname; diff --git a/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/fix-paths.patch b/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/fix-paths.patch new file mode 100644 index 0000000000000..4d69390f39d90 --- /dev/null +++ b/pkgs/desktops/pantheon/apps/switchboard-plugs/a11y/fix-paths.patch @@ -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); From b1326ffc81f0c28b5f54d0957d449e8f88ca028d Mon Sep 17 00:00:00 2001 From: worldofpeace Date: Mon, 2 Sep 2019 00:11:52 -0400 Subject: [PATCH 4/4] nixos/pantheon: add onboard It's used as an on-screen keyboard. Hopefully in future they can ship their native app [0] [0]: https://github.com/elementary/keyboard --- nixos/modules/services/x11/desktop-managers/pantheon.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nixos/modules/services/x11/desktop-managers/pantheon.nix b/nixos/modules/services/x11/desktop-managers/pantheon.nix index 34ad969987aed..5b82cb1f02620 100644 --- a/nixos/modules/services/x11/desktop-managers/pantheon.nix +++ b/nixos/modules/services/x11/desktop-managers/pantheon.nix @@ -194,6 +194,7 @@ in gtk3.out hicolor-icon-theme lightlocker + onboard plank qgnomeplatform shared-mime-info