From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1552361-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 25818158089
	for <garchives@archives.gentoo.org>; Wed,  6 Sep 2023 08:39:35 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 36CCC2BC021;
	Wed,  6 Sep 2023 08:39:34 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 21DD92BC021
	for <gentoo-commits@lists.gentoo.org>; Wed,  6 Sep 2023 08:39:34 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 6D316335CB9
	for <gentoo-commits@lists.gentoo.org>; Wed,  6 Sep 2023 08:39:33 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id B8F901132
	for <gentoo-commits@lists.gentoo.org>; Wed,  6 Sep 2023 08:39:30 +0000 (UTC)
From: "Sam James" <sam@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, "Sam James" <sam@gentoo.org>
Message-ID: <1693989361.da73f74fca7c8f4c3eb015e762bb23c737fda85d.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-block/thin-provisioning-tools/files/, sys-block/thin-provisioning-tools/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-block/thin-provisioning-tools/files/thin-provisioning-tools-1.0.6-build-with-cargo.patch sys-block/thin-provisioning-tools/thin-provisioning-tools-9999.ebuild
X-VCS-Directories: sys-block/thin-provisioning-tools/files/ sys-block/thin-provisioning-tools/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: da73f74fca7c8f4c3eb015e762bb23c737fda85d
X-VCS-Branch: master
Date: Wed,  6 Sep 2023 08:39:30 +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: 47c566df-3cbd-4126-801b-7a8621508ac2
X-Archives-Hash: 4e28b0391490f17fddb33154e9ac6206

commit:     da73f74fca7c8f4c3eb015e762bb23c737fda85d
Author:     Peter Levine <plevine457 <AT> gmail <DOT> com>
AuthorDate: Sun Sep  3 08:43:56 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep  6 08:36:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da73f74f

sys-block/thin-provisioning-tools: don't use emake to install binary

For USE=debug to work, portage needs to run cargo_src_compile(), but
if `emake` is used in src_install(), it will trigger a rebuild without
debug.  If cargo_src_install() is used instead, manpages and symlinks
won't be installed and the binary would have to be moved since there's
no way to make cargo install to /usr/sbin. So remove $(PDATA_TOOLS)
dependency in Makefile instead.  Might as well patch out $(STRIP) too.

Signed-off-by: Peter Levine <plevine457 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...-provisioning-tools-1.0.6-build-with-cargo.patch | 21 +++++++++++++++++++++
 .../thin-provisioning-tools-9999.ebuild             |  8 +++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-1.0.6-build-with-cargo.patch b/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-1.0.6-build-with-cargo.patch
new file mode 100644
index 000000000000..5e06583164f8
--- /dev/null
+++ b/sys-block/thin-provisioning-tools/files/thin-provisioning-tools-1.0.6-build-with-cargo.patch
@@ -0,0 +1,21 @@
+For USE=debug to work, portage needs to run cargo_src_compile(), but if `emake`
+is used in src_install(), it will trigger a rebuild without debug.  If
+cargo_src_install() is used instead, manpages and symlinks won't be installed
+and the binary would have to be moved since there's no way to make cargo install
+to /usr/sbin. So remove $(PDATA_TOOLS) dependency in Makefile instead.  Might as
+well patch out $(STRIP) too.
+
+--- a/Makefile
++++ b/Makefile
+@@ -56,10 +56,9 @@
+ 
+ MANPAGES:=$(patsubst %,man8/%.8,$(TOOLS))
+ 
+-install: $(PDATA_TOOLS) $(MANPAGES)
++install: $(MANPAGES)
+ 	$(INSTALL_DIR) $(BINDIR)
+ 	$(INSTALL_PROGRAM) $(PDATA_TOOLS) $(BINDIR)
+-	$(STRIP) $(BINDIR)/pdata_tools
+ 	ln -s -f pdata_tools $(BINDIR)/cache_check
+ 	ln -s -f pdata_tools $(BINDIR)/cache_dump
+ 	ln -s -f pdata_tools $(BINDIR)/cache_metadata_size

diff --git a/sys-block/thin-provisioning-tools/thin-provisioning-tools-9999.ebuild b/sys-block/thin-provisioning-tools/thin-provisioning-tools-9999.ebuild
index 92ce1cf581dd..74337833b2ca 100644
--- a/sys-block/thin-provisioning-tools/thin-provisioning-tools-9999.ebuild
+++ b/sys-block/thin-provisioning-tools/thin-provisioning-tools-9999.ebuild
@@ -153,6 +153,8 @@ LICENSE="Apache-2.0 BSD GPL-3 MIT Unicode-DFS-2016"
 SLOT="0"
 IUSE="io-uring"
 
+PATCHES=( "${FILESDIR}/${PN}-1.0.6-build-with-cargo.patch" )
+
 # Rust
 QA_FLAGS_IGNORED="usr/sbin/pdata_tools"
 
@@ -171,5 +173,9 @@ src_configure() {
 }
 
 src_install() {
-	emake V= DESTDIR="${D}" DATADIR="${ED}/usr/share" STRIP=true install
+	emake \
+		DESTDIR="${D}" \
+		DATADIR="${ED}/usr/share" \
+		PDATA_TOOLS="target/$(usex debug debug release)/pdata_tools" \
+		install
 }