aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClayton Craft <clayton@craftyguy.net>2021-07-30 00:05:36 -0700
committerClayton Craft <clayton@craftyguy.net>2021-07-30 18:12:15 -0700
commitb6a6401a2a66cfdf97e89badd29f1d80c1b3e534 (patch)
tree7ffa74671a49540dcc96519689b4edafab339ba0
parent9d34a44e12416b9f738da225963fea28dd56d4b6 (diff)
downloadaports-b6a6401a2a66cfdf97e89badd29f1d80c1b3e534.tar.gz
aports-b6a6401a2a66cfdf97e89badd29f1d80c1b3e534.tar.bz2
aports-b6a6401a2a66cfdf97e89badd29f1d80c1b3e534.tar.xz
community/portfolio: upgrade to 0.9.11
-rw-r--r--community/portfolio/0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch60
-rw-r--r--community/portfolio/0002-fall-back-to-gettext-module-on-systems-that.patch219
-rw-r--r--community/portfolio/APKBUILD17
3 files changed, 8 insertions, 288 deletions
diff --git a/community/portfolio/0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch b/community/portfolio/0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch
deleted file mode 100644
index f41e46d37d..0000000000
--- a/community/portfolio/0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From c3a336d94fd6da0dcbb7fdaa2410d88aea18c1f2 Mon Sep 17 00:00:00 2001
-From: Clayton Craft <clayton@craftyguy.net>
-Date: Wed, 3 Mar 2021 12:54:19 -0800
-Subject: [PATCH] places: handle cases where XDG_ dirs couldn't be resolved
-
-get_user_special_dirs can return None if the logical id could not be
-resolved, so this change handles this case by skipping over the call to
-_add_place.
-
-Without this check, the application will crash with a TypeError when it
-ultimately calls os.fspath(None).
----
- src/places.py | 10 +++++-----
- 1 file changed, 5 insertions(+), 5 deletions(-)
-
-diff --git a/src/places.py b/src/places.py
-index 1cbbbe6..de6257c 100644
---- a/src/places.py
-+++ b/src/places.py
-@@ -95,35 +95,35 @@ def _setup(self):
- _("Home"),
- self.PORTFOLIO_HOME_DIR,
- )
-- if self._has_permission_for(self.DOWNLOAD_PERMISSION):
-+ if self._has_permission_for(self.DOWNLOAD_PERMISSION) and self.XDG_DOWNLOAD:
- self._add_place(
- self._places_group,
- "folder-download-symbolic",
- os.path.basename(self.XDG_DOWNLOAD),
- self.XDG_DOWNLOAD,
- )
-- if self._has_permission_for(self.DOCUMENTS_PERMISSION):
-+ if self._has_permission_for(self.DOCUMENTS_PERMISSION) and self.XDG_DOCUMENTS:
- self._add_place(
- self._places_group,
- "folder-documents-symbolic",
- os.path.basename(self.XDG_DOCUMENTS),
- self.XDG_DOCUMENTS,
- )
-- if self._has_permission_for(self.PICTURES_PERMISSION):
-+ if self._has_permission_for(self.PICTURES_PERMISSION) and self.XDG_PICTURES:
- self._add_place(
- self._places_group,
- "folder-pictures-symbolic",
- os.path.basename(self.XDG_PICTURES),
- self.XDG_PICTURES,
- )
-- if self._has_permission_for(self.MUSIC_PERMISSION):
-+ if self._has_permission_for(self.MUSIC_PERMISSION) and self.XDG_MUSIC:
- self._add_place(
- self._places_group,
- "folder-music-symbolic",
- os.path.basename(self.XDG_MUSIC),
- self.XDG_MUSIC,
- )
-- if self._has_permission_for(self.VIDEOS_PERMISSION):
-+ if self._has_permission_for(self.VIDEOS_PERMISSION) and self.XDG_VIDEOS:
- self._add_place(
- self._places_group,
- "folder-videos-symbolic",
diff --git a/community/portfolio/0002-fall-back-to-gettext-module-on-systems-that.patch b/community/portfolio/0002-fall-back-to-gettext-module-on-systems-that.patch
deleted file mode 100644
index 4fec99783d..0000000000
--- a/community/portfolio/0002-fall-back-to-gettext-module-on-systems-that.patch
+++ /dev/null
@@ -1,219 +0,0 @@
-From aad5dc56192584301bcdbd8e67d7f1157959ad06 Mon Sep 17 00:00:00 2001
-From: Clayton Craft <clayton@craftyguy.net>
-Date: Wed, 3 Mar 2021 14:45:18 -0800
-Subject: [PATCH 1/2] translation: encapsulate gettext to handle systems
- without glibc
-
-Some systems include python without glibc support, and will fail to find
-gettext, bindtextdomain, etc in the locale module. One such system/OS
-without glibc is Alpine Linux / postmarketOS.
-
-This change moves gettext loading to a new wrapper that will fall back
-to using the python gettext implementation [1] if python is built
-without glibc support.
-
-1. https://github.com/hannosch/python-gettext
----
- src/dev.tchx84.Portfolio.in | 6 +++---
- src/meson.build | 1 +
- src/places.py | 3 +--
- src/translation.py | 21 +++++++++++++++++++++
- src/window.py | 3 ++-
- src/worker.py | 2 +-
- 6 files changed, 29 insertions(+), 7 deletions(-)
- create mode 100644 src/translation.py
-
-diff --git a/src/dev.tchx84.Portfolio.in b/src/dev.tchx84.Portfolio.in
-index 9a9068a..b47d863 100755
---- a/src/dev.tchx84.Portfolio.in
-+++ b/src/dev.tchx84.Portfolio.in
-@@ -29,13 +29,13 @@ localedir = '@localedir@'
- sys.path.insert(1, pkgdatadir)
- signal.signal(signal.SIGINT, signal.SIG_DFL)
-
--locale.bindtextdomain('portfolio', localedir)
--locale.textdomain('portfolio')
--
- if __name__ == '__main__':
- from gi.repository import Gio
- resource = Gio.Resource.load(os.path.join(pkgdatadir, 'portfolio.gresource'))
- resource._register()
-
-+ from portfolio.translation import translation_init
-+ translation_init(localedir)
-+
- from portfolio import main
- sys.exit(main.main(VERSION))
-diff --git a/src/meson.build b/src/meson.build
-index 801a8ee..a9d9d77 100644
---- a/src/meson.build
-+++ b/src/meson.build
-@@ -37,6 +37,7 @@ portfolio_sources = [
- 'utils.py',
- 'service.py',
- 'place.py',
-+ 'translation.py',
- ]
-
- install_data(portfolio_sources, install_dir: moduledir)
-diff --git a/src/places.py b/src/places.py
-index 1cbbbe6..2bed48c 100644
---- a/src/places.py
-+++ b/src/places.py
-@@ -17,12 +17,11 @@
-
- import os
-
--from locale import gettext as _
--
- from gi.repository import GLib, Gio, Gtk, GObject, Handy
-
- from . import logger
- from .place import PortfolioPlace
-+from .translation import gettext as _
-
-
- class PortfolioPlaces(Gtk.Stack):
-diff --git a/src/translation.py b/src/translation.py
-new file mode 100644
-index 0000000..51f648b
---- /dev/null
-+++ b/src/translation.py
-@@ -0,0 +1,21 @@
-+import locale
-+
-+try:
-+ from locale import gettext as _
-+except ImportError:
-+ from gettext import gettext as _
-+
-+
-+def translation_init(localedir):
-+ try:
-+ locale.bindtextdomain("portfolio", localedir)
-+ locale.textdomain("portfolio")
-+ except AttributeError:
-+ import gettext
-+
-+ gettext.bindtextdomain("portfolio", localedir)
-+ gettext.textdomain("portfolio")
-+
-+
-+def gettext(*args, **kwargs):
-+ return _(*args, **kwargs)
-diff --git a/src/window.py b/src/window.py
-index 5f3ec80..df7ddb7 100644
---- a/src/window.py
-+++ b/src/window.py
-@@ -18,7 +18,8 @@
- import os
-
- from pathlib import Path
--from locale import gettext as _
-+
-+from .translation import gettext as _
-
- from gi.repository import Gtk, GLib, Gio, Handy, GObject
-
-diff --git a/src/worker.py b/src/worker.py
-index 253ec96..3c8e649 100644
---- a/src/worker.py
-+++ b/src/worker.py
-@@ -21,11 +21,11 @@
- import datetime
- import threading
-
--from locale import gettext as _
- from gi.repository import Gio, GObject, GLib
-
- from . import utils
- from . import logger
-+from .translation import gettext as _
-
-
- class WorkerStoppedException(Exception):
-
-From e66cd9125fcccfcf700189684964019e631fe585 Mon Sep 17 00:00:00 2001
-From: Martin Abente Lahaye <martin.abente.lahaye@gmail.com>
-Date: Fri, 5 Mar 2021 07:23:28 -0300
-Subject: [PATCH 2/2] translation: Refactor into a single init function
-
-This will make it easier to trace the different
-scenarios, e.g. with logging, etc.
----
- src/dev.tchx84.Portfolio.in | 4 ++--
- src/translation.py | 44 ++++++++++++++++++++++++++-----------
- 2 files changed, 33 insertions(+), 15 deletions(-)
-
-diff --git a/src/dev.tchx84.Portfolio.in b/src/dev.tchx84.Portfolio.in
-index b47d863..6719bca 100755
---- a/src/dev.tchx84.Portfolio.in
-+++ b/src/dev.tchx84.Portfolio.in
-@@ -34,8 +34,8 @@ if __name__ == '__main__':
- resource = Gio.Resource.load(os.path.join(pkgdatadir, 'portfolio.gresource'))
- resource._register()
-
-- from portfolio.translation import translation_init
-- translation_init(localedir)
-+ from portfolio import translation
-+ translation.init(localedir)
-
- from portfolio import main
- sys.exit(main.main(VERSION))
-diff --git a/src/translation.py b/src/translation.py
-index 51f648b..10df47c 100644
---- a/src/translation.py
-+++ b/src/translation.py
-@@ -1,21 +1,39 @@
--import locale
-+# translation.py
-+#
-+# Copyright 2021 Clayton Craft
-+# Copyright 2021 Martin Abente Lahaye
-+#
-+# This program is free software: you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation, either version 3 of the License, or
-+# (at your option) any later version.
-+#
-+# This program is distributed in the hope that it will be useful,
-+# but WITHOUT ANY WARRANTY; without even the implied warranty of
-+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+# GNU General Public License for more details.
-+#
-+# You should have received a copy of the GNU General Public License
-+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
--try:
-- from locale import gettext as _
--except ImportError:
-- from gettext import gettext as _
-+from . import logger
-
-+gettext = lambda msg: msg
-+
-+
-+def init(localedir):
-+ global gettext
-
--def translation_init(localedir):
- try:
-+ import locale
-+
-+ gettext = locale.gettext
- locale.bindtextdomain("portfolio", localedir)
- locale.textdomain("portfolio")
- except AttributeError:
-- import gettext
--
-- gettext.bindtextdomain("portfolio", localedir)
-- gettext.textdomain("portfolio")
--
-+ logger.debug("Using fallback gettext module")
-+ import gettext as _gettext
-
--def gettext(*args, **kwargs):
-- return _(*args, **kwargs)
-+ gettext = _gettext.gettext
-+ _gettext.bindtextdomain("portfolio", localedir)
-+ _gettext.textdomain("portfolio")
diff --git a/community/portfolio/APKBUILD b/community/portfolio/APKBUILD
index 8e82e8a9f4..b332858c40 100644
--- a/community/portfolio/APKBUILD
+++ b/community/portfolio/APKBUILD
@@ -1,8 +1,8 @@
# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=portfolio
-pkgver=0.9.10
-pkgrel=2
+pkgver=0.9.11
+pkgrel=0
pkgdesc="Minimalist file manager for those who want to use Linux mobile devices"
url="https://github.com/tchx84/Portfolio"
# riscv64 disabled due to missing rust in recursive dependency
@@ -20,13 +20,12 @@ makedepends="
meson
py3-setuptools
"
+_commit="79c0478df96e5fdf36787f6df4562e4bdec41b77"
source="
- $pkgname-$pkgver.tar.gz::https://github.com/tchx84/Portfolio/archive/v$pkgver.tar.gz
- 0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch
- 0002-fall-back-to-gettext-module-on-systems-that.patch
+ $pkgname-$pkgver.tar.gz::https://github.com/tchx84/Portfolio/archive/$_commit.tar.gz
"
options="!check" # no tests
-builddir="$srcdir/Portfolio-$pkgver"
+builddir="$srcdir/Portfolio-$_commit"
build() {
abuild-meson . output
@@ -37,6 +36,6 @@ package() {
DESTDIR="$pkgdir" meson install -C output
}
-sha512sums="5182c88bc5d00f8f307cf6c23f636a1e4d9fdd79e662cd6a1cb90c80380b9108df0fe5f07f6dd79df40fa14a57dbeeafb324a83961e399d07b5c6bef0007558d portfolio-0.9.10.tar.gz
-dcb14f6d41f7cc1540e6d1341d35e18f10ab1167c65e8b6c2e57acd97656d51e6c036876467b0110ef46c1cf4834c9d54d2e82797dabd6e565718014739ccdf9 0001-places-handle-cases-where-XDG_-dirs-couldnt-be-resolve.patch
-4e6e504b550161fa7c40258926c5f7e98418403d26512399ecceb75613b75b0a1a3707e04fb31bc54c7cd84b5af2c055421222fdbff545e8798076415e81cc8c 0002-fall-back-to-gettext-module-on-systems-that.patch"
+sha512sums="
+f88e84547ea662f33e15fd4adf7c338bcbd32e1be61f2c51dcacbde5a11532649a40052b74b29c5ce10917ce633c5986895c8ad2beb3fdbe81964986e6e3382e portfolio-0.9.11.tar.gz
+"