diff mbox series

[SRU,L,v2] UBUNTU: [Packaging] introduce do_lib_rust and enable it only on generic amd64

Message ID 20230531061636.6607-2-andrea.righi@canonical.com
State New
Headers show
Series [SRU,L,v2] UBUNTU: [Packaging] introduce do_lib_rust and enable it only on generic amd64 | expand

Commit Message

Andrea Righi May 31, 2023, 6:16 a.m. UTC
BugLink: https://bugs.launchpad.net/bugs/2021605

Introduce the new variable do_lib_rust to enable or disable the
packaging of linux-lib-rust and enable it only on the generic amd64
kernel.

This allows to avoid building any kind of Rust artifact in other
kernels, except for the generic one and only on amd64.

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
---
 debian.master/rules.d/amd64.mk  | 1 +
 debian/rules.d/1-maintainer.mk  | 1 +
 debian/rules.d/2-binary-arch.mk | 4 ++++
 3 files changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/debian.master/rules.d/amd64.mk b/debian.master/rules.d/amd64.mk
index d0384f0227a47..afed3e50966b9 100644
--- a/debian.master/rules.d/amd64.mk
+++ b/debian.master/rules.d/amd64.mk
@@ -21,3 +21,4 @@  do_extras_package = true
 do_tools_common = true
 do_tools_acpidbg = true
 do_odm_drivers  = true
+do_lib_rust     = true
diff --git a/debian/rules.d/1-maintainer.mk b/debian/rules.d/1-maintainer.mk
index c625715eacf41..0aaeee7182f8b 100644
--- a/debian/rules.d/1-maintainer.mk
+++ b/debian/rules.d/1-maintainer.mk
@@ -104,6 +104,7 @@  printenv:
 	@echo "do_common_headers_indep   = $(do_common_headers_indep)"
 	@echo "do_full_source            = $(do_full_source)"
 	@echo "do_odm_drivers            = $(do_odm_drivers)"
+	@echo "do_lib_rust               = $(do_lib_rust)"
 	@echo "do_tools                  = $(do_tools)"
 	@echo "do_tools_common           = $(do_tools_common)"
 	@echo "do_any_tools              = $(do_any_tools)"
diff --git a/debian/rules.d/2-binary-arch.mk b/debian/rules.d/2-binary-arch.mk
index 630a335616a74..aa790f98f000d 100644
--- a/debian/rules.d/2-binary-arch.mk
+++ b/debian/rules.d/2-binary-arch.mk
@@ -132,7 +132,9 @@  $(stampdir)/stamp-install-%: $(stampdir)/stamp-build-% $(stampdir)/stamp-install
 	dh_prep -p$(bin_pkg_name)-$*
 	dh_prep -p$(mods_pkg_name)-$*
 	dh_prep -p$(hdrs_pkg_name)-$*
+ifeq ($(do_lib_rust),true)
 	dh_prep -p$(rust_pkg_name)-$*
+endif
 	$(foreach _m,$(all_standalone_dkms_modules), \
 	  $(if $(enable_$(_m)),dh_prep -p$(dkms_$(_m)_pkg_name)-$*;)\
 	)
@@ -675,7 +677,9 @@  endif
 
 	$(call dh_all,$(pkgbldinfo))
 	$(call dh_all,$(pkghdr))
+ifeq ($(do_lib_rust),true)
 	$(call dh_all,$(pkgrust))
+endif
 
 ifneq ($(skipsub),true)
 	@set -e; for sub in $($(*)_sub); do		\