diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2019-04-05 21:17:31 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2019-04-05 21:17:31 +0100 |
commit | dc7cbdfa65fd814b3b9aa3c56257da201109e807 (patch) | |
tree | c85d72f6f31f21f178069c9d41d41a7c1ff4b362 /sys-apps/likwid | |
parent | 0706fc6986773f4e4d391deff4ad5143c464ea4e (diff) |
gentoo resync : 05.04.2019
Diffstat (limited to 'sys-apps/likwid')
-rw-r--r-- | sys-apps/likwid/Manifest | 4 | ||||
-rw-r--r-- | sys-apps/likwid/files/likwid-4.3.1-fix-gnustack.patch | 32 | ||||
-rw-r--r-- | sys-apps/likwid/likwid-4.3.3.ebuild | 186 | ||||
-rw-r--r-- | sys-apps/likwid/metadata.xml | 11 |
4 files changed, 233 insertions, 0 deletions
diff --git a/sys-apps/likwid/Manifest b/sys-apps/likwid/Manifest new file mode 100644 index 000000000000..a0be9731680b --- /dev/null +++ b/sys-apps/likwid/Manifest @@ -0,0 +1,4 @@ +AUX likwid-4.3.1-fix-gnustack.patch 1014 BLAKE2B 68ac831c96f826156238bbb4178c4923cb869a2757928af12f788a01067fb129326fec0c7a98b073f504f0aa8234d42dcd9fe7cdb0185b8107a6db3962cfbc08 SHA512 ab12e2ebebfca5c87b1ad2c89c5073aaa6987e8d440cfdfffc107233fc5b66c6562f25fdbd6720df3c1477becaaa3c3ac470fa4f99ac15bb78ea09fa06460a4b +DIST likwid-4.3.3.tar.gz 1579433 BLAKE2B 9ec468bba009dec860b24c9c55c3d6023ffda3ab0985d835796686ba52d1d3372b2bfce926cf229388978de34e1ab0b41d8d27c88623c51c3e8ff1e9d674906b SHA512 ae4d68e238bc40e4a4ab5df628561c9bb7a0ef8727d5779dba2c32fff0be1dd333532bee7e4c197e5fe286de81d35b863ef09f4bc8b9f9145360e6e461f3d94e +EBUILD likwid-4.3.3.ebuild 5585 BLAKE2B efd92d64517d84e798b9db705aa656091e8d4176d94190e44c51fb058548a9a5eb5f95d129f4bba637f12ce745595618bd4d2120d2872ed75192ea52f5dcf2ad SHA512 e5ff5bf6288ffe65b45193199b9dbfcd2af65c703c34b2e0802fa23600c17607774998ca499757c98cd59aee16b62906375d32ef01c69411efa19f9308b77b31 +MISC metadata.xml 333 BLAKE2B bb0321ece26d2e67d8c0cce9895247e8dcb84d72ca1b0186f066e639805e4006d9a8288403042c6fd96fd02489b554eb208843eafe436140f6e352121e5b1806 SHA512 bc44f5e8d86426c7fc32dc2d75c42d85a456c69cacccc1f44dbb8c561defb1748dd665fcc916d3a6577766a3d7bbd0944fa73f7df04b2d17b3fd3353929fa2e2 diff --git a/sys-apps/likwid/files/likwid-4.3.1-fix-gnustack.patch b/sys-apps/likwid/files/likwid-4.3.1-fix-gnustack.patch new file mode 100644 index 000000000000..c543a6ccd2d3 --- /dev/null +++ b/sys-apps/likwid/files/likwid-4.3.1-fix-gnustack.patch @@ -0,0 +1,32 @@ +--- likwid-likwid-4.3.1/bench/Makefile.org 2018-02-26 14:03:17.706837535 +0800 ++++ likwid-likwid-4.3.1/bench/Makefile 2018-02-26 14:04:19.427195208 +0800 +@@ -115,6 +115,7 @@ + $(BUILD_DIR)/%.o: $(BUILD_DIR)/%.pas + @echo "===> ASSEMBLE $@" + $(Q)$(PAS) -i $(PASFLAGS) -o $(BUILD_DIR)/$*.s $< '$(DEFINES)' ++ @cat ../fix_gnustack.txt >> $(BUILD_DIR)/$*.s + $(Q)$(AS) $(ASFLAGS) $(BUILD_DIR)/$*.s -o $@ + + ifeq ($(findstring $(MAKECMDGOALS),clean),) + +diff --git a/fix_gnustack.txt b/fix_gnustack.txt +new file mode 100644 +index 0000000..965af94 +--- /dev/null ++++ likwid-likwid-4.1.1/fix_gnustack.txt +@@ -0,0 +1,3 @@ ++#if defined(__linux__) && defined(__ELF__) ++.section .note.GNU-stack,"",%progbits ++#endif + +--- likwid-likwid-4.3.1/src/loadData.S.org 2018-02-26 14:06:16.418872121 +0800 ++++ likwid-likwid-4.3.1/src/loadData.S 2018-02-26 14:19:03.281289307 +0800 +@@ -41,4 +41,6 @@ + #endif + .size _loadData, .-_loadData + +- ++#if defined(__linux__) && defined(__ELF__) ++.section .note.GNU-stack,"",%progbits ++#endif + diff --git a/sys-apps/likwid/likwid-4.3.3.ebuild b/sys-apps/likwid/likwid-4.3.3.ebuild new file mode 100644 index 000000000000..05afdd520646 --- /dev/null +++ b/sys-apps/likwid/likwid-4.3.3.ebuild @@ -0,0 +1,186 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +FORTRAN_NEEDED=fortran +#PYTHON_COMPAT=( python3_{4,5,6,7} ) + +# 4.3.4 will need python-single-r1 +inherit fcaps fortran-2 linux-info toolchain-funcs + +DESCRIPTION="A performance-oriented tool suite for x86 multicore environments" +HOMEPAGE="https://github.com/rrze-likwid/likwid" +SRC_URI="https://ftp.fau.de/pub/likwid/${P}.tar.gz" + +# If this ebuild is changed to use the bundled Lua-5.3, then MIT should be +# added to the LICENSE field. +LICENSE="GPL-3+ BSD" + +SLOT="0" +KEYWORDS="~amd64" # upstream partial support exists for x86 arm arm64 +IUSE="fortran" # ${PYTHON_REQUIRED_USE} + +# lua: +# likwid's primary functionality is driven by a set of lua scripts installed in +# /usr/bin/ +# likwid bundles lua-5.3.2, AND supports using a system copy of lua-5.2 or +# lua-5.3, which we use. This ebuild uses the system copy of Lua instead. +# +# hwloc: +# likwid bundles a MODIFIED copy of hwloc-2.0.0a1 with specific configuration +# for CPU probing & access +# +# Perl: +# likwid uses Perl to convert from an internal text format to ASM listings +# likwid also uses perl for some installed helper scripts +# The build system bundles some Perl modules, that are not removed at this time: +# Parse-RecDescent +# Template +# +# Python: +# Python3 is used for one helper script, filter/json, added after 4.3.3 +CDEPEND="dev-lang/perl + dev-lang/lua:5.3" + +# filter/json uses Python3 +RDEPEND="${CDEPEND}" + #${PYTHON_DEPS}" + +# Part of the build process depends on Data::Dumper +# perl-core/Data-Dumper" +DEPEND="${CDEPEND}" + +CONFIG_CHECK="~X86_MSR" + +FILECAPS=( + -M 755 cap_sys_rawio+ep usr/sbin/likwid-accessD + -- + -M 755 cap_sys_rawio+ep usr/sbin/likwid-setFreq +) + +PATCHES=( + "${FILESDIR}/${PN}-4.3.1-fix-gnustack.patch" + # Old patches are obsolete: + #"${FILESDIR}/${PN}-4.3.1-Makefile.patch" + #"${FILESDIR}/${PN}-4.3.1-config.mk.patch" +) + +pkg_setup() { + fortran-2_pkg_setup + #python-single-r1_pkg_setup +} + +src_prepare() { + # Ensure we build with a non executable stack + sed \ + -e '/^SHARED_CFLAGS/s/$/ -Wa,--noexecstack/' \ + -i make/include_{GCC*,CLANG}.mk \ + || die "Failed to set nonexecstack" + + # Make the install targets respect Q= for being quiet or not + # MUCH easier for debugging + sed -r \ + -e '/^install/,/^[a-z]/{/^\t@/{ s/@/$(Q)/; }}' \ + -i \ + Makefile || die "Failed to sed Makefile" + + sed -i \ + -e '/^\.NOTPARALLEL:/d' \ + Makefile \ + bench/Makefile \ + ext/hwloc/Makefile || die "Failed to re-enable parallel" + + default +} + +export_emake_opts() { + # Warning: this build system uses PREFIX in a way that differs from + # autoconf! It's more like: + # PREFIX=$(DESTDIR)$(INSTALLED_PREFIX) + # it's not 100% like that, because parts of the Makefiles are inconsistent. + # this is the same solution used in the upstream RPM specs + # these variables are uppercase so they match what's put into Make. + local INSTALLED_PREFIX=/usr + local INSTALLED_LIBPREFIX=/usr/$(get_libdir) # upstream is '$(INSTALLED_PREFIX)/lib' + local INSTALLED_MANPREFIX=/usr/share/man # upstream has it as used but undefined variable. + # TODO: support LUA_SINGLE_TARGET here later for Lua 5.2 + local LUASLOT='5.3' + # If the build is too loud, pass 'Q=@' + src_compile_opts=( + "Q=" + "INSTALLED_PREFIX=${INSTALLED_PREFIX}" + "INSTALLED_LIBPREFIX=${INSTALLED_LIBPREFIX}" + "INSTALLED_MANPREFIX=${INSTALLED_MANPREFIX}" + "PREFIX=${INSTALLED_PREFIX}" + "LIBPREFIX=${INSTALLED_LIBPREFIX}" + "MANPREFIX=${INSTALLED_MANPREFIX}" + "CC=$(tc-getCC)" + "ANSI_CFLAGS=${CFLAGS}" + "INSTRUMENT_BENCH=true" + "LUA_INCLUDE_DIR=/usr/include/lua${LUASLOT}" + "LUA_LIB_DIR=/usr/$(get_libdir)" + "LUA_LIB_NAME=lua${LUASLOT}" + "LUA_BIN=/usr/bin" + "FORTRAN_INTERFACE=$(usex fortran likwid.mod false)" + "FC=$(usex fortran "${FC}" false)" + "FCFLAGS=-J ./ -fsyntax-only" # needed for building correctly + ) + src_install_opts=( + "PREFIX=${D}${INSTALLED_PREFIX}" + "LIBPREFIX=${D}${INSTALLED_LIBPREFIX}" + "MANPREFIX=${D}${INSTALLED_MANPREFIX}" + ) +} + +src_compile() { + export_emake_opts + emake \ + "${src_compile_opts[@]}" \ + || die 'emake failed' +} + +src_install () { + export_emake_opts + emake \ + "${src_compile_opts[@]}" \ + "${src_install_opts[@]}" \ + DESTDIR="${D}" \ + install || die 'emake install failed' + + use fortran && doheader likwid.mod + + # Fix Python filter added shortly after 4.3.3 + #python_fix_shebang "${D}"/usr/share/likwid/filter/ + + # Do NOT use 'doman'! The upstream 'make install' target does a sed as it's + # generating the final manpage to the real install dir; and the copies in + # ${S} are unmodified. + dodoc README.md CHANGELOG doc/logo.png + dodoc doc/*.txt + dodoc doc/*.md + dodoc -r doc/applications doc/archs + # Fix upstream partial doc install + rm -rf "${D}"/usr/share/likwid/docs || die + ln -sf "/usr/share/doc/${PF}" "${D}"/usr/share/likwid/docs || die +} + +pkg_preinst() { + # This is now a symlink, but used to be a plain directory + OLDDOCDIR=/usr/share/likwid/docs + if [[ ! -L "${OLDDOCDIR}" && -d "${OLDDOCDIR}" ]]; then + einfo "Cleaning up old docdir at ${OLDDOCDIR}" + rm -rf "${OLDDOCDIR}" || die + fi +} + +pkg_postinst() { + fcaps_pkg_postinst + einfo "If you get 'Cannot gather values from MSR_PLATFORM_INFO', then 'modprobe msr'!" + einfo + ewarn "To enable users to access performance counters it is necessary to" + ewarn "change the access permissions to /dev/cpu/msr[0]* devices." + ewarn "It can be accomplished by adding the following line to file" + ewarn "/etc/udev/rules.d/99-myrules.rules: KERNEL==\"msr[0-9]*\" MODE=\"0666\"" + ewarn "Alternatively, assign the MSR files to a unique group and use mode 0660" +} diff --git a/sys-apps/likwid/metadata.xml b/sys-apps/likwid/metadata.xml new file mode 100644 index 000000000000..3a16425e9da4 --- /dev/null +++ b/sys-apps/likwid/metadata.xml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>robbat2@gentoo.org</email> + <name>Robin H. Johnson</name> + </maintainer> + <upstream> + <remote-id type="github">rrze-likwid/likwid</remote-id> + </upstream> +</pkgmetadata> |