[Pkg-xen-devel] [patch] Packages ocaml libraries

Ian Campbell ijc at hellion.org.uk
Tue Aug 30 13:44:19 UTC 2011


On Mon, 2011-08-29 at 18:38 +0800, Thomas Goirand wrote:
> [...] 
> +install-lib-ocaml_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
> +install-lib-ocaml_$(ARCH): PACKAGE_NAME = libxen-ocaml
> +install-lib-ocaml_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
> +install-lib-ocaml_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
> +       dh_testdir
> +       dh_testroot
> +       dh_prep
> +       # eventchn/ mmap/ uuid/ xb/ xc/ xl/ xs/
> +       install -D -m 0755 $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/eventchn/dlleventchn_stubs.so $(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_DLL_DIR)/eventchn/dlleventchn_stubs.so
> +       install -D -m 0755 $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/mmap/dllmmap_stubs.so $(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_DLL_DIR)/mmap/dllmmap_stubs.so
> +       install -D -m 0755 $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/xb/dllxb_stubs.so $(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_DLL_DIR)/xb/dllxb_stubs.so
> +       install -D -m 0755 $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/xc/dllxc_stubs.so $(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_DLL_DIR)/xc/dllxc_stubs.so
> +       install -D -m 0755 $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/xl/dllxl_stubs.so $(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_DLL_DIR)/xl/dllxl_stubs.so

I still don't think this can be right. Surely every Ocaml packages
doesn't open code a bunch of install runes like this (not to mention the
corresponding "find ... -delete" like you have below). It'd be a
maintenance nightmare.

Looking at the ocaml-taglib source (picked at random) it appears that at
least one viable option for doing this properly is to use the dh_install
functionality which lets you specify a different target directory to
where the file is found in the staging dir. i.e.
debian/libtaglib-ocaml.install.in contains:
	@OCamlStdlibDir@/taglib/dlltaglib_stubs.so @OCamlDllDir@

In any case I think whatever solution you come up with should be
reviewed by the pkg-ocaml team as well as this list.

> +       dh_strip
> +       dh_shlibdeps
> +       +$(MAKE_SELF) install-base
> +
> +install-lib-ocaml-dev_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
> +install-lib-ocaml-dev_$(ARCH): PACKAGE_NAME = libxen-ocaml-dev
> +install-lib-ocaml-dev_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
> +install-lib-ocaml-dev_$(ARCH): $(STAMPS_DIR)/install-utils_$(ARCH)
> +       dh_testdir
> +       dh_testroot
> +       dh_prep
> +       for i in eventchn mmap uuid xb xc xl xs ; do \
> +               make -C $(BUILD_DIR)/build-utils_$(ARCH)/tools/ocaml/libs/$$i install OCAMLDESTDIR=$(CURDIR)/debian/$(PACKAGE_NAME)/$(OCAML_STDLIB_DIR) ; done
> +       find $(CURDIR)/debian/$(PACKAGE_NAME) -iname 'dll*.so' -delete


> +       dh_strip
> +       dh_shlibdeps
> +       +$(MAKE_SELF) install-base
> +
>  install-libxenstore_$(ARCH): DIR = $(BUILD_DIR)/install-utils_$(ARCH)
>  install-libxenstore_$(ARCH): PACKAGE_NAME = libxenstore3.0
>  install-libxenstore_$(ARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
> diff -r -u -N old/xen-4.1.1/debian/templates/control.main.in new/xen-4.1.1/debian/templates/control.main.in
> --- old/xen-4.1.1/debian/templates/control.main.in      2010-03-01 18:29:00.000000000 +0000
> +++ new/xen-4.1.1/debian/templates/control.main.in      2011-08-29 04:24:24.000000000 +0000

Isn't there supposed to be a new Build-Depends on some ocaml stuff
somewhere?

Ian.
-- 
Ian Campbell
Current Noise: Kyuss - 50 Million Year Trip

Conquering Russia should be done steppe by steppe.




More information about the Pkg-xen-devel mailing list