[arch-commits] Commit in python-diff-match-patch/trunk (PKGBUILD)

Bruno Pagani archange at archlinux.org
Fri Feb 21 14:52:10 UTC 2020


    Date: Friday, February 21, 2020 @ 14:52:10
  Author: archange
Revision: 577583

Clean PKGBUILD, run tests and remove them from pkg

Modified:
  python-diff-match-patch/trunk/PKGBUILD

----------+
 PKGBUILD |   35 +++++++++++++++++++++++------------
 1 file changed, 23 insertions(+), 12 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-02-21 14:51:23 UTC (rev 577582)
+++ PKGBUILD	2020-02-21 14:52:10 UTC (rev 577583)
@@ -1,22 +1,33 @@
 # Maintainer: Jaroslav Lichtblau <svetlemodry at archlinux.org>
-# Contributor: Jakob Gahde <j5lx at fmail.co.uk>
+# Maintainer: Bruno Pagani <archange at archlinux.org>
 
-pkgname=python-diff-match-patch
+_pkg=diff-match-patch
+pkgname=python-${_pkg}
 pkgver=20181111
-pkgrel=3
+pkgrel=4
 pkgdesc="Robust algorithms to perform the operations required for synchronizing plain text"
-arch=('any')
-url="https://pypi.org/project/diff-match-patch/"
-license=('Apache')
-makedepends=('python' 'python-setuptools')
-source=(https://files.pythonhosted.org/packages/f0/2a/5ba07def0e9107d935aba62cf632afbd0f7c723a98af47ccbcab753d2452/diff-match-patch-$pkgver.tar.gz)
+arch=(any)
+url="https://github.com/diff-match-patch-python/diff-match-patch"
+license=(Apache)
+depends=(python)
+makedepends=(python-setuptools)
+checkdepends=(python-pytest)
+source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
 sha256sums=('a809a996d0f09b9bbd59e9bbd0b71eed8c807922512910e05cbd3f9480712ddb')
 
-package() {
-  depends=('python')
+build() {
+  cd ${_pkg}-${pkgver}
+  python setup.py build
+}
 
-  cd "${srcdir}"/diff-match-patch-$pkgver
+check() {
+  cd ${_pkg}-${pkgver}
+  pytest
+}
 
-  python setup.py install --root="${pkgdir}" -O1
+package() {
+  cd ${_pkg}-${pkgver}
+  python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1
   find "${pkgdir}" -name *_py2.* -delete
+  rm -r "${pkgdir}"$(python -c "import site; print(site.getsitepackages()[0])")/${_pkg//-/_}/tests
 }



More information about the arch-commits mailing list