[Pkg-ocaml-maint-commits] [SCM] js-of-ocaml packaging branch, master, updated. debian/1.0.8-1-6-g0784ea3
Stephane Glondu
steph at glondu.net
Sat Dec 3 12:58:07 UTC 2011
The following commit has been merged in the master branch:
commit 2688803a751bda4e597a4a9811078e370e0dcb96
Author: Stephane Glondu <steph at glondu.net>
Date: Sat Dec 3 11:29:52 2011 +0100
Fix FTBFS on bytecode architectures
diff --git a/debian/patches/0001-Better-support-for-disabling-native-compilation.patch b/debian/patches/0001-Better-support-for-disabling-native-compilation.patch
new file mode 100644
index 0000000..5d8055c
--- /dev/null
+++ b/debian/patches/0001-Better-support-for-disabling-native-compilation.patch
@@ -0,0 +1,103 @@
+From: Stephane Glondu <steph at glondu.net>
+Date: Sat, 3 Dec 2011 12:29:59 +0100
+Subject: Better support for disabling native compilation
+
+Introduce BEST variable in Makefile.conf, used to determine if native
+compiler and libraries should be compiled and
+installed. Unconditionally set to "opt" (meaning ocamlopt is
+available), it can be overridden in calls to "make".
+---
+ Makefile | 2 +-
+ Makefile.conf | 2 ++
+ Makefile.filelist | 4 ++++
+ compiler/Makefile | 9 ++++++---
+ lib/Makefile | 5 ++++-
+ 5 files changed, 17 insertions(+), 5 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 3591d62..c244edc 100644
+--- a/Makefile
++++ b/Makefile
+@@ -31,7 +31,7 @@ include Makefile.filelist
+
+ VERSION := $(shell head -n 1 VERSION)
+ install:
+- ocamlfind install -patch-version ${VERSION} $(LIBRARY) lib/META $(INTF) $(IMPL) $(NATIMPL) $(OTHERS) $(DOC)
++ ocamlfind install -patch-version ${VERSION} $(LIBRARY) lib/META $(INTF) $(IMPL) $(OTHERS) $(DOC)
+ install -d -m 755 $(BINDIR)
+ install $(BIN) $(BINDIR)
+
+diff --git a/Makefile.conf b/Makefile.conf
+index ef72bfa..8a5c69d 100644
+--- a/Makefile.conf
++++ b/Makefile.conf
+@@ -15,6 +15,8 @@ OBJEXT := .o
+ LIBEXT := .a
+ DLLEXT := .so
+
++BEST := opt
++
+ ### Optional dependencies: ocsigen-deriving
+
+ DERIVING := $(shell ocamlfind query deriving-ocsigen 2> /dev/null)
+diff --git a/Makefile.filelist b/Makefile.filelist
+index 025573e..6d51fe6 100644
+--- a/Makefile.filelist
++++ b/Makefile.filelist
+@@ -25,6 +25,10 @@ NATIMPL := lib/deriving_json.cmxa \
+
+ NATIMPL += $(JSON:.cmi=.cmx)
+
++ifeq "$(BEST)" "opt"
++IMPL += $(NATIMPL)
++endif
++
+ endif
+
+ DOC := ${INTF:.cmi=.mli}
+diff --git a/compiler/Makefile b/compiler/Makefile
+index 8a5adb6..5569da5 100644
+--- a/compiler/Makefile
++++ b/compiler/Makefile
+@@ -12,10 +12,13 @@ OBJS=pretty_print.cmx util.cmx dgraph.cmx \
+
+ COMPOBJS=$(OBJS) main.cmx
+
+-compile: $(COMPOBJS:cmx=cmo)
++$(COMPILER): compile.$(BEST)
++ cp -f $< $@
++
++compile.byte: $(COMPOBJS:cmx=cmo)
+ ocamlfind ocamlc -package findlib,str -linkpkg -o $@ $^
+
+-$(COMPILER): $(COMPOBJS)
++compile.opt: $(COMPOBJS)
+ ocamlfind ocamlopt -package findlib,str -linkpkg -o $@ $^
+
+ compiler.cma: $(OBJS:cmx=cmo)
+@@ -32,7 +35,7 @@ compiler.cma: $(OBJS:cmx=cmo)
+
+ clean:
+ rm -f *.cm[aiox] *.o
+- rm -f js_of_ocaml compile
++ rm -f js_of_ocaml compile.opt compile.byte
+
+ depend:
+ ocamldep *.ml *.mli > .depend
+diff --git a/lib/Makefile b/lib/Makefile
+index 6de96a4..5fe3d5a 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -10,7 +10,10 @@ include ../Makefile.conf
+
+ ifneq "${DERIVING}" ""
+ PA_DERIVING=syntax/pa_deriving_Json.cmo
+-DERIVING_JSON=deriving_json.cma deriving_json.cmxs
++DERIVING_JSON=deriving_json.cma
++ifeq "$(BEST)" "opt"
++DERIVING_JSON += deriving_json.cmxs
++endif
+ endif
+
+ all: $(LIBNAME).cma syntax/pa_js.cmo ${PA_DERIVING} ${DERIVING_JSON}
+--
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..3156972
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-Better-support-for-disabling-native-compilation.patch
diff --git a/debian/rules b/debian/rules
index f9d252d..d36d7eb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,7 +4,6 @@
DESTDIR=$(CURDIR)/debian/tmp
BINDIR=$(DESTDIR)/usr/bin
DOCDIR=$(DESTDIR)/usr/share/doc/libjs-of-ocaml-dev
-COMPILER=$(shell awk '/COMPILER/{print $$NF}' Makefile.conf)
include /usr/share/ocaml/ocamlvars.mk
@@ -14,16 +13,6 @@ export OCAMLFIND_LDCONF=ignore
%:
dh $@ --with ocaml
-.PHONY: override_dh_auto_build
-override_dh_auto_build:
-ifeq ($(OCAML_HAVE_OCAMLOPT),yes)
- make -C compiler
-else
- make -C compiler compile
- mv compiler/compile compiler/$(COMPILER)
-endif
- make library runtime doc
-
.PHONY: override_dh_install
override_dh_install:
dh_install -X.so.owner --fail-missing
@@ -32,10 +21,14 @@ override_dh_install:
override_dh_compress:
dh_compress -X.js
+.PHONY: override_dh_auto_build
+override_dh_auto_build:
+ $(MAKE) BEST=$(OCAML_BEST)
+
.PHONY: override_dh_auto_install
override_dh_auto_install:
mkdir -p $(OCAMLFIND_DESTDIR) $(BINDIR) $(DESTDIR)$(OCAML_DLL_DIR)
- $(MAKE) install BINDIR=$(BINDIR)
+ $(MAKE) install BINDIR=$(BINDIR) BEST=$(OCAML_BEST)
mkdir -p $(DOCDIR)/html $(DOCDIR)/examples
cp -a doc/api-html $(DOCDIR)/html/api
cp -a examples/* $(DOCDIR)/examples
--
js-of-ocaml packaging
More information about the Pkg-ocaml-maint-commits
mailing list