summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorVitalii Kuzhdin2024-08-06 18:01:23 +0300
committerVitalii Kuzhdin2024-08-06 18:01:23 +0300
commitd63d021d26605d57349f050fb2a91aa83e546817 (patch)
tree80edebb3a7cf975d20e363feafdd0477b7c9b898 /PKGBUILD
downloadaur-d63d021d26605d57349f050fb2a91aa83e546817.tar.gz
Initial build (1.1.2)
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD46
1 files changed, 46 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..7e3275e26840
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,46 @@
+# Maintainer: Vitalii Kuzhdin <vitaliikuzhdin@gmail.com>
+
+_name="chafapy"
+pkgname="python-${_name}"
+pkgver=1.1.2
+pkgrel=1
+pkgdesc="Python bindings for Chafa. Visualize images with text in Python."
+arch=('any')
+url="https://github.com/guardkenzie/chafa.py"
+license=('GPL-3.0-or-later' 'LGPL-3.0-or-later')
+makedepends=('python-build' 'python-installer' 'python-wheel'
+ 'python-hatchling')
+# checkdepends=('python-pytest' 'python-pillow')
+depends=('glibc' 'python>=3.8' 'chafa' 'glib2')
+_pkgsrc="chafa.py-${pkgver}"
+source=("${_pkgsrc}.tar.gz::${url}/archive/v${pkgver}.tar.gz")
+sha256sums=('547068d301274262ea1e6cb4f8cddc5b714a142c684fcd27f3aefa70ad95aea1')
+
+prepare() {
+ cd "${srcdir}/${_pkgsrc}"
+ cp "/usr/lib/libchafa.so" "libs/linux/libchafa.so"
+}
+
+build () {
+ cd "${srcdir}/${_pkgsrc}"
+ python -m build --wheel --no-isolation
+}
+
+# check () {
+# cd "${srcdir}/${_pkgsrc}"
+# pytest
+# }
+
+package () {
+ local site_packages=$(python -c "import site; print(site.getsitepackages()[0])")
+
+ cd "${srcdir}/${_pkgsrc}"
+ python -m installer --destdir="${pkgdir}" dist/*.whl
+
+ install -Dm644 "README.md" "${pkgdir}/usr/share/doc/${pkgname}/README.md"
+ install -d "${pkgdir}/usr/share/licenses/${pkgname}"
+ ln -s "${pkgdir}${site_packages}/chafa.py-${pkgver}.dist-info/licenses/COPYING" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/COPYING"
+ ln -s "${pkgdir}${site_packages}/chafa.py-${pkgver}.dist-info/licenses/COPYING.LESSER" \
+ "${pkgdir}/usr/share/licenses/${pkgname}/COPYING.LESSER"
+}