Hi, I have written an ebuild for an ML library and I found that two of the "dev-ml" section ebuilds were suspicious. Camlimges' and ulex' ebuilds copy the ML linker configuration file to the ${D} subdirectories. The consequence is that Portage sees that file as part of those packages (camlimages & ulex). This means that when you unmerge those packages, the /usr/lib/ocaml/ld.conf shared file is deleted, which breaks OCAML environment. The solution I found is to implement the "src_unpack" function and to copy ld.conf in the ${W} directory and to correct ld.conf's location in the related Makefile. The effective patch of the shared file /usr/lib/ocaml/ld.conf should be implemented in the "pkg_postinst" function so that the linker configuration file should not be deleted at unmerge. Feel free to contact me for further details, See you all, great job, julien
I fixed the ebuilds in CVS (r1 versions). It should not happen anymore, once we get bug #39246 proposal running. Try if you've got some time :)
Hi mattieu, I noticed your corrections. The ML linker configuration file is no more deleted at related ebuilds' unmerge. Mentioned packages unmerge ok. There still remain cosmetic issues: * ulex-0.2-r1: the previous ebuild (ulex-0.2) used to add the following line in /usr/lib/ocaml/ld.conf : "/usr/lib/ocaml/site-packages/ulex" which is no more the case (I assume the library won't be able to get linked). * camlimages-2.11-r1: when you do the following steps : # emerge camlimages # emerge unmerge camlimages # emerge camlimages Portage adds twice camlimages library's location in /usr/lib/ocaml/ld.conf (I don't actually know the consequences) In both cases, this could be corrected as follows: pkg_postinst() { local ECHO=$(which echo) local CAT=$(which cat) local GREP=$(which grep) if [ -z `$CAT /usr/lib/ocaml/ld.conf | $GREP ${LIBLOCATION}` ] then einfo "Patching OCAML linker configuration file..." $ECHO ${LIBLOCATION} >> /usr/lib/ocaml/ld.conf fi } Replacing ${LIBLOCATION} by the path mentioned in the Makefile. Sorry for beeing that maniac, see you all, julien
The fact the camlimages adds itself twice could be corrected indeed, but that's not a bug and will not happen when the aforementionned bug's solution will be in place. ld.conf is used only for C libraries linked to some package, so as ulex doesn't link to any, we can safely set OCAMLFIND_LDCONF=dummy and not mess with ld.conf. I have no problem with this sort of nitpicking :)