[Slackbuilds-users] Unison fails to build with OCaml 4.0

Luiz Carlos Ramos lramos.prof at yahoo.com.br
Fri Sep 26 11:09:59 UTC 2014


Hello,

I was just trying to build unison in a new machine, and I had some
issues that ultimately have been related to differences between OCaml
3.x and 4.0, as could be found referenced in these two messages:

https://lists.macosforge.org/pipermail/macports-tickets/2012-October/121353.html
http://trac.macports.org/ticket/35407#comment:7:

One of them suggest this patch, for the Mac OS X build:

http://trac.macports.org/attachment/ticket/35407/patch-Makefile.OCaml.diff

I just adapted it for the latest slackbuild, and what I suggest is to
patch the script unison.SlackBuild with this:

----------------------------------------------
--- unison.SlackBuild   2013-11-25 15:19:36.000000000 -0200
+++ unison.SlackBuild-new       2014-09-26 07:33:22.892052418 -0300
@@ -55,6 +55,11 @@ find -L . \
  \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
 
+# Apply patches
+for _p in $(ls $CWD/*.patch); do
+       patch -p1 -i $_p
+done
+
 # no need to set CFLAGS
 
 # FLAVOR lets the user enable their choice of interfaces. Defaults to
 gtk2
----------------------------------------------

and include the file 01-change-ocamllibdir-for-ocaml-40.patch with
this contents:

----------------------------------------------
--- a/Makefile.OCaml    2011-04-16 17:35:38.000000000 -0300
+++ b/Makefile.OCaml    2014-09-25 13:18:43.239151396 -0300
@@ -71,8 +71,8 @@ OCAMLLIBDIR=$(shell ocamlc -v | tail -1
 #
 # This should be set to an appropriate value automatically, depending
 # on whether the lablgtk library is available
-LABLGTKLIB=$(OCAMLLIBDIR)/lablgtk
-LABLGTK2LIB=$(OCAMLLIBDIR)/lablgtk2
+LABLGTKLIB=$(OCAMLLIBDIR)/site-lib/lablgtk
+LABLGTK2LIB=$(OCAMLLIBDIR)/site-lib/lablgtk2
 ##BCP [3/2007]: Removed temporarily, since the OSX UI is not working
 well 
 ## at the moment and we don't want to confuse people by building it by
 default
 ifeq ($(OSARCH),osx)
@@ -92,7 +92,7 @@ buildexecutable::
 
 INCLFLAGS=-I lwt -I ubase -I system
 CAMLFLAGS+=$(INCLFLAGS)
-CAMLFLAGS+=-I system/$(SYSTEM) -I lwt/$(SYSTEM)
+CAMLFLAGS+=-I system/$(SYSTEM) -I lwt/$(SYSTEM) -I $(LABLGTK2LIB)
 
 ifeq ($(OSARCH),win32)
   # Win32 system
----------------------------------------------

This could make me able to build unison with OCaml 4.0.

That's all. Hope this could help someone else.

Thanks,

Luiz Ramos
São Paulo - Brazil
lramos dot prof at yahoo dot com dot br


More information about the SlackBuilds-users mailing list