summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO14
-rw-r--r--PKGBUILD50
-rw-r--r--fix-icon-search-path.patch2
3 files changed, 43 insertions, 23 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 3ce1a9818e68..5bdac3975ac6 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,14 @@
pkgbase = mnemosyne
pkgdesc = A flash-card tool with a sophisticated card review algorithm
pkgver = 2.11
- pkgrel = 2
+ pkgrel = 3
url = https://www.mnemosyne-proj.org
arch = any
- license = LGPL3
- license = custom:AGPL3 with Mnemosyne attribution requirement
- makedepends = python-setuptools
+ license = LGPL-3.0-only AND LicenseRef-AGPL-3.0-Attribution
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
+ makedepends = python-poetry-core
depends = python
depends = python-pyqt6
depends = python-pyqt6-webengine
@@ -16,17 +18,17 @@ pkgbase = mnemosyne
depends = python-matplotlib
depends = python-cherrypy
depends = python-webob
+ depends = hicolor-icon-theme
optdepends = texlive-core: support for mathematical formulae in cards
optdepends = ttf-ms-fonts: support for non-latin labels on statistic plots
optdepends = python-cheroot: support for starting a sync server
optdepends = python-opengl: mentioned in a non-fatal warning
optdepends = mplayer: for playing audio and video externally
- optdepends = python-googletrans: support for google translate
optdepends = python-google_trans_new: support for google translate
optdepends = python-gtts: support for text-to-speech
source = mnemosyne-2.11.tar.gz::https://github.com/mnemosyne-proj/mnemosyne/archive/refs/tags/2.11.tar.gz
source = fix-icon-search-path.patch
sha256sums = a042252c2fb8c69c44d048e3f3cfca142189fe7d1bb55e0ad98f8edeeb3ae1cd
- sha256sums = 9aa6f5d2f15009169eba0ab5143f97cbf0e9b4522b8c00141c20d7fe5f9194ef
+ sha256sums = 3e0da76723cc7279dc66e9bb0341ae335d5461bffe1b4e555a30e4f74d620114
pkgname = mnemosyne
diff --git a/PKGBUILD b/PKGBUILD
index 2b9eed4111c2..48cf79fbcf89 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,27 +6,26 @@
pkgname=mnemosyne
pkgver=2.11
-pkgrel=2
+pkgrel=3
pkgdesc="A flash-card tool with a sophisticated card review algorithm"
arch=('any')
url='https://www.mnemosyne-proj.org'
-license=('LGPL3' 'custom:AGPL3 with Mnemosyne attribution requirement')
+license=('LGPL-3.0-only AND LicenseRef-AGPL-3.0-Attribution')
depends=('python' 'python-pyqt6' 'python-pyqt6-webengine' 'qt6-multimedia'
'python-argon2_cffi' 'python-pillow' 'python-matplotlib'
- 'python-cherrypy' 'python-webob')
-makedepends=('python-setuptools')
+ 'python-cherrypy' 'python-webob' 'hicolor-icon-theme')
+makedepends=('python-build' 'python-installer' 'python-wheel' 'python-poetry-core')
optdepends=('texlive-core: support for mathematical formulae in cards'
'ttf-ms-fonts: support for non-latin labels on statistic plots'
'python-cheroot: support for starting a sync server'
'python-opengl: mentioned in a non-fatal warning'
'mplayer: for playing audio and video externally'
- 'python-googletrans: support for google translate'
'python-google_trans_new: support for google translate'
'python-gtts: support for text-to-speech')
source=("mnemosyne-${pkgver}.tar.gz::https://github.com/mnemosyne-proj/mnemosyne/archive/refs/tags/${pkgver}.tar.gz"
"fix-icon-search-path.patch")
sha256sums=('a042252c2fb8c69c44d048e3f3cfca142189fe7d1bb55e0ad98f8edeeb3ae1cd'
- '9aa6f5d2f15009169eba0ab5143f97cbf0e9b4522b8c00141c20d7fe5f9194ef')
+ '3e0da76723cc7279dc66e9bb0341ae335d5461bffe1b4e555a30e4f74d620114')
prepare() {
cd "${srcdir}/mnemosyne-${pkgver}"
@@ -39,21 +38,40 @@ prepare() {
build() {
cd "${srcdir}/mnemosyne-${pkgver}"
- # Newer, standards-based build system doesn't seem to install properly (at
- # least the desktop entry and gettext catalogs are missing and some other
- # files in seemingly strange locations). Will figure that out later.
- pushd mnemosyne/pyqt_ui
- for i in *.ui; do
- ./pyuic6 "$i" > "ui_${i%.ui}.py"
- done
- popd
- python setup.py build
+ make -C po
+ python -m build --wheel --no-isolation
}
package() {
cd "${srcdir}/mnemosyne-${pkgver}"
- python setup.py install --root="${pkgdir}" --optimize=1
+ python -m installer --destdir="${pkgdir}" dist/*.whl
+
+ # Clean up duplicate icons and other unwanted files introduced by the PEP 517 transition
+ purelib="${pkgdir}$(python -c "import sysconfig; print(sysconfig.get_path('purelib'))")"
+ rm -rf "${purelib}/"{makefile,pixmaps,mnemosyne/example_plugins,mnemosyne/example_scripts,mnemosyne/libmnemosyne/docs,mnemosyne/script/DO_NOT_DELETE}
+ rm -f "${purelib}/"{mnemosyne,mnemosyne/libmnemosyne/renderers/anki/template,mnemosyne/pyqt_ui,openSM2sync}/{README,LICENSE}*
+ find "${purelib}/mnemosyne/pyqt_ui" \( \
+ -name 'makefile' -o -name 'pyuic6' -o -name '*.ui' -o -name '*.pro' -o -name '*.xcf' -o -name '*.icns' -o -name '*.ico' \
+ \) -delete
+
+ # Now install files that are missing
+ for i in mo/*; do
+ install -Dm644 "${i}/LC_MESSAGES/mnemosyne.mo" \
+ "${pkgdir}/usr/share/locale/${i#*/}/LC_MESSAGES/mnemosyne.mo"
+ done
+ install -Dm644 "mnemosyne.desktop" \
+ "${pkgdir}/usr/share/applications/mnemosyne.desktop"
+ install -Dm644 "pixmaps/mnemosyne_small.png" \
+ "${pkgdir}/usr/share/icons/hicolor/22x22/apps/mnemosyne.png"
+ install -Dm644 "pixmaps/mnemosyne.png" \
+ "${pkgdir}/usr/share/icons/hicolor/128x128/apps/mnemosyne.png"
+ install -Dm644 "pixmaps/mnemosyne_large.png" \
+ "${pkgdir}/usr/share/icons/hicolor/256x256/apps/mnemosyne.png"
+
+ # And finally, licenses
install -Dm644 "LICENSE" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+ install -Dm644 "mnemosyne/libmnemosyne/renderers/anki/template/LICENSE" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.anki-template"
}
diff --git a/fix-icon-search-path.patch b/fix-icon-search-path.patch
index c9ce8a082f16..2d0e8140e8f5 100644
--- a/fix-icon-search-path.patch
+++ b/fix-icon-search-path.patch
@@ -6,7 +6,7 @@ diff -aur package.pristine/mnemosyne/pyqt_ui/mnemosyne package.new/mnemosyne/pyq
# For system install:
QtCore.QDir.addSearchPath("icons",
- os.path.abspath(__file__ + "/../../../pixmaps"))
-+ os.path.abspath(__file__ + "/../../pixmaps"))
++ os.path.abspath(__file__ + "/../pixmaps"))
# For Windows installer:
QtCore.QDir.addSearchPath("icons",
"pixmaps")