[Pkg-ocaml-maint-commits] [SCM] mingw32-ocaml packaging branch, master, updated. b27e08c16a030758f65bc930e16040b93f3f63bd
Romain Beauxis
toots at rastageeks.org
Sat Jan 9 10:51:24 UTC 2010
The following commit has been merged in the master branch:
commit b27e08c16a030758f65bc930e16040b93f3f63bd
Author: Romain Beauxis <toots at rastageeks.org>
Date: Sat Jan 9 11:47:32 2010 +0100
Added ocamlfind support
diff --git a/debian/ocamlfind.conf.in b/debian/ocamlfind.conf.in
new file mode 100644
index 0000000..ead5c0e
--- /dev/null
+++ b/debian/ocamlfind.conf.in
@@ -0,0 +1,7 @@
+stdlib="@libdir@/ocaml"
+ldconf="@libdir@/ocaml/ld.conf"
+destdir="@libdir@/ocaml"
+path="@libdir@/ocaml"
+ocamlc="@target at -ocamlc"
+ocamlopt="@target at -ocamlopt"
+ocamldep="@target at -ocamldep"
diff --git a/debian/rules b/debian/rules
index 1a9a560..b9de8ff 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,7 @@ DEB_TAR_SRCDIR := .
MINGW32_HOST := i586-mingw32msvc
FLEXDLL_DIR := flexdll
OCAML_DIR := ocaml-3.11.1
+FINDLIB_DIR := findlib-1.2.5+debian
OTHER_LIBS := win32unix str num dynlink bigarray systhreads win32graph
INSTALL_PATH := $(CURDIR)/debian/mingw32-ocaml
DEB_STRIP_EXCLUDE := i586-mingw32msvc
@@ -83,12 +84,32 @@ stamp-build-mingw32-ocaml:
make IFLEXDIR=-I$(CURDIR)/$(DEB_BUILDDIR)/$(FLEXDLL_DIR) opt
touch stamp-build-mingw32-ocaml
+stamp-build-findlib:
+ cd $(DEB_BUILDDIR)/$(FINDLIB_DIR)/tools/extract_args && make
+ $(DEB_BUILDDIR)/$(FINDLIB_DIR)/tools/extract_args/extract_args \
+ -o $(DEB_BUILDDIR)/$(FINDLIB_DIR)/src/findlib/ocaml_args.ml \
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlc \
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlcp \
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlmktop \
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlopt \
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamldep
+ cd $(DEB_BUILDDIR)/$(FINDLIB_DIR) && ./configure \
+ -config /etc/$(MINGW32_HOST)-ocamlfind.conf \
+ -bindir /usr/$(MINGW32_HOST)/bin \
+ -sitelib /usr/$(MINGW32_HOST)/lib/ocaml \
+ -mandir /usr/share/man \
+ -with-toolbox
+ cd $(DEB_BUILDDIR)/$(FINDLIB_DIR) && make all
+ cd $(DEB_BUILDDIR)/$(FINDLIB_DIR) && make opt
+ touch stamp-build-findlib
+
build/mingw32-ocaml:: stamp-build-flexdll \
stamp-build-ocamlcore \
stamp-prepare-cross-build \
- stamp-build-mingw32-ocaml
+ $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlopt \
+ stamp-build-findlib
-install/mingw32-ocaml::
+$(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlopt:
mkdir -p $(INSTALL_PATH)/usr/$(MINGW32_HOST)/lib/ocaml/threads
mkdir -p $(INSTALL_PATH)/usr/$(MINGW32_HOST)/lib/ocaml/stublibs
mkdir -p $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin
@@ -124,6 +145,34 @@ install/mingw32-ocaml::
$(INSTALL_PATH)/usr/$(MINGW32_HOST)/lib/ocaml/flexdll
dh_link usr/$(MINGW32_HOST)/lib/ocaml/flexdll/flexlink.exe usr/bin/flexlink
+install/mingw32-ocaml::
+ # Install findlib
+ # Create this dir to please install..
+ mkdir -p $(INSTALL_PATH)/usr/lib/ocaml
+ cd $(DEB_BUILDDIR)/$(FINDLIB_DIR) && make install \
+ prefix=$(INSTALL_PATH)
+ # Remove documentation which is already available
+ # in the Debian native package.
+ rm -r $(INSTALL_PATH)/usr/share/man
+ # Remove ocamlfind binary - we will use the native version.
+ rm $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/ocamlfind
+ rm $(INSTALL_PATH)/usr/$(MINGW32_HOST)/bin/safe_camlp4
+ # Remove findlib & num-top libs: if anything uses these we can
+ # add them back later.
+ rm -r $(INSTALL_PATH)/usr/$(MINGW32_HOST)/lib/ocaml/findlib
+ rm -r $(INSTALL_PATH)/usr/$(MINGW32_HOST)/lib/ocaml/num-top
+ # XXX topfind gets installed as %{_libdir}/ocaml - not sure why
+ # but delete it anyway.
+ rm -rf $(INSTALL_PATH)/usr/lib/ocaml
+ # Override /etc/%{_mingw32_target}-ocamlfind.conf with our
+ # own version.
+ rm $(INSTALL_PATH)/etc/$(MINGW32_HOST)-ocamlfind.conf
+ sed \
+ -e "s, at libdir@,/usr/$(MINGW32_HOST)/lib,g" \
+ -e 's, at target@,$(MINGW32_HOST),g' \
+ < debian/ocamlfind.conf.in \
+ > $(INSTALL_PATH)/etc/$(MINGW32_HOST)-ocamlfind.conf
+
clean::
rm -f *.cdbs-config_list stamp-build-flexdll stamp-build-ocamlcore \
- stamp-prepare-cross-build stamp-build-mingw32-ocaml
+ stamp-prepare-cross-build stamp-build-mingw32-ocaml stamp-build-findlib
--
mingw32-ocaml packaging
More information about the Pkg-ocaml-maint-commits
mailing list