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
}