From 8533f5a486fd51226777769761a87fa97e75de70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sun, 31 May 2020 18:38:25 +0200 Subject: testing/phpspy: don't vendor termbox Instead use our termbox package. This allows us to remove the python2 compile-time dependency from this package. See #11577 --- testing/phpspy/APKBUILD | 33 ++++++++++++------------------- testing/phpspy/fix-install.patch | 14 +++++++++++++ testing/phpspy/remove-termbox-check.patch | 16 +++++++++++++++ 3 files changed, 43 insertions(+), 20 deletions(-) create mode 100644 testing/phpspy/fix-install.patch create mode 100644 testing/phpspy/remove-termbox-check.patch diff --git a/testing/phpspy/APKBUILD b/testing/phpspy/APKBUILD index d34b99215c..3761c4b1a1 100644 --- a/testing/phpspy/APKBUILD +++ b/testing/phpspy/APKBUILD @@ -1,42 +1,35 @@ +# Contributor: Sören Tempel # Maintainer: Andy Postnikov - pkgname=phpspy pkgver=0.5.0 -_termbox_ver=1.1.2 -pkgrel=0 +pkgrel=1 pkgdesc="Low-overhead sampling profiler for PHP 7 " url="https://github.com/adsr/phpspy" arch="all" license="MIT" depends="perl" -makedepends="linux-headers python2" +makedepends="linux-headers termbox-dev" checkdepends="ncurses bash grep php7 procps" options="!check" # require ptrace capability and checkroot is not enough source="$pkgname-$pkgver.tar.gz::https://github.com/adsr/phpspy/archive/v$pkgver.tar.gz - $pkgname-termbox-$_termbox_ver.tar.gz::https://github.com/nsf/termbox/archive/v$_termbox_ver.tar.gz libpthread.patch + remove-termbox-check.patch + fix-install.patch " -prepare() { - default_prepare - rm -fr "$builddir/vendor/termbox" - ln -sf "$srcdir/termbox-$_termbox_ver" "$builddir/vendor/termbox" -} - build() { - make -} - -check() { - make TERM=xterm test + make phpspy_dynamic } package() { make prefix="/usr" DESTDIR="$pkgdir" install - install -D -v -m 755 stackcollapse-phpspy.pl "$pkgdir"/usr/bin/stackcollapse-phpspy - install -D -v -m 755 vendor/flamegraph.pl "$pkgdir"/usr/bin/flamegraph-phpspy + install -D -v -m 755 stackcollapse-phpspy.pl \ + "$pkgdir"/usr/bin/stackcollapse-phpspy + install -D -v -m 755 vendor/flamegraph.pl \ + "$pkgdir"/usr/bin/flamegraph-phpspy } sha512sums="7163a9f0a44a7dc94e9b722b403218154a27992ba4bfcdae936bdc197b8bc732f70f506318540f356467acdbfec1b0ebc868409010d367a51c056790ab81be1f phpspy-0.5.0.tar.gz -fcb240e9aa480a0cc738f0d01e60c39ef0f333f434c0d1f2d276d3d75edd351e694fd800e0b8dbadd12be686a4261551d10d475933197ef539cdb4dd70c153cb phpspy-termbox-1.1.2.tar.gz -e3a6a0d3943c588570406e13155671fc9e16141e202aada9178681ea2afdc98698f54120a499aab85b82f5de1d25a30afe5cea1209fc2cc7f3da6cf4486dd3b5 libpthread.patch" +e3a6a0d3943c588570406e13155671fc9e16141e202aada9178681ea2afdc98698f54120a499aab85b82f5de1d25a30afe5cea1209fc2cc7f3da6cf4486dd3b5 libpthread.patch +c07a0e9df74dc16fc51445ddc9321314d131049ac0acc3ab7aab76907f05ab78cd3e8fd55e5db14a43e66568ca19f7006369d3f9bf8c09e122a57a58513d071c remove-termbox-check.patch +0d7a53a77fc6b8d191eb873af29771e520b8119357ceda0a81ad710a6d365812be3d4e87c3863d34ee14059a355626ba5dce507607ec7434aed4198bafb33ac3 fix-install.patch" diff --git a/testing/phpspy/fix-install.patch b/testing/phpspy/fix-install.patch new file mode 100644 index 0000000000..f559b83958 --- /dev/null +++ b/testing/phpspy/fix-install.patch @@ -0,0 +1,14 @@ +We don't want a static binary, make sure the install target respects that. + +diff -upr phpspy-0.5.0.orig/Makefile phpspy-0.5.0/Makefile +--- phpspy-0.5.0.orig/Makefile 2020-05-31 18:37:11.787907276 +0200 ++++ phpspy-0.5.0/Makefile 2020-05-31 18:37:18.961241194 +0200 +@@ -55,7 +55,7 @@ test: phpspy_static $(phpspy_tests) + printf "Passed %d out of %d tests\n" $$pass $$total ; \ + [ $$pass -eq $$total ] || exit 1 + +-install: phpspy_static ++install: phpspy_dynamic + install -D -v -m 755 phpspy $(DESTDIR)$(prefix)/bin/phpspy + + clean: diff --git a/testing/phpspy/remove-termbox-check.patch b/testing/phpspy/remove-termbox-check.patch new file mode 100644 index 0000000000..c94fb32dae --- /dev/null +++ b/testing/phpspy/remove-termbox-check.patch @@ -0,0 +1,16 @@ +Check fails with: + + ld: unrecognized option '-Wl,--as-needed' + ld: use the --help option for usage information + +diff -upr phpspy-0.5.0.orig/Makefile phpspy-0.5.0/Makefile +--- phpspy-0.5.0.orig/Makefile 2020-05-31 18:34:19.931393581 +0200 ++++ phpspy-0.5.0/Makefile 2020-05-31 18:34:23.341389992 +0200 +@@ -33,7 +33,6 @@ phpspy_static: $(wildcard *.c *.h) vendo + $(CC) $(phpspy_cflags) $(phpspy_includes) $(termbox_inlcudes) $(phpspy_defines) $(phpspy_sources) -o phpspy $(phpspy_ldflags) $(phpspy_libs) $(termbox_libs) + + phpspy_dynamic: $(wildcard *.c *.h) +- @$(or $(has_termbox), $(error Need libtermbox. Hint: try `make phpspy_static`)) + $(CC) $(phpspy_cflags) $(phpspy_includes) $(phpspy_defines) $(phpspy_sources) -o phpspy $(phpspy_ldflags) $(phpspy_libs) -ltermbox + + vendor/termbox/build/src/libtermbox.a: vendor/termbox/waf -- cgit v1.2.3