summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorvantu5z2022-07-25 09:27:01 +0300
committervantu5z2022-07-25 09:27:01 +0300
commit6828f0f6426007c8685a92c2564caef04b8fe1b3 (patch)
treeb4c87a76663e95dc065f58937d26324b17af63f8
downloadaur-6828f0f6426007c8685a92c2564caef04b8fe1b3.tar.gz
init commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD37
2 files changed, 56 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..ea2f861e9117
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = python-libretranslate-git
+ pkgdesc = Python bindings for LibreTranslate
+ pkgver = r28.20220701
+ pkgrel = 1
+ url = https://github.com/argosopentech/LibreTranslate-py
+ arch = any
+ license = MIT
+ makedepends = python-build
+ makedepends = python-installer
+ makedepends = python-wheel
+ depends = python
+ provides = python-libretranslate
+ conflicts = python-libretranslate
+ source = python-libretranslate-git::git+https://github.com/argosopentech/LibreTranslate-py.git
+ sha256sums = SKIP
+
+pkgname = python-libretranslate-git
+ provides = python-libretranslate
+ conflicts = python-libretranslate
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e52303898a1a
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: vantu5z <vantu5z@mail.ru>
+
+pkgname=python-libretranslate-git
+pkgver=r28.20220701
+pkgrel=1
+pkgdesc="Python bindings for LibreTranslate"
+url="https://github.com/argosopentech/LibreTranslate-py"
+depends=('python')
+makedepends=('python-build' 'python-installer' 'python-wheel')
+license=('MIT')
+arch=('any')
+provides=("${pkgname%-git}")
+conflicts=("${pkgname%-git}")
+source=(${pkgname}::"git+https://github.com/argosopentech/LibreTranslate-py.git")
+sha256sums=('SKIP')
+
+pkgver() {
+ cd $pkgname
+ # get number of last git commit
+ _commitCount=$(git rev-list --count HEAD)
+ # get time of last git commit
+ _commitTime=$(git show -s --format="%ci" | grep -o "....-..-.." | sed "s/-//g")
+ # add "r*.*" from package version
+ echo "r$_commitCount.$_commitTime"
+}
+
+build() {
+ cd "${srcdir}/${pkgname}"
+ python -m build --wheel --no-isolation
+}
+
+package() {
+ cd "${srcdir}/${pkgname}"
+ python -m installer --destdir="$pkgdir" dist/*.whl
+provides=("${pkgname%-git}")
+conflicts=("${pkgname%-git}")
+}