pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/converters/bibtex2html bibtex2html: build with current...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1566c22583a2
branches:  trunk
changeset: 406951:1566c22583a2
user:      markd <markd%pkgsrc.org@localhost>
date:      Tue Dec 31 19:46:12 2019 +0000

description:
bibtex2html: build with current ocaml

diffstat:

 converters/bibtex2html/Makefile                           |    4 +-
 converters/bibtex2html/distinfo                           |   19 +-
 converters/bibtex2html/patches/patch-bbl_lexer.mll        |   44 ++
 converters/bibtex2html/patches/patch-bib2bib.ml           |  286 ++++++++++++++
 converters/bibtex2html/patches/patch-bibfilter.ml         |   68 +++
 converters/bibtex2html/patches/patch-biboutput.ml         |   52 +-
 converters/bibtex2html/patches/patch-bibtex.ml            |  240 +++++++++++
 converters/bibtex2html/patches/patch-bibtex__lexer.mll    |  102 ++++-
 converters/bibtex2html/patches/patch-bibtex_parser.mly    |   78 +++
 converters/bibtex2html/patches/patch-condition.ml         |   70 +++-
 converters/bibtex2html/patches/patch-condition_parser.mly |   60 ++
 converters/bibtex2html/patches/patch-expand.ml            |   16 +
 converters/bibtex2html/patches/patch-latexmacros.ml       |   16 +
 converters/bibtex2html/patches/patch-main.ml              |   16 +
 converters/bibtex2html/patches/patch-readbib.ml           |   33 +
 converters/bibtex2html/patches/patch-translate.ml         |   91 ++++
 16 files changed, 1155 insertions(+), 40 deletions(-)

diffs (truncated from 1306 to 300 lines):

diff -r 3e2e4a34763c -r 1566c22583a2 converters/bibtex2html/Makefile
--- a/converters/bibtex2html/Makefile   Tue Dec 31 19:07:37 2019 +0000
+++ b/converters/bibtex2html/Makefile   Tue Dec 31 19:46:12 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.53 2019/08/11 13:18:09 wiz Exp $
+# $NetBSD: Makefile,v 1.54 2019/12/31 19:46:12 markd Exp $
 
 DISTNAME=      bibtex2html-1.98
 PKGREVISION=   14
@@ -33,6 +33,8 @@
 INSTALLATION_DIRS+=    bin ${PKGMANDIR}/man1
 INSTALLATION_DIRS+=    share/doc/${PKGBASE}
 
+MAKE_ENV+=     ZLIB=-unsafe-string
+
 .include "../../lang/ocaml/buildlink3.mk"
 
 post-build:
diff -r 3e2e4a34763c -r 1566c22583a2 converters/bibtex2html/distinfo
--- a/converters/bibtex2html/distinfo   Tue Dec 31 19:07:37 2019 +0000
+++ b/converters/bibtex2html/distinfo   Tue Dec 31 19:46:12 2019 +0000
@@ -1,9 +1,20 @@
-$NetBSD: distinfo,v 1.17 2018/03/14 08:28:44 dholland Exp $
+$NetBSD: distinfo,v 1.18 2019/12/31 19:46:12 markd Exp $
 
 SHA1 (bibtex2html-1.98.tar.gz) = daaa082885a30dae38263614565298d4862b8331
 RMD160 (bibtex2html-1.98.tar.gz) = f47dda14108c3f53bca64352bfb7455f1b79d964
 SHA512 (bibtex2html-1.98.tar.gz) = 7d8480ed87bef74a1e0c970446fba4d30b103df3e78f127a051efff875032ac7f52d3d6baab0c6a2fc67ca11f3d558d7be4439311934f99067993b5891ff6ad4
 Size (bibtex2html-1.98.tar.gz) = 92719 bytes
-SHA1 (patch-biboutput.ml) = 42d07071fd85fd1be47e522a4f957b53693d5b0d
-SHA1 (patch-bibtex__lexer.mll) = 207d8442dc87465cfed478d2d97445ba3bd90d9f
-SHA1 (patch-condition.ml) = f00078a8a16a6c47416e08b378d51db782f8e7f2
+SHA1 (patch-bbl_lexer.mll) = e63157f319825aad196f0628f04e1065e5f3cfa8
+SHA1 (patch-bib2bib.ml) = 37e8ac8e9f7453f304423dce25bd3b5481909aaf
+SHA1 (patch-bibfilter.ml) = 52f74806d12bd1d4838ac02ed1cce4a835f6cdc1
+SHA1 (patch-biboutput.ml) = 434f695c89aeeb4c6768d9d78502b5995aeb772c
+SHA1 (patch-bibtex.ml) = 4e68071f920d7d04b0fe8e40c3e5196d6a5742da
+SHA1 (patch-bibtex__lexer.mll) = 0e5ea0a0d0f3500a73635a9ddebad93175400027
+SHA1 (patch-bibtex_parser.mly) = dbd957eb6a47203baea103ef015583073128c1b7
+SHA1 (patch-condition.ml) = ff4cb8380df6f324554037ab4ae9d42d7fe28eb9
+SHA1 (patch-condition_parser.mly) = 7d44a5606c969fa1eb40ee1bc3f93ab8ae4e1c66
+SHA1 (patch-expand.ml) = d83740b76bbedb375519db2d2cd9d8458daa5ba8
+SHA1 (patch-latexmacros.ml) = a3beb18495de348246e7a8039838bab3d7c766e7
+SHA1 (patch-main.ml) = 3afed48b57d5858962f4b4bc5be15190014db41c
+SHA1 (patch-readbib.ml) = 888fbca4bad5c0597af1315b834574072ca005fb
+SHA1 (patch-translate.ml) = 222d3a9a1208e54fd54c1bc52ed784c59bf2a531
diff -r 3e2e4a34763c -r 1566c22583a2 converters/bibtex2html/patches/patch-bbl_lexer.mll
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/converters/bibtex2html/patches/patch-bbl_lexer.mll        Tue Dec 31 19:46:12 2019 +0000
@@ -0,0 +1,44 @@
+$NetBSD: patch-bbl_lexer.mll,v 1.1 2019/12/31 19:46:12 markd Exp $
+
+fixed compilation with recent versions of OCaml
+git commit 8f25afb95a839c9f9522a34013d5c905af14378b
+
+--- bbl_lexer.mll.orig 2014-07-04 07:51:21.000000000 +0000
++++ bbl_lexer.mll
+@@ -39,7 +39,7 @@ rule biblio_header = parse
+       { biblio_name lexbuf }
+   | eof
+       { raise End_of_file }
+-  | _ 
++  | _
+       { biblio_header lexbuf }
+ 
+ and biblio_name = parse
+@@ -48,15 +48,15 @@ and biblio_name = parse
+       let s = String.sub l 1 (String.length l - 2) in
+         Some s }
+   | _
+-      { None } 
++      { None }
+ 
+ and bibitem = parse
+   | "\\end{thebibliography}"
+       { raise End_of_biblio }
+   | '\\' ['a'-'z']* "bibitem"
+       { brace_depth := 0;
+-      begin try bibitem1 lexbuf 
+-            with Failure "lexing: empty token" -> opt_ref := None end;
++      begin try bibitem1 lexbuf
++            with Failure _ -> opt_ref := None end;
+         bibitem2 lexbuf }
+   | _ { bibitem lexbuf }
+ 
+@@ -70,7 +70,7 @@ and bibitem1_body = parse
+   | eof   { raise End_of_file }
+ 
+ and bibitem2 = parse
+-  | '{' { Buffer.reset buf; 
++  | '{' { Buffer.reset buf;
+         key := bibitem2_body lexbuf;
+         skip_end_of_line lexbuf;
+         Buffer.reset buf;
diff -r 3e2e4a34763c -r 1566c22583a2 converters/bibtex2html/patches/patch-bib2bib.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/converters/bibtex2html/patches/patch-bib2bib.ml   Tue Dec 31 19:46:12 2019 +0000
@@ -0,0 +1,286 @@
+$NetBSD: patch-bib2bib.ml,v 1.1 2019/12/31 19:46:12 markd Exp $
+
+fixed compilation with recent versions of OCaml 
+git commit 8f25afb95a839c9f9522a34013d5c905af14378b 
+
+--- bib2bib.ml.orig    2014-07-04 07:51:21.000000000 +0000
++++ bib2bib.ml
+@@ -33,10 +33,10 @@ let get_input_file_name f =
+ 
+ let condition = ref Condition.True
+ 
+-let add_condition c = 
++let add_condition c =
+   try
+     let c = Parse_condition.condition c in
+-    condition := if !condition = Condition.True then c 
++    condition := if !condition = Condition.True then c
+     else Condition.And(!condition,c)
+   with
+       Condition_lexer.Lex_error msg ->
+@@ -77,92 +77,92 @@ let args_spec =
+     ("-d", Arg.Set Options.debug, "debug flag");
+     ("-q", Arg.Set Options.quiet, "quiet flag");
+     ("--quiet", Arg.Set Options.quiet, "quiet flag");
+-    ("-s", Arg.String 
+-       (fun s -> sort_criteria := (String.lowercase s):: !sort_criteria),
++    ("-s", Arg.String
++       (fun s -> sort_criteria := (String.lowercase_ascii s):: !sort_criteria),
+      "<c> sort with respect to keys (if c=$key) or a given field <c>");
+     ("-r", Arg.Set reverse_sort,
+      "reverse the sort order");
+-    ("--no-comment", Arg.Unit (fun () -> no_comment := true), 
++    ("--no-comment", Arg.Unit (fun () -> no_comment := true),
+      "do not add extra comments at beginning");
+-    ("--remove", Arg.String 
+-       (fun s -> remove_fields := (String.lowercase s):: !remove_fields),
++    ("--remove", Arg.String
++       (fun s -> remove_fields := (String.lowercase_ascii s):: !remove_fields),
+           "<f> removes the field <f>");
+-    ("--rename", 
+-     Arg.Tuple 
++    ("--rename",
++     Arg.Tuple
+        [ Arg.Set_string rename_field ;
+-         Arg.String (fun s -> rename_fields := 
+-                       (String.lowercase !rename_field,
+-                        String.lowercase s):: !rename_fields)], 
++         Arg.String (fun s -> rename_fields :=
++                       (String.lowercase_ascii !rename_field,
++                        String.lowercase_ascii s):: !rename_fields)],
+        "<f1> <f2> rename field <f1> into <f2>");
+-    ("--expand", Arg.Unit (fun () -> expand_abbrevs := true), 
++    ("--expand", Arg.Unit (fun () -> expand_abbrevs := true),
+      "expand the abbreviations");
+-    ("--expand-xrefs", Arg.Unit (fun () -> expand_xrefs := true), 
++    ("--expand-xrefs", Arg.Unit (fun () -> expand_xrefs := true),
+      "expand the cross-references");
+-    ("--version", Arg.Unit (fun () -> Copying.banner "bib2bib"; exit 0), 
++    ("--version", Arg.Unit (fun () -> Copying.banner "bib2bib"; exit 0),
+      "print version and exit");
+-    ("--warranty", 
++    ("--warranty",
+      Arg.Unit (fun () -> Copying.banner "bib2bib"; Copying.copying(); exit 0),
+      "display software warranty")
+   ]
+ 
+-let output_cite_file keys = 
++let output_cite_file keys =
+   if !cite_output_file_name = "" then
+-    prerr_endline "No citation file output (no file name specified)" 
+-  else 
++    prerr_endline "No citation file output (no file name specified)"
++  else
+     try
+       let ch = open_out !cite_output_file_name in
+       KeySet.iter (fun k -> output_string ch (k ^ "\n")) keys;
+       close_out ch
+-    with 
++    with
+       Sys_error msg ->
+         prerr_endline ("Cannot write output citations file (" ^ msg ^ ")");
+         exit 1
+ 
+ 
+ 
+-let output_bib_file remove rename biblio keys = 
+-  try 
+-    let ch = 
+-      if !bib_output_file_name = "" 
+-      then stdout 
+-      else open_out !bib_output_file_name 
+-    in 
+-    let cmd = 
+-      List.fold_right 
+-      (fun s t -> 
+-         if String.contains s ' ' 
+-         then 
+-           if String.contains s '\'' 
+-           then " \"" ^ s ^ "\"" ^ t 
+-           else " '" ^ s ^ "'" ^ t 
+-         else " " ^ s ^ t) 
+-      (Array.to_list Sys.argv) 
+-      "" 
+-    in 
++let output_bib_file remove rename biblio keys =
++  try
++    let ch =
++      if !bib_output_file_name = ""
++      then stdout
++      else open_out !bib_output_file_name
++    in
++    let cmd =
++      List.fold_right
++      (fun s t ->
++         if String.contains s ' '
++         then
++           if String.contains s '\''
++           then " \"" ^ s ^ "\"" ^ t
++           else " '" ^ s ^ "'" ^ t
++         else " " ^ s ^ t)
++      (Array.to_list Sys.argv)
++      ""
++    in
+     let comments =
+       if !no_comment then empty_biblio else
+       add_new_entry
+       (Comment ("Command line:" ^ cmd))
+-      (add_new_entry 
+-         (Comment 
++      (add_new_entry
++         (Comment
+             ("This file has been generated by bib2bib "
+              ^ Version.version))
+          empty_biblio)
+     in
+     let biblio = merge_biblios comments biblio in
+-    Biboutput.output_bib ~remove ~rename ~html:false ch biblio keys;     
++    Biboutput.output_bib ~remove ~rename ~html:false ch biblio keys;
+     if !bib_output_file_name <> "" then close_out ch
+-  with Sys_error msg ->  
+-    prerr_endline ("Cannot write output bib file (" ^ msg ^ ")"); 
+-    exit 1 
++  with Sys_error msg ->
++    prerr_endline ("Cannot write output bib file (" ^ msg ^ ")");
++    exit 1
+ 
+ 
+-let output_php_file remove rename biblio keys = 
++let output_php_file remove rename biblio keys =
+   if !php_output_file_name <> "" then
+     try
+       let ch = open_out !php_output_file_name in
+       output_string ch "<?php
+-$parsed_bibfile = 
++$parsed_bibfile =
+ Array
+ (
+ ";
+@@ -175,13 +175,13 @@ Array
+     with Biboutput.Bad_input_for_php msg ->
+       eprintf "error while producing PHP output: %s\n" msg;
+       exit 2
+-      
++
+ 
+ let rec make_compare_fun db criteria c1 c2 =
+   match criteria with
+-    | [] -> 0 
++    | [] -> 0
+     | field :: rem ->
+-      let comp = 
++      let comp =
+         match field with
+           | "$key"  ->
+               begin
+@@ -198,12 +198,12 @@ let rec make_compare_fun db criteria c1
+                       compare s1 s2
+                   | _ -> 0
+               end
+-          | "$date" -> 
++          | "$date" ->
+               begin
+                 match (c1,c2) with
+                   | (Entry(s1,t1,l1),Entry(s2,t2,l2)) ->
+-                      Expand.date_compare db 
+-                        (s1,t1,Expand.expand_fields l1) 
++                      Expand.date_compare db
++                        (s1,t1,Expand.expand_fields l1)
+                         (s2,t2,Expand.expand_fields l2)
+                   | _ -> 0
+               end
+@@ -211,8 +211,8 @@ let rec make_compare_fun db criteria c1
+               begin
+                 match (c1,c2) with
+                   | (Entry(_,_,l1),Entry(_,_,l2)) ->
+-                      let s1 = 
+-                        try 
++                      let s1 =
++                        try
+                           match List.assoc field l1 with
+                             | [Bibtex.String(s)] -> s
+                             | [Bibtex.Id(s)] -> s



Home | Main Index | Thread Index | Old Index