[Pkg-ocaml-maint-commits] r1934 - in trunk/packages/findlib/trunk/debian: . patches

Stefano Zacchiroli zack at costa.debian.org
Tue Nov 8 21:34:29 UTC 2005


Author: zack
Date: 2005-11-08 21:34:28 +0000 (Tue, 08 Nov 2005)
New Revision: 1934

Added:
   trunk/packages/findlib/trunk/debian/control.in
   trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs.in
Modified:
   trunk/packages/findlib/trunk/debian/changelog
   trunk/packages/findlib/trunk/debian/control
   trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs
   trunk/packages/findlib/trunk/debian/patches/23_include.dpatch
   trunk/packages/findlib/trunk/debian/rules
Log:
ocaml 3.09 transition


Modified: trunk/packages/findlib/trunk/debian/changelog
===================================================================
--- trunk/packages/findlib/trunk/debian/changelog	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/changelog	2005-11-08 21:34:28 UTC (rev 1934)
@@ -1,3 +1,19 @@
+findlib (1.1-1) unstable; urgency=low
+
+  * New usptream release
+  * Rebuilt with ocaml 3.09
+  * debian/patches/23_include.dpatch
+    - ported to this new upstream release
+  * debian/{rules,*.in}
+    - no more hardcoding of ocaml ABI version anywhere
+  * debian/rules
+    - findlib now detect at compile time if native code compilation is
+      available, if so it adds ocamlc/opt/... definition to
+      /etc/ocamlfind.conf. Grep-ed them away from debian configuration file
+      since native code compilers are not installed everywhere
+
+ -- Stefano Zacchiroli <zack at debian.org>  Tue,  8 Nov 2005 09:16:00 +0000
+
 findlib (1.0.4-4) unstable; urgency=low
 
   * debian/patches/23_include.dpatch

Modified: trunk/packages/findlib/trunk/debian/control
===================================================================
--- trunk/packages/findlib/trunk/debian/control	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/control	2005-11-08 21:34:28 UTC (rev 1934)
@@ -2,13 +2,13 @@
 Section: devel
 Priority: optional
 Maintainer: Stefano Zacchiroli <zack at debian.org>
-Build-Depends: debhelper (>> 4.0.0), ocaml-3.08.3, m4, gawk | awk, dpatch
+Build-Depends: debhelper (>> 4.0.0), ocaml (>= 3.09.0), m4, gawk | awk, dpatch
 Standards-Version: 3.6.2
 
 Package: ocaml-findlib
 Section: devel
 Architecture: any
-Depends: ocaml-nox-3.08.3, ${shlibs:Depends}, ${misc:Depends}
+Depends: ocaml-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}
 Description: Management tool for OCaml programming language libraries
  The "findlib" library provides a scheme to manage reusable software
  components (packages), and includes tools that support this

Copied: trunk/packages/findlib/trunk/debian/control.in (from rev 1933, trunk/packages/findlib/trunk/debian/control)
===================================================================
--- trunk/packages/findlib/trunk/debian/control	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/control.in	2005-11-08 21:34:28 UTC (rev 1934)
@@ -0,0 +1,24 @@
+Source: findlib
+Section: devel
+Priority: optional
+Maintainer: Stefano Zacchiroli <zack at debian.org>
+Build-Depends: debhelper (>> 4.0.0), ocaml (>= @OCamlABI@), m4, gawk | awk, dpatch
+Standards-Version: 3.6.2
+
+Package: ocaml-findlib
+Section: devel
+Architecture: any
+Depends: ocaml-nox-${F:OCamlABI}, ${shlibs:Depends}, ${misc:Depends}
+Description: Management tool for OCaml programming language libraries
+ The "findlib" library provides a scheme to manage reusable software
+ components (packages), and includes tools that support this
+ scheme. Packages are collections of OCaml modules for which
+ metainformation can be stored. The packages are kept in the filesystem
+ hierarchy, but with strict directory structure. The library contains
+ functions to look the directory up that stores a package, to query
+ metainformation about a package, and to retrieve dependency
+ information about multiple packages. There is also a tool that allows
+ the user to enter queries on the command-line. In order to simplify
+ compilation and linkage, there are new frontends of the various OCaml
+ compilers that can directly deal with packages.
+

Modified: trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs
===================================================================
--- trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs	2005-11-08 21:34:28 UTC (rev 1934)
@@ -1,2 +1,2 @@
-usr/lib/ocaml/3.08.3/METAS
+usr/lib/ocaml/3.09.0/METAS
 usr/share/ocaml-findlib

Copied: trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs.in (from rev 1933, trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs)
===================================================================
--- trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/ocaml-findlib.dirs.in	2005-11-08 21:34:28 UTC (rev 1934)
@@ -0,0 +1,2 @@
+usr/lib/ocaml/@OCamlABI@/METAS
+usr/share/ocaml-findlib

Modified: trunk/packages/findlib/trunk/debian/patches/23_include.dpatch
===================================================================
--- trunk/packages/findlib/trunk/debian/patches/23_include.dpatch	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/patches/23_include.dpatch	2005-11-08 21:34:28 UTC (rev 1934)
@@ -2,144 +2,48 @@
 ## 23_include.dpatch by Stefano Zacchiroli <zack at debian.org>
 ##
 ## All lines beginning with `## DP:' are a description of the patch.
-## DP: adds support for 'include="<dir>"' in ocamlfind.conf, if dir is found,
-## DP: all files .conf are read at startup as additional configuration file,
-## DP: with the same syntax as /etc/ocamlfind.conf. Also, modifies debian
-## DP: findlib configuration so that /usr/share/ocaml-findlib/ is included.
+## DP: No description.
 
 @DPATCH@
-diff -urNad --exclude=CVS --exclude=.svn ./findlib.conf.in /tmp/dpep-work.SKU5zn/findlib-1.0.4/findlib.conf.in
---- ./findlib.conf.in	2005-08-23 10:05:43.000000000 +0200
-+++ /tmp/dpep-work.SKU5zn/findlib-1.0.4/findlib.conf.in	2005-08-23 10:05:43.000000000 +0200
-@@ -1,2 +1,3 @@
- destdir="/usr/local/lib/ocaml/3.08.3"
- path="/usr/local/lib/ocaml/3.08.3:@SITELIB@:@SITELIB@/METAS"
-+include="/usr/share/ocaml-findlib/"
-diff -urNad --exclude=CVS --exclude=.svn ./src/findlib/findlib.ml /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/findlib.ml
---- ./src/findlib/findlib.ml	2005-08-23 10:05:42.000000000 +0200
-+++ /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/findlib.ml	2005-08-23 10:05:43.000000000 +0200
-@@ -82,6 +82,30 @@
- 	[]
- ;;
+diff -urNad trunk~/src/findlib/findlib.ml trunk/src/findlib/findlib.ml
+--- trunk~/src/findlib/findlib.ml	2005-11-08 20:21:43.000000000 +0000
++++ trunk/src/findlib/findlib.ml	2005-11-08 20:24:22.000000000 +0000
+@@ -99,6 +99,8 @@
+   let configd_file =
+     config_file ^ ".d" in
  
-+let normalize_dir s =
-+  try
-+    if s.[String.length s - 1] = '/' then s else s ^ "/"
-+  with Invalid_argument _ -> failwith ("Invalid directory \"" ^ s ^ "\"")
++  let extra_configd_file = Findlib_config.extra_configd_file in
 +
-+  (** @return absolute paths of regular file contained in directory <path> *)
-+let ls_conf path =
-+  let dir_handle = Unix.opendir path in
-+  let is_regular fname = (Unix.stat fname).Unix.st_kind = Unix.S_REG in
-+  let is_conf fname =
-+    is_regular fname && Filename.check_suffix fname ".conf"
-+    && (Filename.basename fname).[0] <> '.'
-+  in
-+  let entries = ref [] in
-+  try
-+    while true do
-+      let entry = path ^ Unix.readdir dir_handle in
-+      if is_conf entry then entries := entry :: !entries
-+    done;
-+    []  (* dummy *)
-+  with End_of_file ->
-+    Unix.closedir dir_handle;
-+    List.fast_sort Pervasives.compare !entries
-+
- let init
-       ?env_ocamlpath ?env_ocamlfind_destdir ?env_ocamlfind_metadir
-       ?env_ocamlfind_commands ?env_camllib ?env_ldconf
-@@ -100,33 +124,39 @@
-       sys_ocamlbrowser, sys_ocamldoc,
-       sys_search_path, sys_destdir, sys_metadir, sys_stdlib, sys_ldconf = begin
-     if Sys.file_exists config_file then begin
--      let ch = open_in config_file in
--      try
-+      let rec vars_of_file fname =
-+        let ch = open_in fname in
- 	let vars = (Fl_metascanner.parse ch).Fl_metascanner.pkg_defs in
--	let lookup name default =
--	  try Fl_metascanner.lookup name [] vars
--	  with Not_found -> default
--	in
--	let tuple =
--	  ( (lookup "ocamlc" ocamlc_default),
--	    (lookup "ocamlopt" ocamlopt_default),
--	    (lookup "ocamlcp" ocamlcp_default),
--	    (lookup "ocamlmktop" ocamlmktop_default),
--	    (lookup "ocamldep" ocamldep_default),
--	    (lookup "ocamlbrowser" ocamlbrowser_default),
--	    (lookup "ocamldoc" ocamldoc_default),
--	    Fl_split.path (lookup "path" ""),
--	    (lookup "destdir" ""),
--	    (lookup "metadir" "none"),
--	    (lookup "stdlib" Findlib_config.ocaml_stdlib),
--	    (lookup "ldconf" Findlib_config.ocaml_ldconf)
--	  )
--	in
--	close_in ch;
--	tuple
--      with
--	  exc -> 
--	    close_in ch; raise exc
-+        close_in ch;
-+        List.flatten
-+          (List.map
-+            (fun var ->
-+              if var.Fl_metascanner.def_var = "include" then
-+                let dirname = normalize_dir var.Fl_metascanner.def_value in
-+                if Sys.file_exists dirname then
-+                  List.flatten (List.map vars_of_file (ls_conf dirname))
-+                else []
-+              else [var])
-+            vars)
-+      in
-+      let vars = vars_of_file config_file in
-+      let lookup name default =
-+        try Fl_metascanner.lookup name [] vars
-+        with Not_found -> default
-+      in
-+        ( (lookup "ocamlc" ocamlc_default),
-+          (lookup "ocamlopt" ocamlopt_default),
-+          (lookup "ocamlcp" ocamlcp_default),
-+          (lookup "ocamlmktop" ocamlmktop_default),
-+          (lookup "ocamldep" ocamldep_default),
-+          (lookup "ocamlbrowser" ocamlbrowser_default),
-+          (lookup "ocamldoc" ocamldoc_default),
-+          Fl_split.path (lookup "path" ""),
-+          (lookup "destdir" ""),
-+          (lookup "metadir" "none"),
-+          (lookup "stdlib" Findlib_config.ocaml_stdlib),
-+          (lookup "ldconf" Findlib_config.ocaml_ldconf)
-+        )
-     end
-     else
-       ( ocamlc_default, ocamlopt_default, ocamlcp_default, ocamlmktop_default,
-diff -urNad --exclude=CVS --exclude=.svn ./src/findlib/Makefile /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/Makefile
---- ./src/findlib/Makefile	2005-08-23 10:05:42.000000000 +0200
-+++ /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/Makefile	2005-08-23 10:05:43.000000000 +0200
-@@ -36,11 +36,11 @@
- opt: ocamlfind_opt$(EXEC_SUFFIX) findlib.cmxa topfind
- 
- ocamlfind$(EXEC_SUFFIX): findlib.cma $(OCAMLFIND_OBJECTS)
--	$(OCAMLC) -custom -o ocamlfind$(EXEC_SUFFIX) findlib.cma unix.cma \
-+	$(OCAMLC) -custom -o ocamlfind$(EXEC_SUFFIX) unix.cma findlib.cma \
- 	          $(OCAMLFIND_OBJECTS)
- 
- ocamlfind_opt$(EXEC_SUFFIX): findlib.cmxa $(OCAMLFIND_XOBJECTS)
--	$(OCAMLOPT) -o ocamlfind_opt$(EXEC_SUFFIX) findlib.cmxa unix.cmxa \
-+	$(OCAMLOPT) -o ocamlfind_opt$(EXEC_SUFFIX) unix.cmxa findlib.cmxa \
- 		  $(OCAMLFIND_XOBJECTS)
- 
- findlib.cma: $(OBJECTS)
-diff -urNad --exclude=CVS --exclude=.svn ./src/findlib/topfind.p /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/topfind.p
---- ./src/findlib/topfind.p	2004-04-04 13:42:40.000000000 +0200
-+++ /tmp/dpep-work.SKU5zn/findlib-1.0.4/src/findlib/topfind.p	2005-08-23 10:08:57.000000000 +0200
+   let vars_of_file f =
+     let ch = open_in config_file in
+     try
+@@ -136,12 +138,17 @@
+ 	  vars_of_file config_file
+ 	else
+ 	  [] in
++      let extra_configd_vars =  (* Debian specific *)
++        if Sys.file_exists extra_configd_file then
++          vars_of_dir extra_configd_file
++        else
++          [] in
+       let configd_vars =
+ 	if Sys.file_exists configd_file then 
+ 	  vars_of_dir configd_file
+ 	else
+ 	  [] in
+-      let vars = config_vars @ configd_vars in
++      let vars = extra_configd_vars @ config_vars @ configd_vars in
+       if vars <> [] then (
+ 	let lookup name default =
+ 	  try Fl_metascanner.lookup name config_preds vars
+diff -urNad trunk~/src/findlib/findlib_config.mlp trunk/src/findlib/findlib_config.mlp
+--- trunk~/src/findlib/findlib_config.mlp	2005-11-08 20:21:43.000000000 +0000
++++ trunk/src/findlib/findlib_config.mlp	2005-11-08 20:21:43.000000000 +0000
 @@ -4,6 +4,7 @@
-  * working findlib toploop.
   *)
  
-+#load "unix.cma";;
+ let config_file = "@CONFIGFILE@";;
++let extra_configd_file = "/usr/share/ocaml-findlib/";; (* Debian specific *)
  
- (* First test whether findlib_top is already loaded. If not, load it now.
-  * The test works by executing the toplevel phrase "Topfind.reset" and
+ let ocaml_stdlib = "@STDLIB@";;
+ 

Modified: trunk/packages/findlib/trunk/debian/rules
===================================================================
--- trunk/packages/findlib/trunk/debian/rules	2005-11-07 21:47:08 UTC (rev 1933)
+++ trunk/packages/findlib/trunk/debian/rules	2005-11-08 21:34:28 UTC (rev 1934)
@@ -8,9 +8,16 @@
 include /usr/share/dpatch/dpatch.make
 
 OCAML_LIB_DIR := $(shell ocamlc -where)
-FINDLIB_METAS := $(shell ls site-lib-src/)
+OCAMLABI := $(shell ocamlc -version)
+FINDLIB_METAS = $(shell ls site-lib-src/)
+IN_FILES := $(shell ls debian/*.in)
+GEN_FILES = $(patsubst %.in,%,$(IN_FILES))
 METAS_DIR = METAS
 
+init: $(GEN_FILES)
+%: %.in
+	sed -e 's/@OCamlABI@/$(OCAMLABI)/' $< > $@
+
 configure: configure-stamp
 configure-stamp: patch-stamp
 	dh_testdir
@@ -55,6 +62,9 @@
 
 	$(MAKE) install prefix=$(CURDIR)/debian/tmp
 	ln -fs "../topfind" $(CURDIR)/debian/tmp$(OCAML_LIB_DIR)/findlib/topfind
+	grep -v \\.opt debian/tmp/etc/ocamlfind.conf > debian/ocamlfind.conf.new
+	mv debian/ocamlfind.conf.new debian/tmp/etc/ocamlfind.conf
+
 	dh_install
 	# mv METAs from empty directories to the /META directory
 	for p in $(FINDLIB_METAS); do \
@@ -84,7 +94,7 @@
 	dh_fixperms
 	dh_installdeb
 	dh_shlibdeps
-	dh_gencontrol
+	dh_gencontrol -- -VF:OCamlABI="$(OCAMLABI)"
 	dh_md5sums
 	dh_builddeb
 




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