OCaml Forge
SCM

Detail: [#1068] Building latest darcs on OSX 10.6.8

Bugs: Browse | Download .csv | Monitor

[#1068] Building latest darcs on OSX 10.6.8

Date:
2011-12-14 10:58
Priority:
3
State:
Open
Submitted by:
Philippe STRAUSS (friendship7net)
Assigned to:
Nobody (None)
Hardware:
None
Resolution:
None
Severity:
normal
Version:
None
Component:
None
Operating System:
MacOS X
Product:
None
 
URL:
Summary:
Building latest darcs on OSX 10.6.8

Detailed description
Hello o'closure team, hello Vincent,

My platform: OSX 10.6.8, macports up to date, godi ocaml 3.12.1 up to date.

I've been able to build oclosure on OSX with the following small mod (GNUism vs BSD):

--- Makefile.orig 2011-11-30 10:03:50.000000000 +0100
+++ Makefile 2011-11-30 10:04:09.000000000 +0100
@@ -26,7 +26,7 @@
ocamlfind install $(LIBRARY) goog/goog.cmi goog/oclosure.cma META
cp -r google-closure/closure google-closure/third_party $(DESTDIR)/$(LIBRARY)
chmod +x $(DESTDIR)/$(LIBRARY)/closure/bin/build/closurebuilder.py
- install -D -m 755 oclosure_req ${BINDIR}/oclosure_req
+ install -m 755 oclosure_req ${BINDIR}/oclosure_req

uninstall:
-[ ! -d $(DESTDIR)/$(LIBRARY)/closure ] || rm -rf $(DESTDIR)/$(LIBRARY)/closure

--8<--

but about building examples (make examples) it gets more difficult, first another small Makefile mod:

--- Makefile.orig 2011-12-14 09:38:11.000000000 +0100
+++ Makefile 2011-12-14 10:56:37.000000000 +0100
@@ -3,7 +3,7 @@
TARGETS=$(SRC:.ml=.js)
LIB=-package js_of_ocaml oclosure.cma
SCRIPTS=../scripts
-OCAMLFLAGS=-package js_of_ocaml,js_of_ocaml.syntax -syntax camlp4o -I $(GOOG)
+OCAMLFLAGS=-package js_of_ocaml,js_of_ocaml.syntax,findlib -syntax camlp4o -I $(GOOG)
OCAMLLFLAGS=
GOOG=../goog
all: $(TARGETS)
@@ -14,7 +14,7 @@

%.js: %.byte
js_of_ocaml $^ -pretty
- ocaml str.cma $(SCRIPTS)/requirements.ml $@
+ ocaml -I /opt/godi312/lib/ocaml/pkg-lib/findlib str.cma unix.cma findlib.cma $(SCRIPTS)/requirements.ml $@

ocamldep:
ocamlfind ocamldep -I $(GOOG) -I $(GOOG)/ui $(OCAMLFLAGS) $(SRC)

--8<--

Here, cd in examples (gives the same while staying in toplevel and doing make examples), also probably a GNUism with sed:

philou@air:~/src/web/oclosure-darcs/examples$ make
[CC] examples.byte
ocamlfind ocamlc -linkpkg -o examples.byte -package js_of_ocaml,js_of_ocaml.syntax,findlib -syntax camlp4o -I ../goog -package js_of_ocaml oclosure.cma examples.ml
js_of_ocaml examples.byte -pretty
ocaml -I /opt/godi312/lib/ocaml/pkg-lib/findlib str.cma unix.cma findlib.cma ../scripts/requirements.ml examples.js
/opt/godi312/lib/ocaml/site-lib/oclosure/closure/bin/build/closurebuilder.py: Scanning paths...
/opt/godi312/lib/ocaml/site-lib/oclosure/closure/bin/build/closurebuilder.py: 725 sources scanned.
/opt/godi312/lib/ocaml/site-lib/oclosure/closure/bin/build/closurebuilder.py: Building dependency tree..
sed: 1: "examples_oclosure.js": invalid command code e
make: *** [examples.js] Error 1
rm examples.byte

since an example_oclosure.js is still there, I can type make a second time and gives :

philou@air:~/src/web/oclosure-darcs/examples$ make
[CC] test_advancedTooltip.byte
ocamlfind ocamlc -linkpkg -o test_advancedTooltip.byte -package js_of_ocaml,js_of_ocaml.syntax,findlib -syntax camlp4o -I ../goog -package js_of_ocaml oclosure.cma test_advancedTooltip.ml
File "test_advancedTooltip.ml", line 44, characters 5-65:
Error: This expression has type (unit, unit -> unit) Js.meth_callback
but an expression was expected of type
(Dom_html.event Js.t -> unit) Js.callback =
(unit, Dom_html.event Js.t -> unit) Js.meth_callback
make: *** [test_advancedTooltip.byte] Error 2


Thanks for your work BTW !


Followup

Message
Date: 2012-11-05 21:43
Sender: 100s Unta

In oclosure/scripts/requirements.ml the line with "sed" shall be replaced to work correctly under mac os x, i.e. (the one i use) :

sed -ie 's/^goog.global.CLOSURE_NO_DEPS;$/goog.global.CLOSURE_NO_DEPS=true;/'

This modification should work on linux as well.

Others should work too :
sed -i "" -e 's/^goog.global.CLOSURE_NO_DEPS;$/goog.global.CLOSURE_NO_DEPS=true;/'
sed -i -e 's/^goog.global.CLOSURE_NO_DEPS;$/goog.global.CLOSURE_NO_DEPS=true;/'
sed -i "" 's/^goog.global.CLOSURE_NO_DEPS;$/goog.global.CLOSURE_NO_DEPS=true;/'

the sed version in mac os x reads "s/^goog.global.CLOSURE_NO_DEPS;$/goog.global.CLOSURE_NO_DEPS=true;/" as the extension of the backup file (see https://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/10.6/man1/sed.1.html). Thus this leads to the error "sed ... invalid command code e".

Bug [#1070] has the same origin.

Hope this helps

regards

(tested on 10.5 and 10.6. Should work on 10.7)

Attached Files:

Changes:

No Changes Have Been Made to This Item