summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO27
-rw-r--r--PKGBUILD70
-rw-r--r--python-vmprof-0.4.15-pep479.patch (renamed from pep-479.patch)0
-rw-r--r--python3.10-no-co_lnotab.patch56
4 files changed, 115 insertions, 38 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 2f9002820415..d9b48d6af972 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,26 +1,27 @@
pkgbase = python-vmprof
- pkgdesc = A statistical Python program profiler
+ pkgdesc = A statistical program profiler
pkgver = 0.4.15
- pkgrel = 1
- url = https://github.com/vmprof/vmprof-python
- arch = i686
+ pkgrel = 4
+ url = https://vmprof.com/#/
arch = x86_64
license = MIT
- checkdepends = python-pytest
checkdepends = python-cffi
checkdepends = python-hypothesis
+ checkdepends = python-pytest
makedepends = python-setuptools
- depends = libdwarf
- depends = libelf
depends = libunwind
+ depends = python
+ depends = python-colorama
depends = python-pytz
depends = python-requests
- depends = python-colorama
depends = python-six
- source = https://github.com/vmprof/vmprof-python/archive/0.4.15.tar.gz
- source = pep-479.patch
- sha256sums = 39ec09f84df30e9af566d1eefe8d53bfd89758febd3336e73e3648d1556e4108
- sha256sums = 6df41198c903a4b6575e2bfdce9a1548909b318ab06f715c442a6608668815ec
+ source = python-vmprof-0.4.15.tar.gz::https://github.com/vmprof/vmprof-python/archive/0.4.15.tar.gz
+ source = python-vmprof-0.4.15-gcc10.patch::https://github.com/vmprof/vmprof-python/commit/854191e03004.patch
+ source = python-vmprof-0.4.15-pep479.patch
+ source = python3.10-no-co_lnotab.patch
+ sha512sums = 1815e3310ea83b241514e7773d89f8ee40425119dc7ba195d1fb513596bd63d64ad5d50b0dc0c33e10157469d2d772c5d6435362042971167238ac86f1689b01
+ sha512sums = fe6eba8adb47c66f4c67d6559a83222e07fde23c75e732961e5e4370dea3fcfbcd1b81522adb37a321e92ba6ad87c58e887e20511c81e20669f39e6e1de87e30
+ sha512sums = ea085605b70a5cbf3629f5da0401747f1082bd7be3dda21ba036d7444cf48cebd3ad79312d70cd2daff652222f52201d4a4aee40c8c10fd15b7a4bb6ec03aa73
+ sha512sums = 0c169f720c3bd0937fef5a7dc264cad8b32f280bbb1e0c287ae47b784ee1c72c3ff2690ebc98240f0d616d3d9ed54781d01b037dd7c627d5de5a9d7ad6346953
pkgname = python-vmprof
-
diff --git a/PKGBUILD b/PKGBUILD
index ff1bcdb735b5..00cb33e430a7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,42 +1,62 @@
-# Contributor: Antony Lee <anntzer dot lee at gmail dot com>
-# Maintainer: Eric Anderson <ejona86@gmail.com>
+# Maintainer: David Runge <dvzrv@archlinux.org>
+_name=vmprof
pkgname=python-vmprof
-_reponame=vmprof-python
pkgver=0.4.15
-pkgrel=1
-pkgdesc="A statistical Python program profiler"
-url="https://github.com/vmprof/vmprof-python"
-depends=('libdwarf' 'libelf' 'libunwind'
- 'python-pytz' 'python-requests' 'python-colorama' 'python-six')
-makedepends=('python-setuptools')
-checkdepends=('python-pytest' 'python-cffi' 'python-hypothesis')
-license=('MIT')
-arch=('i686' 'x86_64')
-# Use github archive instead of pypi because it contains tests
-source=("https://github.com/vmprof/$_reponame/archive/$pkgver.tar.gz"
- "pep-479.patch")
-sha256sums=('39ec09f84df30e9af566d1eefe8d53bfd89758febd3336e73e3648d1556e4108'
- '6df41198c903a4b6575e2bfdce9a1548909b318ab06f715c442a6608668815ec')
+pkgrel=4
+pkgdesc="A statistical program profiler"
+arch=(x86_64)
+url="https://vmprof.com/#/"
+license=(MIT)
+depends=(libunwind python python-colorama python-pytz python-requests python-six)
+makedepends=(python-setuptools)
+checkdepends=(python-cffi python-hypothesis python-pytest)
+# tests are not available in pypi sdist
+# https://github.com/vmprof/vmprof-python/issues/215
+# source=("https://files.pythonhosted.org/packages/source/${_name::1}/${_name}/${_name}-${pkgver}.tar.gz")
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/${_name}/${_name}-python/archive/${pkgver}.tar.gz"
+ "${pkgname}-${pkgver}-gcc10.patch::https://github.com/vmprof/vmprof-python/commit/854191e03004.patch"
+ "${pkgname}-${pkgver}-pep479.patch"
+ "python3.10-no-co_lnotab.patch")
+sha512sums=('1815e3310ea83b241514e7773d89f8ee40425119dc7ba195d1fb513596bd63d64ad5d50b0dc0c33e10157469d2d772c5d6435362042971167238ac86f1689b01'
+ 'fe6eba8adb47c66f4c67d6559a83222e07fde23c75e732961e5e4370dea3fcfbcd1b81522adb37a321e92ba6ad87c58e887e20511c81e20669f39e6e1de87e30'
+ 'ea085605b70a5cbf3629f5da0401747f1082bd7be3dda21ba036d7444cf48cebd3ad79312d70cd2daff652222f52201d4a4aee40c8c10fd15b7a4bb6ec03aa73'
+ '0c169f720c3bd0937fef5a7dc264cad8b32f280bbb1e0c287ae47b784ee1c72c3ff2690ebc98240f0d616d3d9ed54781d01b037dd7c627d5de5a9d7ad6346953')
prepare() {
- cd "$_reponame-$pkgver"
- patch -Np1 -i "${srcdir}/pep-479.patch"
+ mv -v "${_name}-python-$pkgver" "$pkgname-$pkgver"
+ cd "$pkgname-$pkgver"
+ # https://github.com/vmprof/vmprof-python/pull/203
+ patch -Np1 -i ../"${pkgname}-${pkgver}-gcc10.patch"
+ # fixing PEP479 problems:
+ # https://github.com/vmprof/vmprof-python/issues/188
+ patch -Np1 -i ../"${pkgname}-${pkgver}-pep479.patch"
+
+ # python 3.10 https://github.com/vmprof/vmprof-python/commit/db1cc42e9f42d464f265f8480f03e3756bd957f2#diff-cc6749fe394944fab6531b387fdd3459827f7c78b7e87f0cb977c4bf231f43de
+ patch -Np1 -i ${srcdir}/python3.10-no-co_lnotab.patch
+ # fixing TestNative tests:
+ # https://github.com/vmprof/vmprof-python/issues/216
sed -i 's/-Werror/-w/g' vmprof/test/*
}
build() {
- cd "$_reponame-$pkgver"
+ cd "$pkgname-$pkgver"
python setup.py build
}
check() {
- cd "$_reponame-$pkgver"
- PYTHONPATH="$PWD/build/lib.linux-$CARCH-3.7" pytest
+ cd "$pkgname-$pkgver"
+ local python_version=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))')
+ export PYTHONPATH="build/lib.linux-${CARCH}-${python_version}:${PYTHONPATH}"
+ pytest -k 'not test_resolve_addr' -v vmprof/test
}
package() {
- cd "$_reponame-$pkgver"
- python setup.py install --root="$pkgdir/" --optimize=1 --skip-build
- install -D -m644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+ cd "$pkgname-$pkgver"
+ python setup.py install --skip-build \
+ --optimize=1 \
+ --prefix=/usr \
+ --root="${pkgdir}"
+ install -vDm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
+ install -vDm 644 README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
}
diff --git a/pep-479.patch b/python-vmprof-0.4.15-pep479.patch
index 4a5ac9a58bde..4a5ac9a58bde 100644
--- a/pep-479.patch
+++ b/python-vmprof-0.4.15-pep479.patch
diff --git a/python3.10-no-co_lnotab.patch b/python3.10-no-co_lnotab.patch
new file mode 100644
index 000000000000..e0f35d9dcdb1
--- /dev/null
+++ b/python3.10-no-co_lnotab.patch
@@ -0,0 +1,56 @@
+From db1cc42e9f42d464f265f8480f03e3756bd957f2 Mon Sep 17 00:00:00 2001
+From: Timothy Palpant <palpant@dropbox.com>
+Date: Mon, 10 Jun 2019 18:18:34 -0400
+Subject: [PATCH] Use PyFrame_GetLineNumber to get line numbers
+
+---
+ src/vmp_stack.c | 29 ++---------------------------
+ 1 file changed, 2 insertions(+), 27 deletions(-)
+
+diff --git a/src/vmp_stack.c b/src/vmp_stack.c
+index 612e95a..6464846 100644
+--- a/src/vmp_stack.c
++++ b/src/vmp_stack.c
+@@ -82,12 +82,6 @@ int vmp_profiles_python_lines(void) {
+
+ static PY_STACK_FRAME_T * _write_python_stack_entry(PY_STACK_FRAME_T * frame, void ** result, int * depth, int max_depth)
+ {
+- int len;
+- int addr;
+- int j;
+- uint64_t line;
+- char *lnotab;
+-
+ #ifndef RPYTHON_VMPROF // pypy does not support line profiling
+ if (vmp_profiles_python_lines()) {
+ // In the line profiling mode we save a line number for every frame.
+@@ -99,27 +93,8 @@ static PY_STACK_FRAME_T * _write_python_stack_entry(PY_STACK_FRAME_T * frame, vo
+
+ // NOTE: the profiling overhead can be reduced by storing co_lnotab in the dump and
+ // moving this computation to the reader instead of doing it here.
+- lnotab = PyStr_AS_STRING(frame->f_code->co_lnotab);
+-
+- if (lnotab != NULL) {
+- line = (uint64_t)frame->f_lineno;
+- addr = 0;
+-
+- len = (int)PyStr_GET_SIZE(frame->f_code->co_lnotab);
+-
+- for (j = 0; j < len; j += 2) {
+- addr += lnotab[j];
+- if (addr > frame->f_lasti) {
+- break;
+- }
+- line += lnotab[j+1];
+- }
+- result[*depth] = (void*) line;
+- *depth = *depth + 1;
+- } else {
+- result[*depth] = (void*) 0;
+- *depth = *depth + 1;
+- }
++ result[*depth] = (void*) PyFrame_GetLineNumber(frame);
++ *depth = *depth + 1;
+ }
+ result[*depth] = (void*)CODE_ADDR_TO_UID(FRAME_CODE(frame));
+ *depth = *depth + 1;