pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/print/advi Make print/advi build again.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ddae1ffb10d3
branches:  trunk
changeset: 771779:ddae1ffb10d3
user:      dholland <dholland%pkgsrc.org@localhost>
date:      Mon Dec 27 00:49:02 2021 +0000

description:
Make print/advi build again.

diffstat:

 print/advi/Makefile                       |  10 ++++-
 print/advi/distinfo                       |  12 +++++-
 print/advi/patches/patch-src_Makefile.in  |  27 +++++++++++--
 print/advi/patches/patch-src_drawimage.ml |  48 ++++++++++++++++++++++++
 print/advi/patches/patch-src_dvi.ml       |  18 +++++++++
 print/advi/patches/patch-src_glyph.ml     |  30 +++++++++++++++
 print/advi/patches/patch-src_grdev.ml     |  21 ++++++++++
 print/advi/patches/patch-src_gterm.ml     |  60 +++++++++++++++++++++++++++++++
 print/advi/patches/patch-src_input.ml     |  18 +++++++++
 print/advi/patches/patch-src_pkfont.ml    |  41 +++++++++++++++++++++
 print/advi/patches/patch-src_ttfont.ml    |  33 +++++++++++++++++
 11 files changed, 310 insertions(+), 8 deletions(-)

diffs (truncated from 382 to 300 lines):

diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/Makefile
--- a/print/advi/Makefile       Sun Dec 26 23:54:01 2021 +0000
+++ b/print/advi/Makefile       Mon Dec 27 00:49:02 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.137 2021/12/08 16:06:11 adam Exp $
+# $NetBSD: Makefile,v 1.138 2021/12/27 00:49:02 dholland Exp $
 
 DISTNAME=              advi-1.10.2
 PKGREVISION=           53
@@ -30,6 +30,14 @@
 GNU_CONFIGURE_LIBDIR=  ${PREFIX}/share/texmf-dist
 CONFIGURE_ARGS+=       --with-gs=${PREFIX}/bin/gs
 
+GRAPHICS_PREFIX=       ${BUILDLINK_PREFIX.ocaml-graphics}
+GRAPHICS_DIR=          ${GRAPHICS_PREFIX}/lib/ocaml/site-lib/graphics
+MAKE_ENV+=             OCAMLGRAPHICS_INCLUDES=-I\ ${GRAPHICS_DIR}
+# For reasons best known to itself the preexisting makefiles already include
+# the library but not the includes.
+#MAKE_ENV+=            OCAMLGRAPHICS_LIBS_BYTE=${GRAPHICS_DIR}/graphics.cma
+#MAKE_ENV+=            OCAMLGRAPHICS_LIBS_NATIVE=${GRAPHICS_DIR}/graphics.cmxa
+
 INSTALL_UNSTRIPPED=    yes
 
 SUBST_CLASSES+=                gs
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/distinfo
--- a/print/advi/distinfo       Sun Dec 26 23:54:01 2021 +0000
+++ b/print/advi/distinfo       Mon Dec 27 00:49:02 2021 +0000
@@ -1,7 +1,15 @@
-$NetBSD: distinfo,v 1.13 2021/10/26 11:12:02 nia Exp $
+$NetBSD: distinfo,v 1.14 2021/12/27 00:49:02 dholland Exp $
 
 BLAKE2s (advi-1.10.2.tar.gz) = 93641026540c5820f9ecc94b7874dd8353a1ecbf9cae162d35fae561a483622f
 SHA512 (advi-1.10.2.tar.gz) = 93479e22261019b571bc331604a659e4e58200284bcdd63929b2c7ab07f8e9fabbd120f8876081a36e7e09e08286eeba9a45f3b077b545a9e404060622ec45c8
 Size (advi-1.10.2.tar.gz) = 9772060 bytes
 SHA1 (patch-doc_pngs_Makefile.in) = 3141938a6433d4dab8d7247ae89ad3381d902372
-SHA1 (patch-src_Makefile.in) = 3f9be7ac0c4a98b3e36c383ed2489b0d71e73f8a
+SHA1 (patch-src_Makefile.in) = 57c725715075697b12d61df2aaf598c8964f2e37
+SHA1 (patch-src_drawimage.ml) = edbb86f69f034d6b5f1d4dba936c74a51a1c7e0a
+SHA1 (patch-src_dvi.ml) = 2adfe109dcdbc5d8449d318e500015bb8a87cdf6
+SHA1 (patch-src_glyph.ml) = 186993579b52da03944be40f86ce87990d5eefc4
+SHA1 (patch-src_grdev.ml) = 96eb2c162a9aa8e4bb36a2c93cdc20d385dbf98f
+SHA1 (patch-src_gterm.ml) = 514f5bf9fc3ea1579a6e990f998e8536af85b1b7
+SHA1 (patch-src_input.ml) = 2b896cfb700cb63fcf1688116a43492e81fd09e8
+SHA1 (patch-src_pkfont.ml) = dcdb0aaaee33acbc1ab40a4f92d8a8e7c376058c
+SHA1 (patch-src_ttfont.ml) = e15a108630f690dac092751b7850686510e5cf6b
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_Makefile.in
--- a/print/advi/patches/patch-src_Makefile.in  Sun Dec 26 23:54:01 2021 +0000
+++ b/print/advi/patches/patch-src_Makefile.in  Mon Dec 27 00:49:02 2021 +0000
@@ -1,10 +1,27 @@
-$NetBSD: patch-src_Makefile.in,v 1.3 2015/01/24 03:55:34 mef Exp $
+$NetBSD: patch-src_Makefile.in,v 1.4 2021/12/27 00:49:02 dholland Exp $
 
-Fix build with modular Xorg.1.2
+Fix build with modular Xorg.1.2 (link with X_LIBS and honor LDFLAGS)
+
+Hack ocaml-graphics paths into the build. The makefiles date from when
+it was part of the ocaml stdlib.
 
---- src/Makefile.in.orig       2011-08-07 14:43:38.000000000 +0000
-+++ src/Makefile.in    2011-08-07 14:44:05.000000000 +0000
-@@ -624,7 +624,7 @@
+--- src/Makefile.in.orig       2011-09-27 07:45:41.000000000 +0000
++++ src/Makefile.in
+@@ -292,10 +292,10 @@ OCAMLBYTOBJS = $(OCAMLBUILTSOURCES:.ml=.
+ OCAMLOPTOBJS = $(OCAMLBUILTSOURCES:.ml=.cmx) $(OCAMLSOURCES:.ml=.cmx)
+ COBJS = $(CSOURCES:.c=.o)
+ AM_CFLAGS = $(XINERAMA_CFLAGS) $(X_CFLAGS)
+-AM_OCAMLCFLAGS = $(CAMLIMAGES_INCLUDES)
++AM_OCAMLCFLAGS = $(CAMLIMAGES_INCLUDES) $(OCAMLGRAPHICS_INCLUDES)
+ OTHER_LIBS = unix str 
+-OCAMLLIBS_OPT = $(CAMLIMAGES_LIBS_NATIVE) $(OTHER_LIBS:=.cmxa)
+-OCAMLLIBS_BYT = $(CAMLIMAGES_LIBS_BYTE) $(OTHER_LIBS:=.cma)
++OCAMLLIBS_OPT = $(CAMLIMAGES_LIBS_NATIVE) $(OCAMLGRAHPICS_LIBS_NATIVE) $(OTHER_LIBS:=.cmxa)
++OCAMLLIBS_BYT = $(CAMLIMAGES_LIBS_BYTE) $(OCAMLGRAPHICS_LIBS_BYTE) $(OTHER_LIBS:=.cma)
+ 
+ # In bytecode mode create stubcode in dlladvi
+ DLLADVI = dlladvi.so
+@@ -624,7 +624,7 @@ dlladvi.so: $(COBJS) Makefile
        $(OCAMLMKLIB) -o advi \
                $(OCAMLCFLAGS) $(AM_OCAMLCFLAGS) $(AM_LINKFLAGS) \
                $(COBJS) \
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_drawimage.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_drawimage.ml Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-src_drawimage.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/drawimage.ml~  2007-01-18 14:14:35.000000000 +0000
++++ src/drawimage.ml
+@@ -161,10 +161,20 @@ let after f g = try let x = f () in  g (
+ 
+ let cache_path file whitetransp psbbox ratiopt antialias (w, h) =
+   let file' = Userfile.fullpath (Unix.getcwd ()) file in
++(*
+   let file' = if file == file' then String.copy file' else file' in
+   for i = 0 to String.length file' - 1 do
+     if file'.[i] = '/' then file'.[i] <- '-'
+   done;
++*)
++  let file' =
++     let f i =
++        match String.get file' i with
++        | '/' -> '-'
++        | c -> c
++     in
++     String.init (String.length file') f
++  in
+   let geom_string x =
+     if x >= 0 then "+" ^ string_of_int x else string_of_int x
+   in
+@@ -206,9 +216,9 @@ let cache_path file whitetransp psbbox r
+ let cache_load file =
+   debugs ("cache_load " ^ file);
+   let load ic =
+-    let s = String.create (String.length cache_key) in
++    let s = Bytes.create (String.length cache_key) in
+     ignore (input ic s 0 (String.length cache_key));
+-    if s <> cache_key then failwith (file ^ " has no proper header");
++    if Bytes.to_string s <> cache_key then failwith (file ^ " has no proper header");
+     let rgba = input_value ic in (* bool *)
+     let width = input_value ic in
+     let height = input_value ic in
+@@ -237,7 +247,7 @@ let cache_load file =
+ let cache_save file img =
+   debugs ("cache_save " ^ file);
+   let save oc =
+-    output oc cache_key 0 (String.length cache_key);
++    output oc (Bytes.of_string cache_key) 0 (String.length cache_key);
+     match img with
+     | Rgba32 image ->
+         output_value oc true;
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_dvi.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_dvi.ml       Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_dvi.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/dvi.ml~        2010-04-05 08:15:06.000000000 +0000
++++ src/dvi.ml
+@@ -363,9 +363,9 @@ let input_int32 =
+   | _ -> assert false;;
+ 
+ let input_string ch len =
+-  let str = String.create len in
++  let str = Bytes.create len in
+   really_input ch str 0 len ;
+-  str;;
++  Bytes.to_string str;;
+ 
+ (*** Parsing commands ***)
+ 
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_glyph.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_glyph.ml     Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-src_glyph.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/glyph.ml~      2007-01-18 14:14:36.000000000 +0000
++++ src/glyph.ml
+@@ -61,7 +61,7 @@ let from_char_def cdef ratio =
+   and hot_row = cdef.Font.voffset in
+   let (ncols', hot_col', col_table) = make_table ncols hot_col ratio
+   and (nrows', hot_row', row_table) = make_table nrows hot_row ratio in
+-  let graymap = String.create (ncols' * nrows')
++  let graymap = Bytes.create (ncols' * nrows')
+   and index = ref 0
+   and fact = 256.0 *. ratio *. ratio
+   and last_col = ncols - 1
+@@ -92,7 +92,7 @@ let from_char_def cdef ratio =
+       done
+       done ;
+       let gray = Misc.round (!sum *. fact) in
+-      graymap.[!index] <- Char.chr (max 0 (min gray 255)) ;
++      Bytes.set graymap !index (Char.chr (max 0 (min gray 255))) ;
+       incr index
+     done
+   done ;
+@@ -100,4 +100,4 @@ let from_char_def cdef ratio =
+     height = nrows' ;
+     hoffset = hot_col' ;
+     voffset = hot_row' ;
+-    graymap = graymap } ;;
++    graymap = Bytes.to_string graymap } ;;
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_grdev.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_grdev.ml     Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,21 @@
+$NetBSD: patch-src_grdev.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/grdev.ml~      2011-08-05 08:24:17.000000000 +0000
++++ src/grdev.ml
+@@ -169,12 +169,12 @@ let inputp fdins = 
+   | _, _, _ -> true
+ 
+ let get_input () =
+-  let buf = String.create 1 in
++  let buf = Bytes.create 1 in
+   if inputp [ Unix.stdin ] then
+     let _ = Unix.read Unix.stdin buf 0 1 in 
+     if inputp [ Unix.stdin ] then () 
+     else clear_usr2();
+-    buf.[0]
++    Bytes.get buf 0
+   else assert false;;
+ 
+ let watch_file_check () = 
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_gterm.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_gterm.ml     Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,60 @@
+$NetBSD: patch-src_gterm.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/gterm.ml~      2007-01-18 14:14:36.000000000 +0000
++++ src/gterm.ml
+@@ -28,7 +28,7 @@ type rectangle = GraphicsY11.rectangle =
+ 
+ type term = {
+   (* Character contents of the terminal. *)
+-  mutable lines : string array;
++  mutable lines : Bytes.t array;
+   (* Height in lines. *)
+   mutable height : int;
+   (* Width in characters. *)
+@@ -71,7 +71,7 @@ let draw_cursor t cc cf =
+   let gx = cursor_gx t
+   and gy = cursor_gy t in 
+   Graphics.fill_rect gx gy t.font_size_x t.font_size_y;
+-  let c = t.lines.(t.cursor_y).[t.cursor_x] in
++  let c = Bytes.get t.lines.(t.cursor_y) t.cursor_x in
+   Graphics.moveto gx gy;
+   Graphics.set_color cf;
+   Graphics.draw_char c;
+@@ -147,7 +147,7 @@ let redraw t =
+   Array.iteri
+    (fun i s ->
+       Graphics.moveto t.gx (t.gy + t.font_size_y * i);
+-      Graphics.draw_string s)
++      Graphics.draw_string (Bytes.to_string s)) (* XXX: slow? *)
+    t.lines;
+   show_cursor t;;
+ 
+@@ -156,7 +156,7 @@ let clear t =
+   Graphics.fill_rect
+     t.gx t.gy (t.width * t.font_size_x) (t.height * t.font_size_y);
+   Graphics.set_color t.foreground_color;
+-  Array.iter (fun s -> String.fill s 0 (String.length s) ' ') t.lines;
++  Array.iter (fun s -> Bytes.fill s 0 (Bytes.length s) ' ') t.lines;
+   htab t 0;
+   vtab t (t.height - 1);;
+ 
+@@ -223,7 +223,7 @@ let make_term_gen fg bg bw bwc tc cc xc 
+   if h < 1 || w < 1 || bw < 0 then failwith "make_term_gen" else
+   let font_size_x, font_size_y = Graphics.text_size "M" in
+   let t = {
+-    lines = Array.init h (fun i -> String.make w ' ');
++    lines = Array.init h (fun i -> Bytes.make w ' ');
+     height = h;
+     width = w;
+     gheight = h * font_size_y;
+@@ -305,7 +305,7 @@ let make_term =
+ (* Basic functions to edit. *)
+ let end_of_line t =
+   let line = t.lines.(t.cursor_y) in
+-  let l = String.length line in
++  let l = Bytes.length line in
+   htab t l;;
+ 
+ let beginning_of_line t = htab t 0;;
diff -r 5ec808dd8e55 -r ddae1ffb10d3 print/advi/patches/patch-src_input.ml
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/print/advi/patches/patch-src_input.ml     Mon Dec 27 00:49:02 2021 +0000
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_input.ml,v 1.1 2021/12/27 00:49:02 dholland Exp $
+
+Hack up the code for immutable strings.
+
+--- src/input.ml~      2007-01-18 14:14:36.000000000 +0000
++++ src/input.ml
+@@ -84,9 +84,9 @@ let input_int32 =
+       (Printf.sprintf "Pkfont: cannot work on a %d-bit architecture" size) ;;
+ 
+ let input_string ch n =
+-  let str = String.create n in
++  let str = Bytes.create n in
+   really_input ch str 0 n ;
+-  str ;;
++  Bytes.to_string str ;;
+ 
+ let skip_bytes ch n =
+   seek_in ch (pos_in ch + n) ;;



Home | Main Index | Thread Index | Old Index