diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2020-07-08 18:15:26 +0200 |
---|---|---|
committer | Leo <thinkabit.ukim@gmail.com> | 2020-08-11 16:48:15 +0000 |
commit | 49207e8e69eadc0057402758067f1d8ac55e6c2c (patch) | |
tree | 5f1a95497f89d18f8ee81d7b41c94ec79dd1324a | |
parent | 296fa3a0de20ea43d9f2bfcababcaeb52a4b123a (diff) | |
download | aports-49207e8e69eadc0057402758067f1d8ac55e6c2c.tar.gz aports-49207e8e69eadc0057402758067f1d8ac55e6c2c.tar.bz2 aports-49207e8e69eadc0057402758067f1d8ac55e6c2c.tar.xz |
community/gnome-authenticator: fix startup with upstream patch
Also use upstream patch for setting the locale while we're at it.
(cherry picked from commit a49f6533699aad75b9febf4bfb71443a65d25e01)
3 files changed, 130 insertions, 6 deletions
diff --git a/community/gnome-authenticator/APKBUILD b/community/gnome-authenticator/APKBUILD index 8128652dca1..4ea34aa4679 100644 --- a/community/gnome-authenticator/APKBUILD +++ b/community/gnome-authenticator/APKBUILD @@ -2,10 +2,10 @@ # Maintainer: Rasmus Thomsen <oss@cogitri.dev> pkgname=gnome-authenticator pkgver=3.32.2 -pkgrel=6 +pkgrel=7 pkgdesc="A Two-Factor Authentication application" url="https://gitlab.gnome.org/World/Authenticator" -arch="all !s390x !mips !mips64" # missing libhandy on s390x +arch="noarch !s390x !mips !mips64" # missing libhandy on s390x license="GPL-3.0-only" depends="python3 py3-otp py3-beautifulsoup4 py3-pillow py3-pyfavicon py3-pyzbar py3-yoyo-migrations libhandy py3-setuptools" @@ -13,7 +13,8 @@ makedepends="meson gtk+3.0-dev libsecret-dev zbar-dev gobject-introspection-dev" checkdepends="appstream-glib desktop-file-utils" subpackages="$pkgname-lang" source="https://gitlab.gnome.org/World/Authenticator/-/archive/$pkgver/Authenticator-$pkgver.tar.gz - dont-require-py3-gettext-support.patch" + dont-require-py3-gettext-support.patch + c222f505a8bf623fbf057f9e1ae0a52e9df3edb7.patch" builddir="$srcdir/Authenticator-$pkgver" build() { @@ -36,4 +37,5 @@ package() { } sha512sums="3bd78354f4d18052d03650b455f07fb7fa9bb5cba0b6c92dcbfb5158dcf500f0b7f84e0be8942e0fbb74b1cefcd9019941c758538e05144c469bbe47b4355ce0 Authenticator-3.32.2.tar.gz -6f257b478bc581e7777e83c16bffe6a42b6af7478892566835c67e22fc4ace0fa77ba2f3c3006ab34d38a49f16e673c4a2b17bac307c15ae430270a5256fb70f dont-require-py3-gettext-support.patch" +04ce91e3c12503fb21728c39cf20ab1cd5c81f0ad7b5f6ecc875921c387df5fcc3edb4675e0015f1ba7eda71cf53246b9c14b819a11d5d151846112966aa10c0 dont-require-py3-gettext-support.patch +2976e634578152ea2e3effd963a542395c19b9f28d0227727896e559e64e83421669c94a424e75c2e89924ce9fe578469c3ecc987f8d96f1bd80c88acfa03038 c222f505a8bf623fbf057f9e1ae0a52e9df3edb7.patch" diff --git a/community/gnome-authenticator/c222f505a8bf623fbf057f9e1ae0a52e9df3edb7.patch b/community/gnome-authenticator/c222f505a8bf623fbf057f9e1ae0a52e9df3edb7.patch new file mode 100644 index 00000000000..b871f64d283 --- /dev/null +++ b/community/gnome-authenticator/c222f505a8bf623fbf057f9e1ae0a52e9df3edb7.patch @@ -0,0 +1,97 @@ +From c222f505a8bf623fbf057f9e1ae0a52e9df3edb7 Mon Sep 17 00:00:00 2001 +From: Keith Patton <k.patton@camlintechnologies.com> +Date: Wed, 13 May 2020 15:41:18 +0100 +Subject: [PATCH] Removed all references to 'self.init_template' + +--- + src/Authenticator/widgets/accounts/add.py | 1 - + src/Authenticator/widgets/accounts/list.py | 1 - + src/Authenticator/widgets/accounts/row.py | 1 - + src/Authenticator/widgets/provider_image.py | 1 - + src/Authenticator/widgets/settings.py | 2 -- + src/Authenticator/widgets/window.py | 1 - + 6 files changed, 7 deletions(-) + +diff --git a/src/Authenticator/widgets/accounts/add.py b/src/Authenticator/widgets/accounts/add.py +index 44c02d3..a0f5726 100644 +--- a/src/Authenticator/widgets/accounts/add.py ++++ b/src/Authenticator/widgets/accounts/add.py +@@ -104,7 +104,6 @@ class AccountConfig(Gtk.Overlay): + + def __init__(self, **kwargs): + super(AccountConfig, self).__init__() +- self.init_template('AccountConfig') + + self.account_list.set_header_func(Handy.list_box_separator_header) + +diff --git a/src/Authenticator/widgets/accounts/list.py b/src/Authenticator/widgets/accounts/list.py +index 39eb2a4..2319955 100644 +--- a/src/Authenticator/widgets/accounts/list.py ++++ b/src/Authenticator/widgets/accounts/list.py +@@ -40,7 +40,6 @@ class AccountsWidget(Gtk.Box): + + def __init__(self): + super(AccountsWidget, self).__init__() +- self.init_template('AccountsWidget') + + self._providers = [] + self._to_delete = [] +diff --git a/src/Authenticator/widgets/accounts/row.py b/src/Authenticator/widgets/accounts/row.py +index ebbcaff..28d210a 100644 +--- a/src/Authenticator/widgets/accounts/row.py ++++ b/src/Authenticator/widgets/accounts/row.py +@@ -61,7 +61,6 @@ class AccountRow(Gtk.ListBoxRow): + :param account: Account + """ + super(AccountRow, self).__init__() +- self.init_template('AccountRow') + self._account = account + + self._account.connect("otp_updated", self._on_pin_updated) +diff --git a/src/Authenticator/widgets/provider_image.py b/src/Authenticator/widgets/provider_image.py +index 9a8dcb6..2d00456 100644 +--- a/src/Authenticator/widgets/provider_image.py ++++ b/src/Authenticator/widgets/provider_image.py +@@ -78,7 +78,6 @@ + + def __init__(self, provider=None, image_size=48): + super(ProviderImage, self).__init__() +- self.init_template('ProviderImage') + self.provider = provider if provider else Provider() + + self.image_size = image_size +diff --git a/src/Authenticator/widgets/settings.py b/src/Authenticator/widgets/settings.py +index 4920390..49a98a9 100644 +--- a/src/Authenticator/widgets/settings.py ++++ b/src/Authenticator/widgets/settings.py +@@ -37,7 +37,6 @@ class SettingsWindow(Handy.PreferencesWindow): + + def __init__(self): + super(SettingsWindow, self).__init__() +- self.init_template('SettingsWindow') + + self.__init_widgets() + self.__bind_signals() +@@ -150,7 +149,6 @@ class PasswordWidget(Gtk.Box): + def __init__(self): + super(PasswordWidget, self).__init__() + self.parent = None +- self.init_template('PasswordWidget') + + def reset_widgets(self): + """Reset widgets state.""" +diff --git a/src/Authenticator/widgets/window.py b/src/Authenticator/widgets/window.py +index 7e58b07..12b8649 100644 +--- a/src/Authenticator/widgets/window.py ++++ b/src/Authenticator/widgets/window.py +@@ -53,7 +53,6 @@ class Window(Gtk.ApplicationWindow): + + def __init__(self): + super(Window, self).__init__() +- self.init_template('Window') + + self.connect("notify::view", self.__state_changed) + +-- +GitLab + diff --git a/community/gnome-authenticator/dont-require-py3-gettext-support.patch b/community/gnome-authenticator/dont-require-py3-gettext-support.patch index 88d96a09e05..0612747d1d2 100644 --- a/community/gnome-authenticator/dont-require-py3-gettext-support.patch +++ b/community/gnome-authenticator/dont-require-py3-gettext-support.patch @@ -1,13 +1,38 @@ +Upstream: Pending, https://gitlab.gnome.org/World/Authenticator/-/merge_requests/160 +From 4073b3f3d97f0c4d74a7017da181fb4e41bdef8e Mon Sep 17 00:00:00 2001 +From: Rasmus Thomsen <oss@cogitri.dev> +Date: Wed, 8 Jul 2020 18:08:16 +0200 +Subject: [PATCH] Gracefully handle locale.{bind,}textdomain not being + available + +When python is built without gettext support these functions aren't +available and as such GTG fails to start without this change. +--- + src/authenticator.py.in | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + diff --git a/src/authenticator.py.in b/src/authenticator.py.in -index 1e75e10..2f2fec2 100755 +index 1e75e10..2cc371f 100755 --- a/src/authenticator.py.in +++ b/src/authenticator.py.in -@@ -35,8 +35,6 @@ from gi.repository import Gio, Handy +@@ -35,8 +35,15 @@ from gi.repository import Gio, Handy sys.path.insert(1, '@PYTHON_DIR@') def prepare_locale(): - locale.bindtextdomain('@GETTEXT_PACKAGE@', '@LOCALE_DIR@') - locale.textdomain('@GETTEXT_PACKAGE@') ++ try: ++ locale.bindtextdomain('@GETTEXT_PACKAGE@', '@LOCALE_DIR@') ++ locale.textdomain('@GETTEXT_PACKAGE@') ++ except AttributeError as e: ++ # Python built without gettext support doesn't have bindtextdomain() ++ # and textdomain() ++ print("Couldn't bind the gettext translation domain. Some translations" ++ " won't work.\n{}".format(e)) ++ gettext.bindtextdomain('@GETTEXT_PACKAGE@', '@LOCALE_DIR@') gettext.textdomain('@GETTEXT_PACKAGE@') +-- +GitLab + |