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

Elliott Mitchell ehem+debian at m5p.com
Sun Oct 25 01:47:02 GMT 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   | 11 +++++++++++
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/debian/control b/debian/control
index 90007f6a02..4c25e95971 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>,
 Homepage: https://xenproject.org/
 Vcs-Browser: https://salsa.debian.org/xen-team/debian-xen
 Vcs-Git: https://salsa.debian.org/xen-team/debian-xen.git
diff --git a/debian/rules b/debian/rules
index ed9f4895bc..2ff2574497 100755
--- a/debian/rules
+++ b/debian/rules
@@ -148,6 +148,11 @@ make_args_tools := $(make_args_common) \
 	EXTRA_CFLAGS_XEN_TOOLS='$(dpkg_CFLAGS) $(dpkg_CPPFLAGS)' \
 	PREPEND_LDFLAGS_XEN_TOOLS='$(dpkg_LDFLAGS)'
 
+# Disable Xen's OCAML build if specified
+ifneq ($(filter noocaml,$(DEB_BUILD_PROFILES)),)
+make_args_tools += OCAML_TOOLS=n
+endif
+
 export PYBUILD_NAME=xen
 export PYBUILD_DISABLE=test
 export PYBUILD_SYSTEM=distutils
@@ -222,6 +227,12 @@ override_dh_auto_install: $(TEMPLATED_FILES)
 	$(MAKE) $(make_args_tools) DESTDIR=$t \
 		install-{tools,docs} CONFIG_PV_SHIM=n
 	:
+	@# xen-utils-common needs these against another installation w/OCAML
+	if [ -n "$(filter noocaml,$(DEB_BUILD_PROFILES))" ]; then \
+		ln tools/ocaml/xenstored/oxenstored.conf $t/etc/xen/oxenstored.conf ; \
+		ln -s /usr/lib/xen-common/bin/xen-utils-wrapper $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
 	@# on i386 we need to pass x86_64 here to actually build it.
-- 


-- 
(\___(\___(\______          --=> 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