From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1229269-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 3ED711382C5
	for <garchives@archives.gentoo.org>; Mon,  7 Dec 2020 12:22:24 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 8C467E0DDB;
	Mon,  7 Dec 2020 12:22:23 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 660FDE0DDB
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Dec 2020 12:22:23 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7335C341235
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Dec 2020 12:22:20 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id DAB0446F
	for <gentoo-commits@lists.gentoo.org>; Mon,  7 Dec 2020 12:22:18 +0000 (UTC)
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Marek Szuba" <marecki@gentoo.org>
Message-ID: <1607343729.c44e033f4d003ae9d8cabadcb1a0ce142910cdbe.marecki@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/likwid/, profiles/
X-VCS-Repository: repo/gentoo
X-VCS-Files: profiles/package.mask sys-apps/likwid/likwid-4.3.4.ebuild
X-VCS-Directories: sys-apps/likwid/ profiles/
X-VCS-Committer: marecki
X-VCS-Committer-Name: Marek Szuba
X-VCS-Revision: c44e033f4d003ae9d8cabadcb1a0ce142910cdbe
X-VCS-Branch: master
Date: Mon,  7 Dec 2020 12:22:18 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: d56255f6-3eea-4102-9f20-3b3d2acfc0eb
X-Archives-Hash: f82323fd8934be7969d1bb4a41b63706

commit:     c44e033f4d003ae9d8cabadcb1a0ce142910cdbe
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Mon Dec  7 12:20:22 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 12:22:09 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c44e033f

sys-apps/likwid-4.3.4: migrate to lua-single.eclass

Supports lua5-2 and lua5-3 as per notes in the original ebuild, builds
fine against either.

Nb. on my system, even before the migration this ebuild only succeeds if
I force MAKEOPTS='-j1' - otherwise while linking likwid executables the
linker cannot find the package's own liblikwid.so.

Adding a separate package.mask line for migrated ebuilds because there
is still one ebuild in the tree which requires the package-wide mask.

Closes: https://bugs.gentoo.org/752858
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 profiles/package.mask               |  1 +
 sys-apps/likwid/likwid-4.3.4.ebuild | 26 ++++++++++++++------------
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/profiles/package.mask b/profiles/package.mask
index fc7ad871a8d..c51c373378e 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -594,6 +594,7 @@ gnome-base/orbit
 >=sci-libs/plplot-5.15.0-r100
 >=sci-visualization/gnuplot-5.4.0-r100
 >=sci-visualization/fityk-1.3.1-r100
+>=sys-apps/likwid-4.3.4
 >=www-apache/mod_security-2.9.3-r100
 >=www-client/elinks-0.13.5-r100
 >=www-client/luakit-2.2.1-r100

diff --git a/sys-apps/likwid/likwid-4.3.4.ebuild b/sys-apps/likwid/likwid-4.3.4.ebuild
index 02a836a19c6..914ca442fe6 100644
--- a/sys-apps/likwid/likwid-4.3.4.ebuild
+++ b/sys-apps/likwid/likwid-4.3.4.ebuild
@@ -1,31 +1,32 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 FORTRAN_NEEDED=fortran
+LUA_COMPAT=( lua5-{2..3} )
 #PYTHON_COMPAT=( python3_{6,7} )
 
 # 4.3.4 will need python-single-r1
-inherit fcaps fortran-2 linux-info toolchain-funcs
+inherit fcaps fortran-2 linux-info lua-single 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}
+IUSE="fortran"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}" # ${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.
+# lua-5.3.
 #
 # hwloc:
 # likwid bundles a MODIFIED copy of hwloc-2.0.0a1 with specific configuration
@@ -41,7 +42,7 @@ IUSE="fortran" # ${PYTHON_REQUIRED_USE}
 # Python:
 # Python3 is used for one helper script, filter/json, added after 4.3.3
 CDEPEND="dev-lang/perl
-	dev-lang/lua:5.3"
+	${LUA_DEPS}"
 
 # filter/json uses Python3
 RDEPEND="${CDEPEND}"
@@ -68,6 +69,7 @@ PATCHES=(
 
 pkg_setup() {
 	fortran-2_pkg_setup
+	lua-single_pkg_setup
 	#python-single-r1_pkg_setup
 }
 
@@ -104,8 +106,8 @@ export_emake_opts() {
 	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'
+	# WARNING: setting LUA_LIB_NAME=${ELUA} does *not* work with LuaJIT, keep this on mind
+	# should likwid upstream ever begin to support it.
 	# If the build is too loud, pass 'Q=@'
 	src_compile_opts=(
 		"Q="
@@ -118,9 +120,9 @@ export_emake_opts() {
 		"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_INCLUDE_DIR=$(lua_get_include_dir)"
+		"LUA_LIB_DIR=$(dirname "$(lua_get_shared_lib)")"
+		"LUA_LIB_NAME=${ELUA}"
 		"LUA_BIN=/usr/bin"
 		"FORTRAN_INTERFACE=$(usex fortran likwid.mod false)"
 		"FC=$(usex fortran "${FC}" false)"