From f39296d487b8083a36552c6f087c81712b22e9bf Mon Sep 17 00:00:00 2001 From: is Date: Fri, 15 Mar 2013 16:10:57 +0000 Subject: Make oxenstored (more) usable, as originally researched by Aaron J. Grier, with implementation changes by myself: - rules to add the run-time path correctly when building shared versions of libraries. Using -dllpath to ocamlmklib for this - ',' would need to be clumsily escaped from gmake. (This also needs a patched ocamlmklib - from ocaml 4.00.1nb2 - that has -elfmode which prevents -L paths being added to the run-time path). - Path fixes, but not using fixed paths as originally proposed, but the SUBST framework. - Trim whitespace off a numeric string read out of the kernel. Instead of open coding the function, use String.trim, as the String library is used, anyway. (available in ocaml >= 4.00.1) --- sysutils/xentools41/Makefile | 15 +++++++++++++-- sysutils/xentools41/distinfo | 6 +++++- .../xentools41/patches/patch-ocaml_Makefile.rules | 13 +++++++++++++ sysutils/xentools41/patches/patch-ocaml_common.make | 13 +++++++++++++ .../patches/patch-ocaml_xenstored_define.ml | 20 ++++++++++++++++++++ .../patches/patch-ocaml_xenstored_utils.ml | 13 +++++++++++++ 6 files changed, 77 insertions(+), 3 deletions(-) create mode 100644 sysutils/xentools41/patches/patch-ocaml_Makefile.rules create mode 100644 sysutils/xentools41/patches/patch-ocaml_common.make create mode 100644 sysutils/xentools41/patches/patch-ocaml_xenstored_define.ml create mode 100644 sysutils/xentools41/patches/patch-ocaml_xenstored_utils.ml diff --git a/sysutils/xentools41/Makefile b/sysutils/xentools41/Makefile index f6a11b6ae22..768633676df 100644 --- a/sysutils/xentools41/Makefile +++ b/sysutils/xentools41/Makefile @@ -1,11 +1,11 @@ -# $NetBSD: Makefile,v 1.28 2013/01/20 15:21:54 drochner Exp $ +# $NetBSD: Makefile,v 1.29 2013/03/15 16:10:57 is Exp $ # # VERSION is set in version.mk as it is shared with other packages .include "version.mk" DISTNAME= xen-${VERSION} PKGNAME= xentools41-${VERSION} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= sysutils MASTER_SITES= http://bits.xensource.com/oss-xen/release/${VERSION}/ @@ -101,6 +101,7 @@ SUBST_SED.pathsvar= -e "s|/var/lib|${VARBASE}/run|g" SUBST_CLASSES+= conf SUBST_STAGE.conf= pre-configure SUBST_FILES.conf+= python/xen/xm/create.py +SUBST_FILES.conf+= ocaml/xenstored/define.ml SUBST_SED.conf= -e "s,@XENDCONFDIR@,${PKG_SYSCONFDIR},g" .include "../../mk/bsd.prefs.mk" @@ -111,12 +112,22 @@ XEND_SCRIPTS= block vif-bridge vif-ip qemu-ifup hotplugpath.sh SUBST_CLASSES+= proc SUBST_STAGE.proc= pre-configure SUBST_FILES.proc= python/xen/xend/XendVnet.py +SUBST_FILES.proc+= ocaml/xenstored/define.ml SUBST_SED.proc= -e "s|/proc|/kern|g" PROCPATH= /kern .else PROCPATH= /proc .endif +SUBST_CLASSES+= procdev +SUBST_STAGE.procdev= pre-configure +SUBST_FILES.procdev= ocaml/xenstored/define.ml +.if ${OPSYS} == "NetBSD" +SUBST_SED.procdev= -e "s|@PROCDEV@|/dev|g" +.else +SUBST_SED.procdev= -e "s|@PROCDEV@|/proc/xen|g" +.endif + RCD_SCRIPTS= xen-watchdog xencommons xend xendomains FILES_SUBST+= RCD_INTERPRETER=${PYTHONBIN:Q} FILES_SUBST+= PROCPATH=${PROCPATH:Q} diff --git a/sysutils/xentools41/distinfo b/sysutils/xentools41/distinfo index 70159e6b079..dd464eb726c 100644 --- a/sysutils/xentools41/distinfo +++ b/sysutils/xentools41/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.25 2013/01/20 15:21:54 drochner Exp $ +$NetBSD: distinfo,v 1.26 2013/03/15 16:10:57 is Exp $ SHA1 (ipxe-git-v1.0.0.tar.gz) = da052c8de5f3485fe0253c19cf52ed6d72528485 RMD160 (ipxe-git-v1.0.0.tar.gz) = dcd9b6eaafa1ce05c1ebf2a15f2f73ad7a8c5547 @@ -46,5 +46,9 @@ SHA1 (patch-ioemu-qemu-xen_hw_pt-msi.h) = d1bb1a8ad90d6577056f11df96f5469ffe74a3 SHA1 (patch-ioemu-qemu-xen_xen-hooks.mak) = a00d9a9fd0fbb9fd89788b9dfaf5b389a28d47e2 SHA1 (patch-libxl_libxl_create.c) = 02b661ca684609939c6ef762c0ddd1c5e62ad4d0 SHA1 (patch-libxl_libxl_internal.h) = e126e5e998117903f0c66cc370d350c504ed33d9 +SHA1 (patch-ocaml_Makefile.rules) = 104f9d40186e5e4ca6a2e6359bbb369c3c91d1dc +SHA1 (patch-ocaml_common.make) = c59d32301198d65691ab23529dd791de5ac40199 +SHA1 (patch-ocaml_xenstored_define.ml) = f44841625554ceba6e83dbb41f688993c2a8d9a2 +SHA1 (patch-ocaml_xenstored_utils.ml) = cc792a696743fa348b274b1c23783ea1a0d7da47 SHA1 (patch-qemu-phy-devices) = fef90e50ef0a58db2f2b49b6c23218f371791de5 SHA1 (patch-xenstore_Makefile) = 4fa0ed7b76a96011c3cca9c5017be4b5151489f7 diff --git a/sysutils/xentools41/patches/patch-ocaml_Makefile.rules b/sysutils/xentools41/patches/patch-ocaml_Makefile.rules new file mode 100644 index 00000000000..90bcedcea83 --- /dev/null +++ b/sysutils/xentools41/patches/patch-ocaml_Makefile.rules @@ -0,0 +1,13 @@ +$NetBSD: patch-ocaml_Makefile.rules,v 1.1 2013/03/15 16:10:58 is Exp $ + +--- ocaml/Makefile.rules.orig 2012-08-10 13:51:28.000000000 +0000 ++++ ocaml/Makefile.rules +@@ -65,7 +65,7 @@ define OCAML_LIBRARY_template + $(1)_stubs.a: $(foreach obj,$$($(1)_C_OBJS),$(obj).o) + $(call mk-caml-stubs,$$@, $$+) + lib$(1)_stubs.a: $(foreach obj,$($(1)_C_OBJS),$(obj).o) +- $(call mk-caml-lib-stubs,$$@, $$+, $(LIBS_$(1))) ++ $(call mk-caml-lib-stubs,$$@, $$+, -dllpath $(PREFIX)/lib $(LIBS_$(1))) + endef + + define OCAML_NOC_LIBRARY_template diff --git a/sysutils/xentools41/patches/patch-ocaml_common.make b/sysutils/xentools41/patches/patch-ocaml_common.make new file mode 100644 index 00000000000..97b9995fd9e --- /dev/null +++ b/sysutils/xentools41/patches/patch-ocaml_common.make @@ -0,0 +1,13 @@ +$NetBSD: patch-ocaml_common.make,v 1.1 2013/03/15 16:10:58 is Exp $ + +--- ocaml/common.make.orig 2013-03-13 09:31:47.000000000 +0000 ++++ ocaml/common.make +@@ -3,7 +3,7 @@ include $(XEN_ROOT)/tools/Rules.mk + CC ?= gcc + OCAMLOPT ?= ocamlopt + OCAMLC ?= ocamlc +-OCAMLMKLIB ?= ocamlmklib ++OCAMLMKLIB ?= ocamlmklib -elfmode + OCAMLDEP ?= ocamldep + OCAMLLEX ?= ocamllex + OCAMLYACC ?= ocamlyacc diff --git a/sysutils/xentools41/patches/patch-ocaml_xenstored_define.ml b/sysutils/xentools41/patches/patch-ocaml_xenstored_define.ml new file mode 100644 index 00000000000..b9551239022 --- /dev/null +++ b/sysutils/xentools41/patches/patch-ocaml_xenstored_define.ml @@ -0,0 +1,20 @@ +$NetBSD: patch-ocaml_xenstored_define.ml,v 1.1 2013/03/15 16:10:58 is Exp $ + +--- ocaml/xenstored/define.ml.orig 2012-11-24 07:27:21.000000000 +0000 ++++ ocaml/xenstored/define.ml 2012-11-24 07:33:59.000000000 +0000 +@@ -17,13 +17,13 @@ + let xenstored_major = 1 + let xenstored_minor = 0 + +-let xenstored_proc_kva = "/proc/xen/xsd_kva" ++let xenstored_proc_kva = "@PROCDEV@/xsd_kva" + let xenstored_proc_port = "/proc/xen/xsd_port" + + let xs_daemon_socket = "/var/run/xenstored/socket" + let xs_daemon_socket_ro = "/var/run/xenstored/socket_ro" + +-let default_config_dir = "/etc/xensource" ++let default_config_dir = "@XENDCONFDIR@" + + let maxwatch = ref (50) + let maxtransaction = ref (20) diff --git a/sysutils/xentools41/patches/patch-ocaml_xenstored_utils.ml b/sysutils/xentools41/patches/patch-ocaml_xenstored_utils.ml new file mode 100644 index 00000000000..f22413b3b61 --- /dev/null +++ b/sysutils/xentools41/patches/patch-ocaml_xenstored_utils.ml @@ -0,0 +1,13 @@ +$NetBSD: patch-ocaml_xenstored_utils.ml,v 1.1 2013/03/15 16:10:58 is Exp $ + +--- ocaml/xenstored/utils.ml.orig ++++ ocaml/xenstored/utils.ml +@@ -87,7 +83,7 @@ let read_file_single_integer filename = + let buf = String.make 20 (char_of_int 0) in + let sz = Unix.read fd buf 0 20 in + Unix.close fd; +- int_of_string (String.sub buf 0 sz) ++ int_of_string (String.trim (String.sub buf 0 sz)) + + let path_complete path connection_path = + if String.get path 0 <> '/' then -- cgit v1.2.3