[Pkg-xen-devel] [PATCH 3/3] debian/rules: Setup use of noOCAML profile

Elliott Mitchell ehem+debian at m5p.com
Mon Sep 14 06:31:16 BST 2020


This adds support for use of the "noocaml" profile
(https://wiki.debian.org/BuildProfileSpec).  This allows disabling build
of OCAML portions of Xen.  As presently there is no separate oxenstored
package, this makes due by using empty files to replace expected files.

Presently the primary expected use is to allow cross-building of the Xen
packages.  At this time cross-building for OCAML is very broken.
Hopefully it may work in future, but at this time it does not.

Signed-off-by: Elliott Mitchell <ehem+debian at m5p.com>
---
 debian/control |  4 ++--
 debian/rules   | 17 +++++++++++++++--
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/debian/control b/debian/control
index 0ea70a0d33..753b7e009c 100644
--- a/debian/control
+++ b/debian/control
@@ -32,8 +32,8 @@ Build-Depends:
    zlib1g-dev,
    pandoc,
    markdown,
-   ocaml-native-compilers | ocaml-nox,
-   ocaml-findlib,
+   ocaml-native-compilers <!noocaml> | ocaml-nox <!noocaml>,
+   ocaml-findlib <!noocaml>,
 XS-Python-Version: current
 Homepage: https://xenproject.org/
 Vcs-Browser: https://salsa.debian.org/xen-team/debian-xen
diff --git a/debian/rules b/debian/rules
index 7f7ae85803..e2a219d1f4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -206,11 +206,15 @@ override_dh_auto_configure:
 # separately.
 override_dh_auto_build:
 	$(MAKE) $(make_args_xen) xen
-	$(MAKE) $(make_args_tools) tools docs CONFIG_PV_SHIM=n
+	$(MAKE) $(make_args_tools) tools docs CONFIG_PV_SHIM=n OCAML_TOOLS=n
 	case $(flavour) in \
 	amd64|i386) \
 		$(MAKE) $(make_args_xen) -C tools/firmware/xen-dir ;; \
 	esac
+	@# OCAML cross-compilation is currently non-functional
+	if [ -z "$(filter noocaml,$(DEB_BUILD_PROFILES))" ]; then \
+		$(MAKE) $(make_args_tools) tools docs CONFIG_PV_SHIM=n ; \
+	fi
 	touch debian/xen-tools-built.stamp
 
 # We keep the amount of fixup and messing about with debian/tmp/
@@ -220,7 +224,16 @@ override_dh_auto_build:
 override_dh_auto_install: $(TEMPLATED_FILES)
 	$(MAKE) $(make_args_xen) DESTDIR=$t install-xen
 	$(MAKE) $(make_args_tools) DESTDIR=$t \
-		install-{tools,docs} CONFIG_PV_SHIM=n
+		install-{tools,docs} CONFIG_PV_SHIM=n OCAML_TOOLS=n
+	:
+	@# OCAML doesn't work when cross-building
+	if [ -z "$(filter noocaml,$(DEB_BUILD_PROFILES))" ]; then \
+		$(MAKE) $(make_args_tools) DESTDIR=$t \
+			install-{tools,docs} CONFIG_PV_SHIM=n ; \
+	else \
+		touch $t/etc/xen/oxenstored.conf ; \
+		cp -l $t/usr/sbin/xl $t/usr/sbin/oxenstored ; \
+	fi
 	:
 	@# shim install target needs to be run separately because we
 	@# need to pass it the make_args_xen settings, in particular
-- 


-- 
(\___(\___(\______          --=> 8-) EHM <=--          ______/)___/)___/)
 \BS (    |         ehem+sigmsg at m5p.com  PGP 87145445         |    )   /
  \_CS\   |  _____  -O #include <stddisclaimer.h> O-   _____  |   /  _/
8A19\___\_|_/58D2 7E3D DDF4 7BA6 <-PGP-> 41D1 B375 37D0 8714\_|_/___/5445






More information about the Pkg-xen-devel mailing list