[Pkg-xen-devel] [PATCH 9/9] Create 2 ocaml packages, libxen-ocaml-4.1 and libxen-ocaml-dev.

Jonathan Ludlam Jonathan.Ludlam at eu.citrix.com
Wed Oct 26 13:52:46 UTC 2011


On 26 Oct 2011, at 13:34, Bastian Blank wrote:

> On Tue, Oct 25, 2011 at 01:37:29PM +0100, Jon Ludlam wrote:
>> diff --git a/xen/debian/libxen-dev.install b/xen/debian/libxen-dev.install
>> index 9d00a07..5e05540 100644
>> --- a/xen/debian/libxen-dev.install
>> +++ b/xen/debian/libxen-dev.install
>> @@ -2,4 +2,6 @@ usr/lib/{libxenctrl.a,libxenguest.a}
>> usr/lib/libxenstore.{a,so}
>> usr/include/{xenctrl.h,xenguest.h}
>> usr/include/{xs.h,xs_lib.h}
>> +usr/include/xentoollog.h
>> +usr/include/xenctrlosdep.h
>> usr/include/xen
> 
> I think this is unrelated.
> 

True. I'll separate it.

>> diff --git a/xen/debian/libxen-ocaml-dev.install b/xen/debian/libxen-ocaml-dev.install
>> new file mode 100644
>> index 0000000..a9f22f6
>> --- /dev/null
>> +++ b/xen/debian/libxen-ocaml-dev.install
>> @@ -0,0 +1,2 @@
>> +/usr/lib/xen-4.1/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/*.cm{i,x,xa}
>> +/usr/lib/xen-4.1/lib/ocaml/{xenlight,xenbus,xenctrl,xenstore,xeneventchn,xenmmap}/*.a
> 
> Brace-expansion, don't use it.
> 

OK

>> diff --git a/xen/debian/rules.real b/xen/debian/rules.real
>> index 1252ec2..0711dad 100644
>> --- a/xen/debian/rules.real
>> +++ b/xen/debian/rules.real
>> @@ -1,7 +1,11 @@
>> +include /usr/share/ocaml/ocamlvars.mk
>> +
>> DEB_HOST_ARCH     := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_ARCH)
>> DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -a$(ARCH) -qDEB_HOST_GNU_TYPE)
>> DEB_BUILD_ARCH    := $(shell dpkg-architecture -a$(ARCH) -qDEB_BUILD_ARCH)
>> 
>> +GENCONTROL_ARGS   := -VF:OCamlABI="$(OCAML_ABI)"
>> +
>> export DH_OPTIONS
>> 
>> setup_env := env -u ARCH -u FLAVOUR -u VERSION -u MAKEFLAGS
>> @@ -17,6 +21,8 @@ binary-arch-arch: install-lib-dev_$(ARCH)
>> binary-arch-arch: install-libxenstore_$(ARCH)
>> binary-arch-arch: install-utils_$(ARCH)
>> binary-arch-arch: install-xenstore-utils_$(ARCH)
>> +binary-arch-arch: install-lib-ocaml-dev_$(ARCH)
>> +binary-arch-arch: install-lib-ocaml_$(ARCH)
>> binary-arch-flavour: install-hypervisor_$(ARCH)_$(FLAVOUR)
>> 
>> binary-indep: install-docs
>> @@ -70,6 +76,7 @@ $(STAMPS_DIR)/install-utils_$(ARCH): CONFIG = \
>> 		XEN_COMPILE_ARCH=$(XEN_ARCH) \
>> 		XEN_TARGET_ARCH=$(XEN_ARCH) \
>> 		XEN_VERSION=$(VERSION) \
>> +		OCAMLDESTDIR=$(CURDIR)/$(BUILD_DIR)/install-utils_$(ARCH)/usr/lib/xen-$(VERSION)/lib/ocaml \
> 
> You may use
> | OCAMLDESTDIR=$(CURDIR)/$(BUILD_DIR)/install-utils_$(ARCH)_ocaml/usr/lib/xen-$(VERSION)/lib/ocaml
> to separate them at this level.
> 

OK

>> +	mkdir -p $(INSTALL_DIR)/usr/lib/xen-$(VERSION)/lib/ocaml/stublibs
> 
> Why?
> 

ocamlfind is a bit nuts - when you invoke 'ocamlfind install' it looks to see whether that directory exists, and if it does, it installs the stub libraries there. If not, it installs them alongside the other files in the package. The Debian Ocaml Task Force recommend putting all the stub libs in this particular directory, so we force ocamlfind to do the desired thing by making the dir.

It's particularly nuts because there's a flag you pass to ocamlfind to cause this behaviour, but it falls back to the other behaviour if the directory doesn't exist.


>> +	dh_ocaml
> 
> This package should not include any ocaml stuff.
> 

Do you mean it should be moved from the generic install-base into the 'install-lib-ocaml*_$(ARCH)' make recipes? Sure.

>> diff --git a/xen/debian/templates/control.main.in b/xen/debian/templates/control.main.in
>> index 2dff1dd..423009d 100644
>> --- a/xen/debian/templates/control.main.in
>> +++ b/xen/debian/templates/control.main.in
>> @@ -30,3 +30,21 @@ Replaces: xen-utils-common (<= 3.1.0-1)
>> Description: Xenstore utilities for Xen
>>  This package contains the Xenstore utilities.
>> 
>> +Package: libxen-ocaml- at version@
>> +Architecture: any
>> +Section: libs
>> +Depends: ocaml-base-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}, ${ocaml:Depends}
> 
> How does it get the needed xen-utils-* dependency?
> 

Good question. What's the recommendation here? The shlibs variable doesn't, for example, pick up the xenctrl.so:

 dpkg-shlibdeps: warning: couldn't find library libxenctrl.so needed by debian/libxen-ocaml-4.1/usr/lib/xen-4.1/lib/ocaml/stublibs/dllxeneventchn_stubs.so (ELF format: 'elf32-i386'; RPATH: '/usr/lib/xen-4.1/lib').

Should an explicit dependency on xen-utils- at version@ go in?

Thanks for the comments - I'll prepare some new patches.

Jon

> Bastian
> 
> -- 
> Only a fool fights in a burning house.
> 		-- Kank the Klingon, "Day of the Dove", stardate unknown
> 
> _______________________________________________
> Pkg-xen-devel mailing list
> Pkg-xen-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-xen-devel




More information about the Pkg-xen-devel mailing list