Hello,

On Sat, 25 Mar 2017 16:37:20 +0100
Sylvestre Ledru <sylves...@debian.org> wrote:
> Le 24/03/2017 à 17:04, Cyril Soldani a écrit :
> > It looks like this folder is missing since `libllvm-3.6-ocaml-dev`,
> > and is still missing in `libllvm-3.9-ocaml-dev`. Last version
> > containing it was `libllvm-3.5-ocaml-dev`, but it is not
> > installable on `stretch`. 
> Thanks!
> As it has been in this state for a while and nobody complained about,
> I will probably just remove it from the packaging...

I understand your rationale, but I would still like to give the
following arguments in favour of keeping (and fixing) the package:

* While nobody seemed to have complained up to now, this may be at
  least partly due to the fact that `libllvm-3.5-ocaml-dev` is working
  fine. It is available (and used) on jessie, and was co-installable on
  stretch until recently (indeed, I may still install it, provided I
  am willing to downgrade half of my system).
* Even if not legions, there are still users (at least me and about 15
  students each year), and at least a few tens of other installs
  according to popcon.
* It would be extremely hard to package for someone else. Since the
  OCaml bindings are directly supported inside the upstream LLVM
  project, my feeling is that packaging them separately would require
  basically a copy of `llvm-toolchain` source package, with other binary
  packages stripped off, and keeping that in close synchronization with
  the other packages from the *true* `llvm-toolchain`.
* I don't know about the long-term maintenance cost, but fixing the
  package right now looks feasible (see attached patch, and
  explanations below).

Playing a bit with the `llvm-toolchain` source package, it looks like
the OCaml bindings are already generated, and only need copying into
the corresponding package. Here is what seems to work on my system
(using revision r2501, just before the removal):

    sudo apt-get build-dep libllvm-3.8-ocaml-dev
    debcheckout llvm-toolchain-3.8
    cd llvm-toolchain-3.8
    svn up -r 2501
    patch -p0 < ../../libllvm-3.8-ocaml-dev-enable.patch # Attached
    debuild -b -uc -us # Fetch a drink and a book
    cd ..
    sudo dpkg -i libllvm-3.8-ocaml-dev_3.8.1-19\~exp2_amd64.deb \
        llvm-3.8-dev_3.8.1-19\~exp2_amd64.deb \
        libllvm3.8_3.8.1-19\~exp2_amd64.deb \
        llvm-3.8_3.8.1-19\~exp2_amd64.deb \
        llvm-3.8-runtime_3.8.1-19\~exp2_amd64.deb
    # Build and test some OCaml programs using the library

The patch is only a few lines long. It makes the doc and renames the
OCaml library folder in `debian/rules` (because `dh_install` can't
rename, and it is called `ocaml` instead of `llvm-3.8`). The patch also
uncomments (and fixes some paths in) the install directives in
`libllvm-X.Y-ocaml-dev.install.in`.

Note however that this was not tested on a clean (i.e. newly
installed, minimal) system, and that the package was FTBFS before I
modified it (cmake was complaining about not finding `ocamldoc/html` in
`docs/cmake_install.cmake`).

I also tested the generated library quite superficially (most of my
codebase needs a few changes to accommodate the non retro-compatible
changes between LLVM 3.5 and 3.8).


So, if you choose to stick to removing the package, I won't complain
(you are the one(s) doing the work, and knowing the maintenance burden
of it). But if it can be kept without too much difficulty, it would
be appreciated.

Thanks anyway,
Regards,
-- 
"If Tyranny and Oppression come to this land, it will be in the guise
 of fighting a foreign enemy."                           James Madison

Cyril Soldani <cyril.sold...@legiasoft.com>
Index: debian/libllvm-X.Y-ocaml-dev.install.in
===================================================================
--- debian/libllvm-X.Y-ocaml-dev.install.in	(revision 2501)
+++ debian/libllvm-X.Y-ocaml-dev.install.in	(working copy)
@@ -1,2 +1,2 @@
-#@OCAML_STDLIB_DIR@/llvm-@LLVM_VERSION@	@OCAML_STDLIB_DIR@/
-#usr/lib/llvm-@LLVM_VERSION@/docs/llvm/ocamldoc/html	usr/share/doc/libllvm-@LLVM_VERSION@-ocaml-dev/
+@OCAML_STDLIB_DIR@/llvm-@LLVM_VERSION@	@OCAML_STDLIB_DIR@/
+usr/lib/llvm-@LLVM_VERSION@/docs/ocaml/html/html	usr/share/doc/libllvm-@LLVM_VERSION@-ocaml-dev/
Index: debian/rules
===================================================================
--- debian/rules	(revision 2501)
+++ debian/rules	(working copy)
@@ -284,6 +284,7 @@
 build_doc:
 	cd $(CURDIR)/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man
 	cd $(CURDIR)/clang/docs && make -f Makefile.sphinx && make -f Makefile.sphinx man
+	$(PRE_PROCESS) $(MAKE) $(NJOBS) -C "$(TARGET_BUILD)/docs" ocaml_doc
 
 # Rename manpages
 	d=$(CURDIR)/docs/_build/man/; \
@@ -441,6 +442,13 @@
 		$(CURDIR)/debian/libclang-common-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/include/; \
 	fi
 
+# Rename OCaml bindings
+	if test -d "$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml"; then \
+		mkdir -p "$(DEB_INST)$(OCAML_STDLIB_DIR)"; \
+		mv -f "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml" \
+			"$(DEB_INST)$(OCAML_STDLIB_DIR)/llvm-$(LLVM_VERSION)"; \
+	fi
+
 # Delete the target build directory to save some space on the build systems
 # All the files have been installed in $(CURDIR)/debian/tmp/ already
 	rm -rf $(TARGET_BUILD)

Attachment: pgp2IqOaOgb34.pgp
Description: OpenPGP digital signature

Reply via email to