Hi,

On Fri, Sep 22, 2017 at 10:26:15AM +0100, Stuart Henderson wrote:
> This looks like the simplest fix unless someone wants to figure out what
> code is processing the file and how to fix that:
> 
> https://github.com/termux/termux-packages/blob/master/packages/texlive-bin/c%2B%2B11.patch
> 
> I think it should get a REVISION bump for adding std=c++11, but also that
> this needs to wait for after unlock.

Thanks for finding the fix.

The diff below adds the patch, bumps REVISION and still sets
-std=c++11. No poppler-related diffs for now.

Builds for me on amd64 (tested with both clang-4.0.0 and  clang-5.0.0).

Testbuilds on arches without clang in base, especially sparc64 would
be really nice.

Ciao,
        Kili

ps: I think edd@ mentioned that the next texlive release will be
C++-11-ready, so there's no point in upstreaming the fix.


Index: Makefile
===================================================================
RCS file: /cvs/ports/print/texlive/base/Makefile,v
retrieving revision 1.92
diff -u -p -r1.92 Makefile
--- Makefile    24 Aug 2017 09:45:23 -0000      1.92
+++ Makefile    8 Oct 2017 18:41:58 -0000
@@ -6,7 +6,7 @@ COMMENT =               base binaries for TeXLive typ
 DISTNAME =             texlive-${DIST_V}b-source
 PKGNAME =              texlive_base-${V}
 WRKDIST =              ${WRKDIR}/texlive-${DIST_V}-source
-REVISION =             2
+REVISION =             3
 
 DISTFILES =            ${DISTNAME}${EXTRACT_SUFX} \
                        texlive-${DIST_V}-extra${EXTRACT_SUFX}
@@ -47,7 +47,7 @@ LIB_DEPENDS =         converters/libiconv \
 MODULES =              textproc/intltool perl
 
 # c++-11 required for poppler
-COMPILER =             gcc
+COMPILER =             base-clang ports-gcc
 
 # Never set SEPARATE_BUILD
 CONFIGURE_STYLE =      gnu
@@ -55,6 +55,8 @@ CONFIGURE_STYLE =     gnu
 CPPFLAGS =     -I${X11BASE}/include \
                -I${LOCALBASE}/include \
                -I${LOCALBASE}/include/poppler
+
+CXXFLAGS +=    -std=c++11
 
 LDFLAGS =      -L${LOCALBASE}/lib \
                -L${X11BASE}/lib
Index: patches/patch-texk_web2c_luatexdir_image_pdftoepdf_w
===================================================================
RCS file: patches/patch-texk_web2c_luatexdir_image_pdftoepdf_w
diff -N patches/patch-texk_web2c_luatexdir_image_pdftoepdf_w
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-texk_web2c_luatexdir_image_pdftoepdf_w        8 Oct 2017 
18:41:58 -0000
@@ -0,0 +1,25 @@
+$OpenBSD$
+
+Let it build with -std=c++11.
+
+found by sthen@ at
+https://github.com/termux/termux-packages/blob/master/packages/texlive-bin/c%2B%2B11.patch
+
+
+Index: texk/web2c/luatexdir/image/pdftoepdf.w
+--- texk/web2c/luatexdir/image/pdftoepdf.w.orig
++++ texk/web2c/luatexdir/image/pdftoepdf.w
+@@ -71,7 +71,12 @@ static char *get_file_checksum(const char *a, file_err
+         ck = (char *) malloc(PDF_CHECKSUM_SIZE);
+         if (ck == NULL)
+             formatted_error("pdf inclusion","out of memory while processing 
'%s'", a);
+-        snprintf(ck, PDF_CHECKSUM_SIZE, "%" PRIu64 "_%" PRIu64, (uint64_t) 
size,(uint64_t) mtime);
++        snprintf(ck, PDF_CHECKSUM_SIZE, "%"
++              PRIu64
++              "_%"
++              PRIu64,
++              (uint64_t) size,
++              (uint64_t) mtime);
+    } else {
+         switch (fe) {
+             case FE_FAIL:

Reply via email to