Gentoo Archives: gentoo-commits

From: Matthias Maier <tamiko@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/dev/tamiko:master commit in: sys-apps/likwid/
Date: Wed, 02 Jun 2021 02:46:56
Message-Id: 1622601901.15cac6729e56a8f8ca74e712b17dd4546e02c2d5.tamiko@gentoo
1 commit: 15cac6729e56a8f8ca74e712b17dd4546e02c2d5
2 Author: Matthias Maier <tamiko <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 2 02:45:01 2021 +0000
4 Commit: Matthias Maier <tamiko <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 2 02:45:01 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/dev/tamiko.git/commit/?id=15cac672
7
8 sys-apps/likwid: version bump to 5.1.1
9
10 Package-Manager: Portage-3.0.19, Repoman-3.0.3
11 Signed-off-by: Matthias Maier <tamiko <AT> gentoo.org>
12
13 sys-apps/likwid/Manifest | 1 +
14 sys-apps/likwid/likwid-5.1.1-r50.ebuild | 151 ++++++++++++++++++++++++++++++++
15 2 files changed, 152 insertions(+)
16
17 diff --git a/sys-apps/likwid/Manifest b/sys-apps/likwid/Manifest
18 index 88a24b8..5d7394f 100644
19 --- a/sys-apps/likwid/Manifest
20 +++ b/sys-apps/likwid/Manifest
21 @@ -1,3 +1,4 @@
22 DIST likwid-4.3.4.tar.gz 1584829 SHA256 5c0d1c66b25dac8292a02232f06454067f031a238f010c62f40ef913c6609a83 SHA512 f1ee930a98d160728078a81a2cdc798ec62ac484545ced937131e6a6443e5ac23b8e597d31c7b1b9f67c1169e1c662c366cf1098158cb467d9f7ff12946b08a2 WHIRLPOOL 956070af7bd2893bfe8bbd994d44ba783795916f3f70e0253501e798b2cc4880a77a541c4089749decd4fd4ba14e7170c3404096b334377ac6caa322d1ed8aaa
23 DIST likwid-5.0.1.tar.gz 2123648 SHA256 3757b0cb66e8af0116f9288c7f90543acbd8e2af8f72f77aef447ca2b3e76453 SHA512 e4982f3ac83e6413434e05daecf821c1c5f57c4cb19d99e61523c6f0009a2d2cef9c080ac711c72960552170b4d329dd08f73f55de5fb96288e92caaacf8b00b WHIRLPOOL a09a2bea3413ca262042a900cd72ab5142eb84919eca1a1908ea0f47db264c1070c70516c335d4eb3c2479ad1e5c5302b64bbe8e8499a3aa518e910269437fe4
24 DIST likwid-5.1.0.tar.gz 2221991 SHA256 5a180702a1656c6315b861a85031ab4cb090424aec42cbbb326b849e29f55571 SHA512 574f391fe903e9d5bfaeba70641be9c00baed93911fc8b33466023b825afb0a425af6080af1c25fe9f9a3913893f5449f6cb2adae80d44bf29f1a75d5f9bad91 WHIRLPOOL 67911ecbfddad51554e12fbfee3b8e7efee2ce31301f95fdde861858c1baabe32d6a2784a0ca46fdf5d818d816ca8ea8d13fd705af3fc829e142c31dffb1c78c
25 +DIST likwid-5.1.1.tar.gz 2226404 SHA256 faec7c62987967232f476a6ff0ee85af686fd24b5a360126896b7f435d1f943f SHA512 6f78f57ffddbc12c4861945b5aece86f94b1086911ff2972e1bb5fed08f263c57e73dd278f0d146a9ca3438159b14a8b5431f281972842269fc2f5adb52de6c1 WHIRLPOOL 349206045b365b2363618feb0f609852ac7d01c00e46488a172de3d4ba84d0140fdb2bd36f39473c65fc27420def598836e4e7bd30d9f0ac8ceb3b162ebadf7f
26
27 diff --git a/sys-apps/likwid/likwid-5.1.1-r50.ebuild b/sys-apps/likwid/likwid-5.1.1-r50.ebuild
28 new file mode 100644
29 index 0000000..fe50e47
30 --- /dev/null
31 +++ b/sys-apps/likwid/likwid-5.1.1-r50.ebuild
32 @@ -0,0 +1,151 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +FORTRAN_NEEDED=fortran
39 +#PYTHON_COMPAT=( python3_{5,6,7} )
40 +
41 +# 4.3.4 will need python-single-r1
42 +inherit fcaps fortran-2 linux-info toolchain-funcs
43 +
44 +DESCRIPTION="A performance-oriented tool suite for x86 multicore environments"
45 +HOMEPAGE="https://github.com/rrze-likwid/likwid"
46 +SRC_URI="https://ftp.fau.de/pub/likwid/${P}.tar.gz"
47 +
48 +LICENSE="GPL-3+ BSD MIT"
49 +
50 +SLOT="0"
51 +KEYWORDS="~amd64" # upstream partial support exists for x86 arm arm64
52 +IUSE="fortran" # ${PYTHON_REQUIRED_USE}
53 +
54 +CDEPEND="dev-lang/perl"
55 +
56 +# filter/json uses Python3
57 +RDEPEND="${CDEPEND}"
58 +
59 +DEPEND="${CDEPEND}"
60 +
61 +CONFIG_CHECK="~X86_MSR"
62 +
63 +FILECAPS=(
64 + -M 755 cap_sys_rawio+ep usr/sbin/likwid-accessD
65 + --
66 + -M 755 cap_sys_rawio+ep usr/sbin/likwid-setFreq
67 +)
68 +
69 +PATCHES=(
70 + "${FILESDIR}/${PN}-4.3.1-fix-gnustack.patch"
71 +)
72 +
73 +pkg_setup() {
74 + fortran-2_pkg_setup
75 +}
76 +
77 +src_prepare() {
78 + # Ensure we build with a non executable stack
79 + sed \
80 + -e '/^SHARED_CFLAGS/s/$/ -Wa,--noexecstack/' \
81 + -i make/include_{GCC*,CLANG}.mk \
82 + || die "Failed to set nonexecstack"
83 +
84 + # Make the install targets respect Q= for being quiet or not
85 + # MUCH easier for debugging
86 + sed -r \
87 + -e '/^install/,/^[a-z]/{/^\t@/{ s/@/$(Q)/; }}' \
88 + -i \
89 + Makefile || die "Failed to sed Makefile"
90 +
91 + sed -i \
92 + -e '/^\.NOTPARALLEL:/d' \
93 + Makefile \
94 + bench/Makefile \
95 + ext/hwloc/Makefile || die "Failed to re-enable parallel"
96 +
97 + default
98 +}
99 +
100 +export_emake_opts() {
101 + # Warning: this build system uses PREFIX in a way that differs from
102 + # autoconf! It's more like:
103 + # PREFIX=$(DESTDIR)$(INSTALLED_PREFIX)
104 + # it's not 100% like that, because parts of the Makefiles are inconsistent.
105 + # this is the same solution used in the upstream RPM specs
106 + # these variables are uppercase so they match what's put into Make.
107 + local INSTALLED_PREFIX=/usr
108 + local INSTALLED_LIBPREFIX=/usr/$(get_libdir) # upstream is '$(INSTALLED_PREFIX)/lib'
109 + local INSTALLED_MANPREFIX=/usr/share/man # upstream has it as used but undefined variable.
110 + # If the build is too loud, pass 'Q=@'
111 + src_compile_opts=(
112 + "Q="
113 + "INSTALLED_PREFIX=${INSTALLED_PREFIX}"
114 + "INSTALLED_LIBPREFIX=${INSTALLED_LIBPREFIX}"
115 + "INSTALLED_MANPREFIX=${INSTALLED_MANPREFIX}"
116 + "PREFIX=${INSTALLED_PREFIX}"
117 + "LIBPREFIX=${INSTALLED_LIBPREFIX}"
118 + "MANPREFIX=${INSTALLED_MANPREFIX}"
119 + "CC=$(tc-getCC)"
120 + "ANSI_CFLAGS=${CFLAGS}"
121 + "INSTRUMENT_BENCH=true"
122 + "FORTRAN_INTERFACE=$(usex fortran likwid.mod false)"
123 + "FC=$(usex fortran "${FC}" false)"
124 + "FCFLAGS=-J ./ -fsyntax-only" # needed for building correctly
125 + )
126 + src_install_opts=(
127 + "PREFIX=${D}${INSTALLED_PREFIX}"
128 + "LIBPREFIX=${D}${INSTALLED_LIBPREFIX}"
129 + "MANPREFIX=${D}${INSTALLED_MANPREFIX}"
130 + )
131 +}
132 +
133 +src_compile() {
134 + export_emake_opts
135 + emake \
136 + "${src_compile_opts[@]}" \
137 + || die 'emake failed'
138 +}
139 +
140 +src_install () {
141 + export_emake_opts
142 + emake \
143 + "${src_compile_opts[@]}" \
144 + "${src_install_opts[@]}" \
145 + DESTDIR="${D}" \
146 + install || die 'emake install failed'
147 +
148 + use fortran && doheader likwid.mod
149 +
150 + # Fix Python filter added shortly after 4.3.3
151 + #python_fix_shebang "${D}"/usr/share/likwid/filter/
152 +
153 + # Do NOT use 'doman'! The upstream 'make install' target does a sed as it's
154 + # generating the final manpage to the real install dir; and the copies in
155 + # ${S} are unmodified.
156 + dodoc README.md CHANGELOG
157 + dodoc doc/*.txt
158 + dodoc doc/*.md
159 + dodoc -r doc/applications doc/archs
160 + # Fix upstream partial doc install
161 + rm -rf "${D}"/usr/share/likwid/docs || die
162 + ln -sf "/usr/share/doc/${PF}" "${D}"/usr/share/likwid/docs || die
163 +}
164 +
165 +pkg_preinst() {
166 + # This is now a symlink, but used to be a plain directory
167 + OLDDOCDIR=/usr/share/likwid/docs
168 + if [[ ! -L "${OLDDOCDIR}" && -d "${OLDDOCDIR}" ]]; then
169 + einfo "Cleaning up old docdir at ${OLDDOCDIR}"
170 + rm -rf "${OLDDOCDIR}" || die
171 + fi
172 +}
173 +
174 +pkg_postinst() {
175 + fcaps_pkg_postinst
176 + einfo "If you get 'Cannot gather values from MSR_PLATFORM_INFO', then 'modprobe msr'!"
177 + einfo
178 + ewarn "To enable users to access performance counters it is necessary to"
179 + ewarn "change the access permissions to /dev/cpu/msr[0]* devices."
180 + ewarn "It can be accomplished by adding the following line to file"
181 + ewarn "/etc/udev/rules.d/99-myrules.rules: KERNEL==\"msr[0-9]*\" MODE=\"0666\""
182 + ewarn "Alternatively, assign the MSR files to a unique group and use mode 0660"
183 +}