summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorJakob Gahde2024-04-09 13:24:22 +0200
committerJakob Gahde2024-04-09 13:27:12 +0200
commite5ee1fcd9ea84572585e0c434e5a0995bbbd1222 (patch)
tree0d51ebcd5d7315cfbbdc2277613bf4f85e12a06e /PKGBUILD
parent30707d09d4eba4186554fb7f67fe620545566caa (diff)
downloadaur-mnemosyne.tar.gz
Switch to new build system
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD50
1 files changed, 34 insertions, 16 deletions
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"
}