[Pkg-ocaml-maint-commits] [SCM] ocaml-dbus packaging branch, master, updated. debian/0.06-1-1-gd58d6aa

Sylvain Le Gall gildor at debian.org
Sun Jun 8 22:50:58 UTC 2008


The following commit has been merged in the master branch:
commit ba1e3ada25de2c6005d408868b6b5bf149c52515
Author: Sylvain Le Gall <gildor at debian.org>
Date:   Mon Jun 9 00:44:24 2008 +0200

    Patch makefile to add install|all-byte|opt target and fix ocamlmklib invocation.

diff --git a/debian/patches/00list b/debian/patches/00list
index e69de29..203cf3e 100644
--- a/debian/patches/00list
+++ b/debian/patches/00list
@@ -0,0 +1 @@
+01_makefile
diff --git a/debian/patches/01_makefile.dpatch b/debian/patches/01_makefile.dpatch
new file mode 100755
index 0000000..6bb4667
--- /dev/null
+++ b/debian/patches/01_makefile.dpatch
@@ -0,0 +1,85 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 01_makefile.dpatch by Sylvain Le Gall <gildor at debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Use ocamlc to compile C files and pass only DBUS flags through -ccopt,
+## DP: add {all|install}-{opt|byte} targets.
+
+ at DPATCH@
+diff -urNad ocaml-dbus~/Makefile ocaml-dbus/Makefile
+--- ocaml-dbus~/Makefile	2008-06-09 00:38:33.000000000 +0200
++++ ocaml-dbus/Makefile	2008-06-09 00:39:50.000000000 +0200
+@@ -1,9 +1,8 @@
+-CC = gcc
+-CFLAGS = -Wall -fPIC -O2 `pkg-config --cflags dbus-1` -I$(OCAMLLIBDIR)
++DBUSFLAGS = -ccopt "$(shell pkg-config --cflags dbus-1)"
+ OCAMLC = ocamlc
+ OCAMLOPT = ocamlopt
+ 
+-LDFLAGS = -cclib -L./
++DBUSLDFLAGS = -cclib "$(filter-out -l%,$(shell pkg-config --libs dbus-1))" $(filter -l%,$(shell pkg-config --libs dbus-1)) 
+ 
+ OCAMLOPTFLAGS =
+ OCAML_PKG_NAME = dbus
+@@ -19,10 +18,15 @@
+ 
+ INTERFACES = dBus.cmi dBus.mli
+ LIBS = dBus.cmxa dBus.cma
++LIBS_BYTE = $(filter-out %.cmxa,$(LIBS))
+ PROGRAMS = test
+ 
+ all: $(INTERFACES) $(LIBS) $(PROGRAMS)
+ 
++all-opt: all
++
++all-byte: $(INTERFACES) $(LIBS_BYTE)
++
+ bins: $(PROGRAMS)
+ 
+ libs: $(LIBS)
+@@ -31,14 +35,12 @@
+ 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -a -cclib -ldbus_stubs -cclib -ldbus-1 -o $@ dBus.cmx
+ 
+ dBus.cma: libdbus_stubs.a dBus.cmi dBus.cmo
+-	$(OCAMLC) -a -dllib dlldbus_stubs.so -cclib -ldbus_stubs -cclib -ldbus-1 -o $@ -custom dBus.cmo
++	$(OCAMLC) -a -dllib dlldbus_stubs.so -cclib -ldbus_stubs -cclib -ldbus-1 -o $@ dBus.cmo
+ 
+-dbus_stubs.a: dbus_stubs.o
+-	ocamlmklib -o dbus_stubs $+
++dbus_stubs.a: libdbus_stubs.a
+ 
+ libdbus_stubs.a: dbus_stubs.o
+-	ar rcs $@ $+
+-	ocamlmklib -o dbus_stubs $+
++	ocamlmklib -o dbus_stubs $(DBUSLDFLAGS) $+
+ 
+ %.cmo: %.ml
+ 	$(OCAMLC) -c -o $@ $<
+@@ -50,7 +52,7 @@
+ 	$(OCAMLOPT) $(OCAMLOPTFLAGS) -c -o $@ $<
+ 
+ %.o: %.c
+-	$(CC) $(CFLAGS) -c -o $@ $<
++	$(OCAMLC) $(DBUSFLAGS) -c -o $@ $<
+ 
+ .PHONY: check
+ check:
+@@ -62,11 +64,16 @@
+ install: $(LIBS)
+ 	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore $(OCAML_PKG_NAME) META $(INTERFACES) $(LIBS) *.a *.so *.cmx
+ 
++install-opt: install
++
++install-byte: all-byte
++	ocamlfind install -destdir $(OCAMLDESTDIR) -ldconf ignore $(OCAML_PKG_NAME) META $(INTERFACES) $(LIBS_BYTE) *.a *.so 
++
+ uninstall:
+ 	ocamlfind remove -destdir $(OCAMLDESTDIR) $(OCAML_PKG_NAME)
+ 
+-test: dBus.cmxa test.ml
+-	$(OCAMLOPT) -o $@ $(LDFLAGS) unix.cmxa $+
++test: dBus.cma test.ml
++	$(OCAMLC) -o $@ unix.cma $+
+ 
+ clean:
+ 	rm -f *.o *.so *.a *.cmo *.cmi *.cma *.cmx *.cmxa $(LIBS) $(PROGRAMS)

-- 
ocaml-dbus packaging



More information about the Pkg-ocaml-maint-commits mailing list