[arch-commits] Commit in python-yara/trunk (PKGBUILD)

Levente Polyak anthraxx at gemini.archlinux.org
Tue Aug 30 18:33:44 UTC 2022


    Date: Tuesday, August 30, 2022 @ 18:33:44
  Author: anthraxx
Revision: 1288921

upgpkg: python-yara 4.2.3-1

Modified:
  python-yara/trunk/PKGBUILD

----------+
 PKGBUILD |   27 ++++++++++++++++++---------
 1 file changed, 18 insertions(+), 9 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-08-30 18:31:06 UTC (rev 1288920)
+++ PKGBUILD	2022-08-30 18:33:44 UTC (rev 1288921)
@@ -3,8 +3,8 @@
 
 _gitname=yara-python
 pkgname=python-yara
-pkgver=4.2.0
-_gitcommit=0a8659d68ba486286b6d5b7c7f48d171beb78e03
+pkgver=4.2.3
+_gitcommit=8106b84fa967bcd2fff4f5a40e558c36bb8d54e8
 pkgrel=1
 pkgdesc='Tool aimed at helping malware researchers to identify and classify malware samples'
 url='https://github.com/VirusTotal/yara-python'
@@ -11,7 +11,8 @@
 arch=('x86_64')
 license=('Apache')
 depends=('python' 'yara' 'libyara.so' 'glibc')
-makedepends=('git' 'python-setuptools')
+makedepends=('git' 'python-build' 'python-installer' 'python-wheel' 'python-setuptools')
+checkdepends=('python-pytest')
 source=(${pkgname}::git+"https://github.com/VirusTotal/${_gitname}#commit=${_gitcommit}")
 sha512sums=('SKIP')
 
@@ -20,21 +21,29 @@
   git describe --tags --match 'v*' | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
 }
 
+prepare() {
+  cd ${pkgname}
+  mkdir -p tests
+  mv tests.py tests
+}
+
 build() {
   cd ${pkgname}
-  python setup.py build --dynamic-linking
+  python -m build --wheel --no-isolation \
+    -C--global-option=build_ext \
+    -C--global-option=--dynamic-linking
 }
 
 check() {
-  cd ${pkgname}
-  local PYTHONVERSION="$(python -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))')"
-  PYTHONPATH="build/lib.linux-${CARCH}-${PYTHONVERSION}" \
-    python tests.py
+  cd ${pkgname}/tests
+  local PYTHONVERSION="$(python -c 'import sys; print("{}{}".format(sys.version_info.major, sys.version_info.minor))')"
+  PYTHONPATH="$PWD/../build/lib.linux-${CARCH}-cpython-${PYTHONVERSION}" \
+    pytest tests.py
 }
 
 package() {
   cd ${pkgname}
-  python setup.py install --root="${pkgdir}" -O1 --skip-build
+  python -m installer --destdir="$pkgdir" dist/*.whl
   install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
   ln -s /usr/share/doc/yara/docs "${pkgdir}/usr/share/doc/${pkgname}/docs"
 }



More information about the arch-commits mailing list