From aa407693a423da185be0be6738e51204901850c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Tue, 5 Sep 2023 20:25:30 +0700 Subject: [PATCH] New package: libpfm4-4.13.0 --- common/shlibs | 2 +- srcpkgs/libpfm4-devel | 1 + srcpkgs/libpfm4/patches/build-params.patch | 43 +++++++++++++++++ srcpkgs/libpfm4/template | 56 ++++++++++++++++++++++ srcpkgs/python3-perfmon | 1 + 5 files changed, 102 insertions(+), 1 deletion(-) create mode 120000 srcpkgs/libpfm4-devel create mode 100644 srcpkgs/libpfm4/patches/build-params.patch create mode 100644 srcpkgs/libpfm4/template create mode 120000 srcpkgs/python3-perfmon diff --git a/common/shlibs b/common/shlibs index 14a51bd4ca9..c5c2d54ca8d 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3405,7 +3405,7 @@ libeog.so eog-3.28.0_4 libfreexl.so.1 freexl-1.0.5_1 libgeos_c.so.1 geos-3.9.0_1 libpapi.so.5 papi-5.6.0_1 -libpfm.so.4 papi-5.6.0_1 +libpfm.so.4 libpfm4-4.13.0_1 libfifechan.so.0.1.5 fifechan-0.1.5_1 libfifechan_sdl.so.0.1.5 fifechan-0.1.5_1 libfifechan_opengl.so.0.1.5 fifechan-0.1.5_1 diff --git a/srcpkgs/libpfm4-devel b/srcpkgs/libpfm4-devel new file mode 120000 index 00000000000..954b4ab6aeb --- /dev/null +++ b/srcpkgs/libpfm4-devel @@ -0,0 +1 @@ +libpfm4 \ No newline at end of file diff --git a/srcpkgs/libpfm4/patches/build-params.patch b/srcpkgs/libpfm4/patches/build-params.patch new file mode 100644 index 00000000000..64605047757 --- /dev/null +++ b/srcpkgs/libpfm4/patches/build-params.patch @@ -0,0 +1,43 @@ +--- a/config.mk ++++ b/config.mk +@@ -28,8 +28,20 @@ + # It is included by every Makefile + # + # +-SYS := $(shell uname -s) +-ARCH := $(shell uname -m) ++SYS := Linux ++ifeq (i686,$(findstring i686,$(XBPS_TARGET_MACHINE))) ++ARCH := i386 ++else ifeq (x86_64,$(findstring x86_64,$(XBPS_TARGET_MACHINE))) ++ARCH := x86_64 ++else ifeq (arm,$(findstring arm,$(XBPS_TARGET_MACHINE))) ++ARCH := arm ++else ifeq (aarch64,$(findstring aarch64,$(XBPS_TARGET_MACHINE))) ++ARCH := arm64 ++else ifeq (ppc,$(findstring ppc,$(XBPS_TARGET_MACHINE))) ++ARCH := powerpc ++else ifeq (mips,$(findstring mips,$(XBPS_TARGET_MACHINE))) ++ARCH := mips ++endif + ifeq (i686,$(findstring i686,$(ARCH))) + override ARCH=i386 + endif +@@ -116,7 +128,7 @@ AGE=0 + # + # Where should things (lib, headers, man) go in the end. + # +-PREFIX?=/usr/local ++PREFIX?=/usr + LIBDIR=$(PREFIX)/lib + INCDIR=$(PREFIX)/include + MANDIR=$(PREFIX)/share/man +@@ -198,7 +210,7 @@ PFMLIBDIR=$(TOPDIR)/lib + # -Wextra: to enable extra compiler sanity checks (e.g., signed vs. unsigned) + # -Wno-unused-parameter: to avoid warnings on unused foo(void *this) parameter + # +-DBG?=-g -Wall -Werror -Wextra -Wno-unused-parameter ++DBG?=-g -Wall -Wextra -Wno-unused-parameter + + ifeq ($(SYS),Darwin) + # older gcc-4.2 does not like -Wextra and some of our initialization code diff --git a/srcpkgs/libpfm4/template b/srcpkgs/libpfm4/template new file mode 100644 index 00000000000..b11551a610e --- /dev/null +++ b/srcpkgs/libpfm4/template @@ -0,0 +1,56 @@ +# Template file for 'libpfm4' +pkgname=libpfm4 +version=4.13.0 +revision=1 +build_style=gnu-makefile +build_helper=python3 +make_use_env=yes +hostmakedepends="python3-setuptools swig" +makedepends="python3-devel" +short_desc="Library to program the performance monitoring events" +maintainer="Đoàn Trần Công Danh " +license="MIT" +homepage="https://perfmon2.sourceforge.net/" +distfiles="${SOURCEFORGE_SITE}/perfmon2/libpfm-${version}.tar.gz" +checksum=d18b97764c755528c1051d376e33545d0eb60c6ebf85680436813fa5b04cc3d1 +conflicts="papi<7.0.0_1" + +export XBPS_TARGET_MACHINE + +do_build() { + msg_normal "Building libpfm4\n" + make ${makejobs} PREFIX=/usr + msg_normal "Building Python 3 bindings\n" + cd python + python3 setup.py build +} + +do_install() { + make install DESTDIR=${DESTDIR} PREFIX=/usr + { + find include lib -name '*.h' -o -name '*.c' | + xargs grep -h Copyright + cat COPYING + } >license + vlicense license +} + +libpfm4-devel_package() { + depends="${sourcepkg}>=${version}_${revision}" + short_desc+=" - development files" + conflicts="papi-devel<7.0.0_1" + pkg_install() { + vmove usr/share/man/man3 + vmove usr/include + vmove "usr/lib/*.a" + vmove "usr/lib/*.so" + } +} + +python3-perfmon_package() { + short_desc+=" - Python 3 bindings" + pkg_install() { + cd python + python3 setup.py install --prefix=/usr --root=${PKGDESTDIR} + } +} diff --git a/srcpkgs/python3-perfmon b/srcpkgs/python3-perfmon new file mode 120000 index 00000000000..954b4ab6aeb --- /dev/null +++ b/srcpkgs/python3-perfmon @@ -0,0 +1 @@ +libpfm4 \ No newline at end of file