pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/textproc/harmony Fix build with ocaml 4.06. Use ocaml ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4449885dd8f6
branches:  trunk
changeset: 377194:4449885dd8f6
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Wed Mar 14 06:27:21 2018 +0000

description:
Fix build with ocaml 4.06. Use ocaml infrastructure.
Use pkgsrc ocaml-csv instead of severely outdated included copy.

Note: there's a new(er) upstream version, from 2008 instead of 2006,
but I'm having problems building it. If anyone uses this and is
interested in the update, let me know.

diffstat:

 textproc/harmony/Makefile                                        |  25 +-
 textproc/harmony/distinfo                                        |  11 +-
 textproc/harmony/patches/patch-Top.Makefile                      |  48 +++++
 textproc/harmony/patches/patch-examples_addresses_Makefile       |  27 +++
 textproc/harmony/patches/patch-extern_Makefile                   |  15 +
 textproc/harmony/patches/patch-extern_iCalendar_iCalendar.ml     |  34 ++++
 textproc/harmony/patches/patch-extern_iCalendar_iCalendarlex.mll |  57 ++++++
 textproc/harmony/patches/patch-src_Makefile                      |  35 ++++
 textproc/harmony/patches/patch-src_baker.ml                      |  22 ++
 textproc/harmony/patches/patch-src_misc.ml                       |  83 ++++++++++
 textproc/harmony/patches/patch-src_toplevel.ml                   |  15 +
 11 files changed, 361 insertions(+), 11 deletions(-)

diffs (truncated from 447 to 300 lines):

diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/Makefile
--- a/textproc/harmony/Makefile Wed Mar 14 02:11:04 2018 +0000
+++ b/textproc/harmony/Makefile Wed Mar 14 06:27:21 2018 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2018/01/10 16:53:13 jaapb Exp $
+# $NetBSD: Makefile,v 1.24 2018/03/14 06:27:21 dholland Exp $
 #
 
 DISTNAME=      harmony-stable-${VERSION}
@@ -11,23 +11,26 @@
 HOMEPAGE=      https://alliance.seas.upenn.edu/~harmony/
 COMMENT=       Reconciles disconnected updates to heterogeneous, replicated XML data
 
-MAKE_JOBS_SAFE=        no
+VERSION=       20060526
+
+WRKSRC=                        ${WRKDIR}/harmony-nightly-${VERSION}
+USE_TOOLS+=            gmake
+OCAML_USE_FINDLIB=     yes
+MAKE_JOBS_SAFE=                no
+TEST_TARGET=           test
 
 BUILD_DEPENDS+=        dvipsk-[0-9]*:../../print/dvipsk
 BUILD_DEPENDS+=        tex-bibtex-[0-9]*:../../print/tex-bibtex
 BUILD_DEPENDS+=        tex-latex-bin-[0-9]*:../../print/tex-latex-bin
 BUILD_DEPENDS+=        tex-preprint-[0-9]*:../../print/tex-preprint
 BUILD_DEPENDS+=        tex-psnfss-[0-9]*:../../fonts/tex-psnfss
-DEPENDS+=      ocaml-findlib-[0-9]*:../../devel/ocaml-findlib
 DEPENDS+=      pxp-[0-9]*:../../textproc/pxp
 
-VERSION=20060526
+INSTALLATION_DIRS=     bin share/doc/harmony
 
-WRKSRC=                ${WRKDIR}/harmony-nightly-${VERSION}
-USE_TOOLS+=    gmake
-TEST_TARGET=   test
-
-INSTALLATION_DIRS=     bin share/doc/harmony
+# remove obsolete included copy of textproc/ocaml-csv
+post-extract:
+       ${RM} -rf ${WRKSRC}/extern/ocaml-csv-1.0.3
 
 do-install:
        for file in src/harmony \
@@ -44,7 +47,9 @@
        ${INSTALL_DATA} ${WRKSRC}/doc/manual.pdf ${DESTDIR}${PREFIX}/share/doc/harmony
        ${INSTALL_DATA} ${WRKSRC}/doc/main.pdf ${DESTDIR}${PREFIX}/share/doc/harmony
 
-.include "../../lang/ocaml/buildlink3.mk"
+.include "../../mk/ocaml.mk"
+
 .include "../../devel/pcre-ocaml/buildlink3.mk"
 .include "../../net/ocamlnet/buildlink3.mk"
+.include "../../textproc/ocaml-csv/buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/distinfo
--- a/textproc/harmony/distinfo Wed Mar 14 02:11:04 2018 +0000
+++ b/textproc/harmony/distinfo Wed Mar 14 06:27:21 2018 +0000
@@ -1,6 +1,15 @@
-$NetBSD: distinfo,v 1.2 2015/11/04 01:59:30 agc Exp $
+$NetBSD: distinfo,v 1.3 2018/03/14 06:27:21 dholland Exp $
 
 SHA1 (harmony-stable-20060526.tar.gz) = c6f146af672bc6be6f598fd48321283a6c0aeaf0
 RMD160 (harmony-stable-20060526.tar.gz) = a5014ed431057cc9e8bd36dac62d4031e5b5b4eb
 SHA512 (harmony-stable-20060526.tar.gz) = a4dc20db191ade1c2117005ec3bfb59890bececa7d4871e0d506b806f6cd42bbf3c70b920a8e947019b1d448d7bdb140cb407a852f46c0d460236d479f4a87ee
 Size (harmony-stable-20060526.tar.gz) = 777608 bytes
+SHA1 (patch-Top.Makefile) = b4c32f3de16a16195ee8a8142b21a962a97be899
+SHA1 (patch-examples_addresses_Makefile) = d7e2c0fa0f90048fa01ee5842d1323f7783cd20d
+SHA1 (patch-extern_Makefile) = 9f199932b21abdc482b10e7dd85448c05fb352b0
+SHA1 (patch-extern_iCalendar_iCalendar.ml) = 78f5f4eeed096fcac068d71b0977d86f73325cdc
+SHA1 (patch-extern_iCalendar_iCalendarlex.mll) = df77063fd3abf27d2138dcdf05937c2a1f62d8c6
+SHA1 (patch-src_Makefile) = 9e40c29547e06d4791a7ff1aee36c9c483e2dfb8
+SHA1 (patch-src_baker.ml) = 0d5706df766430bd302da70c98a2c94353be13d8
+SHA1 (patch-src_misc.ml) = 70661f3c34f46d1bec116b53908b2df52b95ae11
+SHA1 (patch-src_toplevel.ml) = e62169b0dc0134c873818fa756f973c0467b625f
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-Top.Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-Top.Makefile       Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-Top.Makefile,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Fix energizer-bunny-makefiles.
+Eliminate references to included ocaml-csv; use the pkgsrc one.
+
+--- Top.Makefile.orig  2006-05-21 17:18:37.000000000 +0000
++++ Top.Makefile
+@@ -48,15 +48,15 @@ OCAMLFIND_COMMANDS=$(foreach c,ocamlc oc
+ 
+ OCAMLMAKEFILE = $(SRCDIR)/OCamlMakefile
+ 
+-PACKS = "netstring,unix,str,pxp,pxp-engine,pxp-lex-utf8" 
++PACKS = "netstring,unix,str,pxp,pxp-engine,pxp-lex-utf8,csv" 
+ YFLAGS = -v 
+ OCAMLFLAGS = -dtypes -rectypes
+ OCAMLCPFLAGS = f
+ 
+ LIBS += csv 
+ 
+-LIBDIRS = $(SRCDIR) $(SRCDIR)/ubase $(EXTERNDIR)/ocaml-csv-1.0.3
+-INCDIRS = $(SRCDIR) $(SRCDIR)/ubase $(EXTERNDIR)/ocaml-csv-1.0.3
++LIBDIRS = $(SRCDIR) $(SRCDIR)/ubase
++INCDIRS = $(SRCDIR) $(SRCDIR)/ubase
+ 
+ 
+ $(SRCDIR)/harmony.cmxa: 
+@@ -104,12 +104,12 @@ clean:: tidy
+       rm -rf *.aux *.bbl *.blg *.log *.dvi TAGS *.cmo *.cmi *.cmx *.o 
+       @for i in $(SUBDIRS) $(SUBDIRSCLEANONLY); do \
+           echo "###### cleaning $(CWD)/$$i ######"; \
+-          $(MAKE) -C $$i clean; done
++          $(MAKE) -C $$i clean || exit 1; done
+ 
+ buildsubdirs:
+       @for i in $(SUBDIRS); do \
+           echo "###### Building $(CWD)/$$i ######"; \
+-          $(MAKE) -C $$i; done
++          $(MAKE) -C $$i || exit 1; done
+ 
+ 
+ tidy::
+@@ -154,5 +154,5 @@ buildtags:
+ 
+ # Benjamin, please include things like this in your ~/.harmony.mk file instead :-)
+ #
+-# export BCPDEPFLAGS = -I $(SRCDIR) -I $(SRCDIR)/ubase $(EXTERNDIR)/ocaml-csv-1.0.3
++# export BCPDEPFLAGS = -I $(SRCDIR) -I $(SRCDIR)/ubase
+ #
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-examples_addresses_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-examples_addresses_Makefile        Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,27 @@
+$NetBSD: patch-examples_addresses_Makefile,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Eliminate references to included ocaml-csv; use the pkgsrc one.
+
+--- examples/addresses/Makefile~       2006-05-21 19:17:46.000000000 +0000
++++ examples/addresses/Makefile
+@@ -54,7 +54,6 @@ test4:: buildharmony
+       ../../extern/pilot-link-0.12.0-pre4/src/pilot-addresses --read=a.csv -a
+ 
+ test5:: 
+-      $(MAKE) -C ../../extern/ocaml-csv-1.0.3
+       $(MAKE) buildharmony 
+       echo 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21 > temp.csv
+       sed 1,1d < sample.csv >> temp.csv
+@@ -62,12 +61,10 @@ test5:: 
+       cat sampleout.csv
+ 
+ test6:: 
+-      $(MAKE) -C ../../extern/ocaml-csv-1.0.3
+       $(MAKE) buildharmony 
+       $(HARMONY) get -lens Prelude.id -concrete sample.csv -output -:meta
+ 
+ test7:: 
+-      $(MAKE) -C ../../extern/ocaml-csv-1.0.3
+       $(MAKE) buildharmony 
+       echo 01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21 > temp.csv
+       sed 1,1d < sample.csv >> temp.csv
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-extern_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-extern_Makefile    Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-extern_Makefile,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Eliminate references to included ocaml-csv; use the pkgsrc one.
+
+--- extern/Makefile~   2006-05-22 20:17:32.000000000 +0000
++++ extern/Makefile
+@@ -7,7 +7,7 @@
+ 
+ TOP = ..
+ include $(TOP)/Top.Makefile
+-SUBDIRSCLEANONLY = iCalendar ocaml-csv-1.0.3
++SUBDIRSCLEANONLY = iCalendar
+ 
+ all:
+ 
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-extern_iCalendar_iCalendar.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-extern_iCalendar_iCalendar.ml      Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,34 @@
+$NetBSD: patch-extern_iCalendar_iCalendar.ml,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- extern/iCalendar/iCalendar.ml~     2006-05-21 19:17:46.000000000 +0000
++++ extern/iCalendar/iCalendar.ml
+@@ -1,13 +1,13 @@
+ let read get_char =
+   let lex_func s n =
+-    let l = String.length s in
++    let l = Bytes.length s in
+     let cur_pos = ref 0 in
+     let nb_chars () = !cur_pos in
+     let should_stop () = (n - !cur_pos) < 3 in (* enough to put \r\n c*)
+     let store_string_char c =
+       if !cur_pos >= l then failwith "string given by lexbuf is too short !"
+       else begin
+-        String.unsafe_set s (!cur_pos) c;
++        Bytes.unsafe_set s (!cur_pos) c;
+         incr cur_pos
+       end
+     in
+@@ -102,9 +102,9 @@ let chars_from_str inc =
+ 
+ let read_file inc =
+   let len = in_channel_length inc in
+-  let buf = String.create len in
++  let buf = Bytes.create len in
+   really_input inc buf 0 len;
+-  buf
++  Bytes.to_string buf
+ 
+ let iCalReader inc outc =
+   let s = V.string_of_t (Ical.view_from_icalendar (read (chars_from_str inc))) in
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-extern_iCalendar_iCalendarlex.mll
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-extern_iCalendar_iCalendarlex.mll  Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,57 @@
+$NetBSD: patch-extern_iCalendar_iCalendarlex.mll,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Fix build with ocaml 4.06.
+
+--- extern/iCalendar/iCalendarlex.mll~ 2006-05-21 19:17:46.000000000 +0000
++++ extern/iCalendar/iCalendarlex.mll
+@@ -11,7 +11,7 @@
+ (* To buffer string literals *)
+ 
+ let string_start_pos = ref 0;;
+-let initial_string_buffer = String.create 256
++let initial_string_buffer = Bytes.create 256
+ let string_buff = ref initial_string_buffer
+ let string_index = ref 0
+ 
+@@ -20,32 +20,32 @@ let reset_string_buffer () =
+   string_index := 0
+ 
+ let store_string_char c =
+-  if !string_index >= String.length (!string_buff) then begin
+-    let new_buff = String.create (String.length (!string_buff) * 2) in
+-      String.blit (!string_buff) 0 new_buff 0 (String.length (!string_buff));
++  if !string_index >= Bytes.length (!string_buff) then begin
++    let new_buff = Bytes.create (Bytes.length (!string_buff) * 2) in
++      Bytes.blit (!string_buff) 0 new_buff 0 (Bytes.length (!string_buff));
+       string_buff := new_buff
+   end;
+-  String.unsafe_set (!string_buff) (!string_index) c;
++  Bytes.unsafe_set (!string_buff) (!string_index) c;
+   incr string_index
+ 
+ let store_string s =
+   let l = String.length s in
+-  if !string_index + l > String.length (!string_buff) then begin
+-    let new_buff = String.create ((String.length (!string_buff) + l) * 2) in
+-      String.blit (!string_buff) 0 new_buff 0 (String.length (!string_buff));
++  if !string_index + l > Bytes.length (!string_buff) then begin
++    let new_buff = Bytes.create ((Bytes.length (!string_buff) + l) * 2) in
++      Bytes.blit (!string_buff) 0 new_buff 0 (Bytes.length (!string_buff));
+       string_buff := new_buff
+   end;
+   String.blit s 0 (!string_buff) (!string_index) l;
+   string_index := (!string_index) + l
+ 
+ let get_stored_string () =
+-  let s = String.sub (!string_buff) 0 (!string_index) in
++  let s = Bytes.sub (!string_buff) 0 (!string_index) in
+   string_buff := initial_string_buffer;
+   (*
+   print_endline s;
+   flush stdout;
+   *)
+-  s
++  Bytes.to_string s
+ }
+ 
+ let eol = "\r\n" | "\n"
diff -r c49566b96e9f -r 4449885dd8f6 textproc/harmony/patches/patch-src_Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/textproc/harmony/patches/patch-src_Makefile       Wed Mar 14 06:27:21 2018 +0000
@@ -0,0 +1,35 @@
+$NetBSD: patch-src_Makefile,v 1.1 2018/03/14 06:27:21 dholland Exp $
+
+Eliminate references to included ocaml-csv; use the pkgsrc one.
+
+--- src/Makefile.orig  2006-05-15 09:18:42.000000000 +0000
++++ src/Makefile
+@@ -26,24 +26,17 @@ tags:
+ # EXTERNAL TOOLS AND LIBS #
+ ###########################
+ 
+-all: $(SRCDIR)/bakery.ml \
+-     $(EXTERNDIR)/ocaml-csv-1.0.3/csv.cmxa \
++all: $(SRCDIR)/bakery.ml
+ 
+-native-code: $(EXTERNDIR)/ocaml-csv-1.0.3/csv.cmxa\
++native-code:
+ 
+-native-code-library: $(EXTERNDIR)/ocaml-csv-1.0.3/csv.cmxa\
++native-code-library:
+ 



Home | Main Index | Thread Index | Old Index