git: b8aceeb60194 - main - print/tex-luatex: Avoid mixing libc++ and libstdc++, and don't use -fcommon
Dimitry Andric
dim at FreeBSD.org
Thu May 6 21:29:53 UTC 2021
The branch main has been updated by dim (src committer):
URL: https://cgit.FreeBSD.org/ports/commit/?id=b8aceeb60194bcd8f8caf6789193c46271d3480e
commit b8aceeb60194bcd8f8caf6789193c46271d3480e
Author: Dimitry Andric <dim at FreeBSD.org>
AuthorDate: 2021-05-06 21:29:24 +0000
Commit: Dimitry Andric <dim at FreeBSD.org>
CommitDate: 2021-05-06 21:29:24 +0000
print/tex-luatex: Avoid mixing libc++ and libstdc++, and don't use -fcommon
This port was not respecting the CC and CXX variables, thus it could
pick up gcc and g++ instead, and that would cause mixups between
libstdc++ (which is preferred by gcc) and libc++ (which is in base),
ultimately leading to link errors.
Also, the port uses a very old version of tex so it suffers from a few
-fno-common issues, mostly variables that have been declared without an
'extern' specifier. Add a few patches to fix these.
Appproved by: maintainer timeout
PR: 234221
MFH: 2021Q2
---
print/tex-luatex/Makefile | 8 +++-----
print/tex-luatex/files/patch-luatexdir_font_luatexfont.h | 11 +++++++++++
print/tex-luatex/files/patch-luatexdir_image_writeimg.h | 11 +++++++++++
print/tex-luatex/files/patch-luatexdir_image_writeimg.w | 11 +++++++++++
print/tex-luatex/files/patch-luatexdir_pdf_pdftables.h | 11 +++++++++++
print/tex-luatex/files/patch-luatexdir_tex_textoken.w | 11 +++++++++++
6 files changed, 58 insertions(+), 5 deletions(-)
diff --git a/print/tex-luatex/Makefile b/print/tex-luatex/Makefile
index 2170772f1dd4..5ef297e9fae9 100644
--- a/print/tex-luatex/Makefile
+++ b/print/tex-luatex/Makefile
@@ -1,6 +1,6 @@
PORTNAME= luatex
PORTVERSION= 0.80.0
-PORTREVISION= 23
+PORTREVISION= 24
CATEGORIES= print
MASTER_SITES= ftp://tug.org/historic/systems/texlive/2015/
PKGNAMEPREFIX= tex-
@@ -72,14 +72,12 @@ CONFIGURE_ARGS+=--with-system-$L \
--with-$L-include=${LOCALBASE}/include \
--with-$L-libdir=${LOCALBASE}/lib
.endfor
+CONFIGURE_ARGS+=CC="${CC}" \
+ CXX="${CXX}"
CPPFLAGS+= -I${LOCALBASE}/include
MAKE_JOBS_UNSAFE= yes
TEX_FORMATS= luatex
-# Fix build on recent current -- our tex is so outdated,
-# that it's unlikely that any upstream patches apply.
-CFLAGS+= -fcommon
-
# buildenv and dumpenv in Makefile uses hard-coded TEXMFCNF.
post-extract:
cd ${WRKSRC}/.. && \
diff --git a/print/tex-luatex/files/patch-luatexdir_font_luatexfont.h b/print/tex-luatex/files/patch-luatexdir_font_luatexfont.h
new file mode 100644
index 000000000000..f3feeb7a31c9
--- /dev/null
+++ b/print/tex-luatex/files/patch-luatexdir_font_luatexfont.h
@@ -0,0 +1,11 @@
+--- luatexdir/font/luatexfont.h.orig 2015-03-20 07:59:58 UTC
++++ luatexdir/font/luatexfont.h
+@@ -149,8 +149,6 @@ void replace_packet_fonts(internal_font_number f, int
+ int *new_fontid, int count);
+ int *packet_local_fonts(internal_font_number f, int *num);
+
+-int packet_cur_s; /* current |do_vf_packet()| recursion level */
+-int packet_stack_ptr; /* pointer into |packet_stack| */
+ vf_struct *new_vfstruct(void);
+
+ /* writecff.c */
diff --git a/print/tex-luatex/files/patch-luatexdir_image_writeimg.h b/print/tex-luatex/files/patch-luatexdir_image_writeimg.h
new file mode 100644
index 000000000000..264feada74cf
--- /dev/null
+++ b/print/tex-luatex/files/patch-luatexdir_image_writeimg.h
@@ -0,0 +1,11 @@
+--- luatexdir/image/writeimg.h.orig 2015-03-20 07:59:58 UTC
++++ luatexdir/image/writeimg.h
+@@ -27,7 +27,7 @@
+ # include "pdf/pdfpage.h"
+
+ typedef image_dict *idict_entry;
+-idict_entry *idict_array;
++extern idict_entry *idict_array;
+
+ void new_img_pdfstream_struct(image_dict *);
+ image *new_image(void);
diff --git a/print/tex-luatex/files/patch-luatexdir_image_writeimg.w b/print/tex-luatex/files/patch-luatexdir_image_writeimg.w
new file mode 100644
index 000000000000..cdbf579e417a
--- /dev/null
+++ b/print/tex-luatex/files/patch-luatexdir_image_writeimg.w
@@ -0,0 +1,11 @@
+--- luatexdir/image/writeimg.w.orig 2015-03-20 07:59:58 UTC
++++ luatexdir/image/writeimg.w
+@@ -125,6 +125,8 @@
+ #define HEADER_PDF "%PDF-1."
+ #define MAX_HEADER (sizeof(HEADER_PNG)-1)
+
++idict_entry *idict_array;
++
+ static void check_type_by_header(image_dict * idict)
+ {
+ int i;
diff --git a/print/tex-luatex/files/patch-luatexdir_pdf_pdftables.h b/print/tex-luatex/files/patch-luatexdir_pdf_pdftables.h
new file mode 100644
index 000000000000..1b22db82488a
--- /dev/null
+++ b/print/tex-luatex/files/patch-luatexdir_pdf_pdftables.h
@@ -0,0 +1,11 @@
+--- luatexdir/pdf/pdftables.h.orig 2015-03-20 07:59:58 UTC
++++ luatexdir/pdf/pdftables.h
+@@ -21,7 +21,7 @@
+ #ifndef PDFTABLES_H
+ # define PDFTABLES_H
+
+-const char *pdf_obj_typenames[PDF_OBJ_TYPE_MAX + 1];
++extern const char *pdf_obj_typenames[PDF_OBJ_TYPE_MAX + 1];
+
+ typedef enum {
+ union_type_int,
diff --git a/print/tex-luatex/files/patch-luatexdir_tex_textoken.w b/print/tex-luatex/files/patch-luatexdir_tex_textoken.w
new file mode 100644
index 000000000000..6beaab5efe4d
--- /dev/null
+++ b/print/tex-luatex/files/patch-luatexdir_tex_textoken.w
@@ -0,0 +1,11 @@
+--- luatexdir/tex/textoken.w.orig 2015-03-28 00:34:27 UTC
++++ luatexdir/tex/textoken.w
+@@ -75,7 +75,7 @@ maximum memory usage. When code between the delimiters
+ report these statistics when |tracing_stats| is sufficiently large.
+
+ @c
+-int var_used, dyn_used; /* how much memory is in use */
++int dyn_used; /* how much memory is in use */
+
+ halfword avail; /* head of the list of available one-word nodes */
+ unsigned fix_mem_end; /* the last one-word node used in |mem| */
More information about the dev-commits-ports-all
mailing list