summaryrefslogtreecommitdiff
path: root/print/luatex
diff options
context:
space:
mode:
authoradam <adam@pkgsrc.org>2019-05-09 09:47:34 +0000
committeradam <adam@pkgsrc.org>2019-05-09 09:47:34 +0000
commit986656d34c35c7f478a481b7c3cf66e265113132 (patch)
treef204f2fc6109c43594a52133b6e1e272d0a8fa1b /print/luatex
parentefe6a82b83640e5463562f6be37f855c6ded97f6 (diff)
downloadpkgsrc-986656d34c35c7f478a481b7c3cf66e265113132.tar.gz
texlive: updated to 20190410
20190410: Kpathsea: More consistent brace expansion and path splitting; new variable TEXMFDOTDIR instead of hard-coded . in paths allows for easily searching additional or sub-directories (see comments in texmf.cnf). epTEX, eupTEX: New primitives \readpapersizespecial and \expanded. LuaTEX: Lua 5.3 now used, with concomitant arithmetic and interface changes. The homegrown library pplib is used to read pdf files, thus eliminating the dependency on poppler (and the need for C++); Lua interface changed accordingly. MetaPost: r-mpost command name recognized as an alias for invocation with the –restricted option, and added to the list of restricted commands available by default. Minimum precision now 2 for decimal and binary mode. Binary mode no longer available in MPlib but still available in standalone MetaPost. pdfTEX: New primitive \expanded; if new primitive parameter \pdfomitcharset is set to 1, the /CharSet string omitted from the PDF output, since it cannot feasibly be guaranteed correct, as required by PDF/A-2 and PDF/A-3. XeTEX: New primitives \expanded, \creationdate, \elapsedtime, \filedump, \filemoddate, \filesize, \resettimer, \normaldeviate, \uniformdeviate, \randomseed; extend \Ucharcat to produce active characters. tlmgr: Support curl as a download program; use lz4 and gzip before xz for local backups, if available; prefer system-provided binaries over binaries provided with TEX Live for compressor and download programs, unless the environment variable TEXLIVE_PREFER_OWN is set. install-tl: New option -gui (with no argument) is the default on Windows and Macs, and invokes a new Tcl/TK GUI (see sections 1.3 and 3.1.6). Utilities: cwebbin (https://ctan.org/pkg/cwebbin) is now the CWEB implementation in TEX Live, with support for more language dialects, and including the ctwill program to make mini-indexes. chkdvifont: report font information from DVI files, also from tfm/ofm, vf, gf, pk. dvispc: make a DVI file page-independent with respect to specials. MacTEX: x86_64-darwin now supports 10.12 and higher (Sierra, High Sierra, Mojave); x86_64-darwinlegacy still supports 10.6 and newer. The spell checker Excalibur is no longer included, since it requires 32-bit support. Platforms: removed sparc-solaris.
Diffstat (limited to 'print/luatex')
-rw-r--r--print/luatex/Makefile102
-rw-r--r--print/luatex/PLIST4
-rw-r--r--print/luatex/distinfo15
-rw-r--r--print/luatex/patches/patch-libs_lua53_lua53-src_src_luaconf.h (renamed from print/luatex/patches/patch-ac)21
-rw-r--r--print/luatex/patches/patch-texk_web2c_luatexdir_font_writet1.w18
-rw-r--r--print/luatex/patches/patch-texk_web2c_luatexdir_image_pdftoepdf.w112
-rw-r--r--print/luatex/patches/patch-texk_web2c_luatexdir_lua_lepdflib.cc284
7 files changed, 70 insertions, 486 deletions
diff --git a/print/luatex/Makefile b/print/luatex/Makefile
index c636791d902..8d0aab364ff 100644
--- a/print/luatex/Makefile
+++ b/print/luatex/Makefile
@@ -1,67 +1,81 @@
-# $NetBSD: Makefile,v 1.84 2019/04/28 13:15:25 rillig Exp $
+# $NetBSD: Makefile,v 1.85 2019/05/09 09:47:35 adam Exp $
-DISTNAME= texlive-20180414-source
-PKGNAME= luatex-1.07.0
-PKGREVISION= 12
+.include "../../print/texlive/Makefile.common"
+
+PKGNAME= luatex-1.10.0
CATEGORIES= print
-MASTER_SITES= ftp://tug.org/historic/systems/texlive/2018/
-EXTRACT_SUFX= .tar.xz
-MAINTAINER= minskim@NetBSD.org
-HOMEPAGE= http://www.luatex.org/
+HOMEPAGE= http://www.tug.org/web2c/
COMMENT= Extended version of pdfTeX using Lua
LICENSE= gnu-gpl-v2
-EXTRACT_ELEMENTS= ${DISTNAME}/build-aux \
- ${DISTNAME}/libs/lua52 \
- ${DISTNAME}/libs/luajit \
- ${DISTNAME}/texk/web2c
+EXTRACT_ELEMENTS+= ${DISTNAME}/libs/lua53
+EXTRACT_ELEMENTS+= ${DISTNAME}/libs/luajit
+EXTRACT_ELEMENTS+= ${DISTNAME}/texk/web2c
-GNU_CONFIGURE= yes
-GNU_CONFIGURE_STRICT= no # libs/lua52 doesn't know all the below options
USE_LANGUAGES= c99 c++11
-USE_LIBTOOL= yes
-USE_TOOLS+= gmake gsed lex perl pkg-config yacc
-CONFIGURE_ARGS+= --disable-aleph --disable-etex --disable-pdftex \
- --enable-luatex --disable-mf --disable-mf-nowin \
- --with-x=no \
- --disable-luatex53 --disable-luajittex --disable-mfluajit \
- --disable-mp --disable-pmp --disable-upmp \
- --disable-ptex --disable-eptex --disable-uptex --disable-euptex \
- --disable-web-progs \
- --enable-web2c --disable-xetex
+USE_TOOLS+= gmake gsed lex perl yacc
+GNU_CONFIGURE_STRICT= no # libs
+CONFIGURE_ARGS+= --disable-aleph
+CONFIGURE_ARGS+= --disable-eptex
+CONFIGURE_ARGS+= --disable-etex
+CONFIGURE_ARGS+= --disable-euptex
+CONFIGURE_ARGS+= --disable-mf
+CONFIGURE_ARGS+= --disable-mf-nowin
+CONFIGURE_ARGS+= --disable-luajittex
+CONFIGURE_ARGS+= --disable-mfluajit
+CONFIGURE_ARGS+= --disable-mp
+CONFIGURE_ARGS+= --disable-pdftex
+CONFIGURE_ARGS+= --disable-pmp
+CONFIGURE_ARGS+= --disable-ptex
+CONFIGURE_ARGS+= --disable-upmp
+CONFIGURE_ARGS+= --disable-uptex
+CONFIGURE_ARGS+= --disable-web-progs
+CONFIGURE_ARGS+= --disable-xetex
+CONFIGURE_ARGS+= --enable-luatex
+CONFIGURE_ARGS+= --enable-web2c
CONFIGURE_ARGS+= --with-system-poppler
-CONFIGURE_ARGS+= \
- --with-fontconfig-includes=${BUILDLINK_PREFIX.fontconfig}/include \
- --with-fontconfig-libdir=${BUILDLINK_PREFIX.fontconfig}/lib
+CONFIGURE_ARGS+= --with-fontconfig-includes=${BUILDLINK_PREFIX.fontconfig}/include
+CONFIGURE_ARGS+= --with-fontconfig-libdir=${BUILDLINK_PREFIX.fontconfig}/lib
CONFIGURE_ARGS+= --with-system-kpathsea
-CONFIGURE_ARGS+= --with-system-zlib \
- --with-zlib-includes=${BUILDLINK_PREFIX.zlib}/include \
- --with-zlib-libdir=${BUILDLINK_PREFIX.zlib}/lib
+CONFIGURE_ARGS+= --with-system-zlib
+CONFIGURE_ARGS+= --with-zlib-includes=${BUILDLINK_PREFIX.zlib}/include
+CONFIGURE_ARGS+= --with-zlib-libdir=${BUILDLINK_PREFIX.zlib}/lib
CONFIGURE_ARGS+= --with-system-cairo
CONFIGURE_ARGS+= --with-system-pixman
CONFIGURE_ARGS+= --with-system-libpng
CONFIGURE_ARGS+= --with-system-freetype2
CONFIGURE_ARGS+= --with-system-zziplib
-CONFIGURE_ARGS+= --with-system-mpfr \
- --with-mpfr-includes=${BUILDLINK_PREFIX.mpfr}/include \
- --with-mpfr-libdir=${BUILDLINK_PREFIX.mpfr}/lib
-CONFIGURE_ARGS+= --with-system-gmp \
- --with-gmp-includes=${BUILDLINK_PREFIX.gmp}/include \
- --with-gmp-libdir=${BUILDLINK_PREFIX.gmp}/lib
+CONFIGURE_ARGS+= --with-system-mpfr
+CONFIGURE_ARGS+= --with-mpfr-includes=${BUILDLINK_PREFIX.mpfr}/include
+CONFIGURE_ARGS+= --with-mpfr-libdir=${BUILDLINK_PREFIX.mpfr}/lib
+CONFIGURE_ARGS+= --with-system-gmp
+CONFIGURE_ARGS+= --with-gmp-includes=${BUILDLINK_PREFIX.gmp}/include
+CONFIGURE_ARGS+= --with-gmp-libdir=${BUILDLINK_PREFIX.gmp}/lib
+CONFIGURE_ARGS+= --without-x
-CONFIGURE_DIRS= libs/lua52
+CONFIGURE_DIRS= libs/lua53
CONFIGURE_DIRS+= texk/web2c
INSTALLATION_DIRS+= bin lib
SUBST_CLASSES+= prefix
SUBST_STAGE.prefix= post-configure
-SUBST_FILES.prefix= libs/lua52/lua52-src/src/luaconf.h
+SUBST_FILES.prefix= libs/lua53/lua53-src/src/luaconf.h
SUBST_VARS.prefix= PREFIX
CPPFLAGS.SunOS+= -D_XOPEN_SOURCE_EXTENDED=0
+pre-configure:
+ # Ensure we generate our patched version
+ ${RM} -f libs/luajit/lj_vm_asm.S
+
+do-install:
+ ${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKSRC}/libs/lua53/libtexlua53.la ${DESTDIR}${PREFIX}/lib
+ ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} ${WRKSRC}/texk/web2c/luatex ${DESTDIR}${PREFIX}/bin
+ ${LN} -f -s luatex ${DESTDIR}${PREFIX}/bin/texlua
+ ${LN} -f -s luatex ${DESTDIR}${PREFIX}/bin/texluac
+
.include "../../archivers/zziplib/buildlink3.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../graphics/cairo/buildlink3.mk"
@@ -72,16 +86,4 @@ BUILDLINK_API_DEPENDS.kpathsea+= kpathsea>=6.2.1
.include "../../print/poppler/buildlink3.mk"
.include "../../print/poppler-includes/buildlink3.mk"
.include "../../x11/pixman/buildlink3.mk"
-
-pre-configure:
- # Ensure we generate our patched version
- ${RM} -f libs/luajit/lj_vm_asm.S
-
-do-install:
- ${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKSRC}/libs/lua52/libtexlua52.la ${DESTDIR}${PREFIX}/lib
- ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} ${WRKSRC}/texk/web2c/luatex ${DESTDIR}${PREFIX}/bin
-.for f in texlua texluac
- ${LN} -s luatex ${DESTDIR}${PREFIX}/bin/${f}
-.endfor
-
.include "../../mk/bsd.pkg.mk"
diff --git a/print/luatex/PLIST b/print/luatex/PLIST
index 3ca70a0b925..55d262cb8a6 100644
--- a/print/luatex/PLIST
+++ b/print/luatex/PLIST
@@ -1,5 +1,5 @@
-@comment $NetBSD: PLIST,v 1.4 2015/12/12 19:11:47 markd Exp $
+@comment $NetBSD: PLIST,v 1.5 2019/05/09 09:47:35 adam Exp $
bin/luatex
bin/texlua
bin/texluac
-lib/libtexlua52.la
+lib/libtexlua53.la
diff --git a/print/luatex/distinfo b/print/luatex/distinfo
index 61e0e9d962f..fb571e609f7 100644
--- a/print/luatex/distinfo
+++ b/print/luatex/distinfo
@@ -1,12 +1,9 @@
-$NetBSD: distinfo,v 1.34 2019/02/17 11:17:37 tnn Exp $
+$NetBSD: distinfo,v 1.35 2019/05/09 09:47:35 adam Exp $
-SHA1 (texlive-20180414-source.tar.xz) = 81bdd9999b6ab860d1d3c388cf27062aba960255
-RMD160 (texlive-20180414-source.tar.xz) = 0ff63bbd7f8a0fb6417089f5d1ae1e4124a1dd95
-SHA512 (texlive-20180414-source.tar.xz) = ecac9b8203d2747be7ba7f82d68096d859fb35713276106d7049035dd3a8cfca07f8a8648982f0317b3812f8480db7326714de32f95998e3e6f73571de2aa140
-Size (texlive-20180414-source.tar.xz) = 49770944 bytes
-SHA1 (patch-ac) = 1ee83833a03eace2eada892130ddb2198e829f3d
+SHA1 (texlive-20190410-source.tar.xz) = d700878d3e19b6ad1313791dd5cef4bf0acfd675
+RMD160 (texlive-20190410-source.tar.xz) = a0cbe56b19b1f3d064315c37f8b5a4b04f82678b
+SHA512 (texlive-20190410-source.tar.xz) = 7759d8e668e53c0c73e48907096da9d8fb6384dd9c3342ddfb05e17d077054c5351d35256cf4e63a6da502de2f09f521979bede7209cdd5bd8ae80eba0efed2e
+Size (texlive-20190410-source.tar.xz) = 53783408 bytes
+SHA1 (patch-libs_lua53_lua53-src_src_luaconf.h) = 824ee4ba2c324e1e01967b82a54621b6b6f3edd3
SHA1 (patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c) = 34fa742ed696f97df637c5086bf1faf3d718cb69
SHA1 (patch-libs_luajit_LuaJIT-src_src_vm__x86.dasc) = 491d33adbbaab8b2b81a65a8d7ba30aee775b75f
-SHA1 (patch-texk_web2c_luatexdir_font_writet1.w) = c5d9b0bf411ff67028cbeee629bebc95f05c94e3
-SHA1 (patch-texk_web2c_luatexdir_image_pdftoepdf.w) = d3e5d16e75acefbb5a2bad56074d86928dd23061
-SHA1 (patch-texk_web2c_luatexdir_lua_lepdflib.cc) = e1dafa2bdc0a92e485839b86006bd4b1a8076ee8
diff --git a/print/luatex/patches/patch-ac b/print/luatex/patches/patch-libs_lua53_lua53-src_src_luaconf.h
index 0f8483fdcf0..c9588c559c0 100644
--- a/print/luatex/patches/patch-ac
+++ b/print/luatex/patches/patch-libs_lua53_lua53-src_src_luaconf.h
@@ -1,26 +1,25 @@
-$NetBSD: patch-ac,v 1.7 2016/06/16 04:06:19 markd Exp $
+$NetBSD: patch-libs_lua53_lua53-src_src_luaconf.h,v 1.1 2019/05/09 09:47:36 adam Exp $
Prepare @PREFIX@ for substituting the correct one in from the pkgsrc Makefile.
-
Solaris portability fix.
---- libs/lua52/lua52-src/src/luaconf.h.orig 2013-04-05 10:58:37.000000000 +0000
-+++ libs/lua52/lua52-src/src/luaconf.h
-@@ -102,7 +102,7 @@
+--- libs/lua53/lua53-src/src/luaconf.h.orig 2018-09-05 21:30:41.000000000 +0000
++++ libs/lua53/lua53-src/src/luaconf.h
+@@ -200,7 +200,7 @@
+
#else /* }{ */
- #define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
-#define LUA_ROOT "/usr/local/"
+#define LUA_ROOT "@PREFIX@"
- #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
- #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
+ #define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+ #define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
#define LUA_PATH_DEFAULT \
-@@ -177,7 +177,7 @@
+@@ -276,7 +276,7 @@
** default definition.
*/
#if defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \
- defined(__ELF__) /* { */
+ defined(__ELF__) && !defined(__sun) /* { */
#define LUAI_FUNC __attribute__((visibility("hidden"))) extern
- #define LUAI_DDEC LUAI_FUNC
- #define LUAI_DDEF /* empty */
+ #else /* }{ */
+ #define LUAI_FUNC extern
diff --git a/print/luatex/patches/patch-texk_web2c_luatexdir_font_writet1.w b/print/luatex/patches/patch-texk_web2c_luatexdir_font_writet1.w
deleted file mode 100644
index 39d250affc9..00000000000
--- a/print/luatex/patches/patch-texk_web2c_luatexdir_font_writet1.w
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-texk_web2c_luatexdir_font_writet1.w,v 1.1 2018/11/01 10:59:15 markd Exp $
-
-writet1 protection against buffer overflow
-
-git-svn-id: svn://tug.org/texlive/trunk/Build/source@48697 c570f23f-e606-0410-a88d-b1316a301751
-
---- texk/web2c/luatexdir/font/writet1.w.orig 2016-11-25 18:24:34.000000000 +0000
-+++ texk/web2c/luatexdir/font/writet1.w
-@@ -1625,7 +1625,9 @@ static void t1_check_unusual_charstring(
- if (sscanf(p, "%i", &i) != 1) {
- strcpy(t1_buf_array, t1_line_array);
- t1_getline();
-+ alloc_array(t1_buf, strlen(t1_line_array) + strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcat(t1_buf_array, t1_line_array);
-+ alloc_array(t1_line, strlen(t1_buf_array) + 1, T1_BUF_SIZE);
- strcpy(t1_line_array, t1_buf_array);
- t1_line_ptr = eol(t1_line_array);
- }
diff --git a/print/luatex/patches/patch-texk_web2c_luatexdir_image_pdftoepdf.w b/print/luatex/patches/patch-texk_web2c_luatexdir_image_pdftoepdf.w
deleted file mode 100644
index 5bcb6673b40..00000000000
--- a/print/luatex/patches/patch-texk_web2c_luatexdir_image_pdftoepdf.w
+++ /dev/null
@@ -1,112 +0,0 @@
-$NetBSD: patch-texk_web2c_luatexdir_image_pdftoepdf.w,v 1.8 2019/02/17 11:17:37 tnn Exp $
-
---- texk/web2c/luatexdir/image/pdftoepdf.w.orig 2018-01-17 18:00:12.000000000 +0000
-+++ texk/web2c/luatexdir/image/pdftoepdf.w
-@@ -33,9 +33,9 @@
-
- */
-
--extern void md5(Guchar *msg, int msgLen, Guchar *digest);
-+extern void md5(unsigned char *msg, int msgLen, unsigned char *digest);
-
--static GBool isInit = gFalse;
-+static bool isInit = false;
-
- /* Maintain AVL tree of all PDF files for embedding */
-
-@@ -361,12 +361,12 @@ void copyReal(PDF pdf, double d)
- pdf->cave = true;
- }
-
--static void copyString(PDF pdf, GooString * string)
-+static void copyString(PDF pdf, const GooString * string)
- {
-- char *p;
-+ const char *p;
- unsigned char c;
- size_t i, l;
-- p = string->getCString();
-+ p = string->c_str();
- l = (size_t) string->getLength();
- if (pdf->cave)
- pdf_out(pdf, ' ');
-@@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooStrin
- pdf->cave = true;
- }
-
--static void copyName(PDF pdf, char *s)
-+static void copyName(PDF pdf, const char *s)
- {
- pdf_out(pdf, '/');
- for (; *s != 0; s++) {
-@@ -468,7 +468,7 @@ static void copyObject(PDF pdf, PdfDocum
- break;
- /*
- case objNum:
-- GBool isNum() { return type == objInt || type == objReal; }
-+ bool isNum() { return type == objInt || type == objReal; }
- break;
- */
- case objString:
-@@ -529,26 +529,30 @@ static void writeRefs(PDF pdf, PdfDocume
-
- static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
- {
-+ const PDFRectangle *ret;
-+
- switch (pagebox_spec) {
- case PDF_BOX_SPEC_MEDIA:
-- return page->getMediaBox();
-+ ret = page->getMediaBox();
- break;
- case PDF_BOX_SPEC_CROP:
-- return page->getCropBox();
-+ ret = page->getCropBox();
- break;
- case PDF_BOX_SPEC_BLEED:
-- return page->getBleedBox();
-+ ret = page->getBleedBox();
- break;
- case PDF_BOX_SPEC_TRIM:
-- return page->getTrimBox();
-+ ret = page->getTrimBox();
- break;
- case PDF_BOX_SPEC_ART:
-- return page->getArtBox();
-+ ret = page->getArtBox();
- break;
- default:
-- return page->getMediaBox();
-+ ret = page->getMediaBox();
- break;
- }
-+
-+ return const_cast<PDFRectangle *>(ret);
- }
-
- /*
-@@ -587,11 +591,11 @@ void read_pdf_info(image_dict * idict)
- PDFRectangle *pagebox;
- int pdf_major_version_found, pdf_minor_version_found;
- float xsize, ysize, xorig, yorig;
-- if (isInit == gFalse) {
-+ if (isInit == false) {
- if (!(globalParams))
- globalParams = new GlobalParams();
-- globalParams->setErrQuiet(gFalse);
-- isInit = gTrue;
-+ globalParams->setErrQuiet(false);
-+ isInit = true;
- }
- if (img_type(idict) == IMG_TYPE_PDF)
- pdf_doc = refPdfDocument(img_filepath(idict), FE_FAIL);
-@@ -966,7 +970,7 @@ void epdf_free()
- if (PdfDocumentTree != NULL)
- avl_destroy(PdfDocumentTree, destroyPdfDocument);
- PdfDocumentTree = NULL;
-- if (isInit == gTrue)
-+ if (isInit == true)
- delete globalParams;
-- isInit = gFalse;
-+ isInit = false;
- }
diff --git a/print/luatex/patches/patch-texk_web2c_luatexdir_lua_lepdflib.cc b/print/luatex/patches/patch-texk_web2c_luatexdir_lua_lepdflib.cc
deleted file mode 100644
index bdcf3895e9f..00000000000
--- a/print/luatex/patches/patch-texk_web2c_luatexdir_lua_lepdflib.cc
+++ /dev/null
@@ -1,284 +0,0 @@
-$NetBSD: patch-texk_web2c_luatexdir_lua_lepdflib.cc,v 1.8 2019/02/17 11:17:37 tnn Exp $
-
---- texk/web2c/luatexdir/lua/lepdflib.cc.orig 2018-02-14 14:44:38.000000000 +0000
-+++ texk/web2c/luatexdir/lua/lepdflib.cc
-@@ -221,6 +221,7 @@ static int l_new_Attribute(lua_State * L
- const char *n;
- int nlen;
- udstruct *uobj, *uout;
-+ GooString *gs;
-
- if (lua_type(L,1)==LUA_TNUMBER) {
- uobj = (udstruct *) luaL_checkudata(L, 2, M_Object);
-@@ -240,7 +241,8 @@ static int l_new_Attribute(lua_State * L
- if (uobj->pd != NULL && uobj->pd->pc != uobj->pc)
- pdfdoc_changed_error(L);
- uout = new_Attribute_userdata(L);
-- uout->d = new Attribute(n, nlen, (Object *)uobj->d);
-+ gs = new GooString(n, nlen);
-+ uout->d = new Attribute(std::move(*gs), (Object *)uobj->d);
- uout->atype = ALLOC_LEPDF;
- uout->pc = uobj->pc;
- uout->pd = uobj->pd;
-@@ -439,7 +441,7 @@ static int l_new_Object(lua_State * L)
- break;
- case 1:
- if (lua_isboolean (L,1)) {
-- uout->d = new Object(lua_toboolean(L, 1)? gTrue : gFalse);
-+ uout->d = new Object(lua_toboolean(L, 1)? true : false);
- uout->atype = ALLOC_LEPDF;
- uout->pc = 0;
- uout->pd = NULL;
-@@ -591,7 +593,7 @@ static const struct luaL_Reg epdflib_f[]
- #define m_poppler_get_poppler(in, out, function) \
- static int m_##in##_##function(lua_State * L) \
- { \
-- out *o; \
-+ const out *o; \
- udstruct *uin, *uout; \
- uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
- if (uin->pd != NULL && uin->pd->pc != uin->pc) \
-@@ -599,7 +601,7 @@ static int m_##in##_##function(lua_State
- o = ((in *) uin->d)->function(); \
- if (o != NULL) { \
- uout = new_##out##_userdata(L); \
-- uout->d = o; \
-+ uout->d = const_cast<out *>(o); \
- uout->pc = uin->pc; \
- uout->pd = uin->pd; \
- } else \
-@@ -669,14 +671,14 @@ static int m_##in##_##function(lua_State
- #define m_poppler_get_GOOSTRING(in, function) \
- static int m_##in##_##function(lua_State * L) \
- { \
-- GooString *gs; \
-+ const GooString *gs; \
- udstruct *uin; \
- uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
- if (uin->pd != NULL && uin->pd->pc != uin->pc) \
- pdfdoc_changed_error(L); \
- gs = ((in *) uin->d)->function(); \
- if (gs != NULL) \
-- lua_pushlstring(L, gs->getCString(), gs->getLength()); \
-+ lua_pushlstring(L, gs->c_str(), gs->getLength()); \
- else \
- lua_pushnil(L); \
- return 1; \
-@@ -911,7 +913,7 @@ static int m_Array_getString(lua_State *
- if (i > 0 && i <= len) {
- gs = new GooString();
- if (((Array *) uin->d)->getString(i - 1, gs))
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- else
- lua_pushnil(L);
- delete gs;
-@@ -1063,7 +1065,7 @@ static int m_Catalog_getJS(lua_State * L
- if (i > 0 && i <= len) {
- gs = ((Catalog *) uin->d)->getJS(i - 1);
- if (gs != NULL)
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- else
- lua_pushnil(L);
- delete gs;
-@@ -1125,7 +1127,7 @@ m_poppler_get_INT(Dict, getLength);
-
- static int m_Dict_add(lua_State * L)
- {
-- char *s;
-+ const char *s;
- udstruct *uin, *uobj;
- uin = (udstruct *) luaL_checkudata(L, 1, M_Dict);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
-@@ -1378,7 +1380,7 @@ static int m_GooString__tostring(lua_Sta
- uin = (udstruct *) luaL_checkudata(L, 1, M_GooString);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- lua_pushlstring(L, ((GooString *) uin->d)->getCString(),
-+ lua_pushlstring(L, ((GooString *) uin->d)->c_str(),
- ((GooString *) uin->d)->getLength());
- return 1;
- }
-@@ -1527,9 +1529,9 @@ static int m_Object_initBool(lua_State *
- pdfdoc_changed_error(L);
- luaL_checktype(L, 2, LUA_TBOOLEAN);
- if (lua_toboolean(L, 2) != 0)
-- *((Object *) uin->d) = Object(gTrue);
-+ *((Object *) uin->d) = Object(true);
- else
-- *((Object *) uin->d) = Object(gFalse);
-+ *((Object *) uin->d) = Object(false);
- return 0;
- }
-
-@@ -1807,14 +1809,14 @@ static int m_Object_getNum(lua_State * L
-
- static int m_Object_getString(lua_State * L)
- {
-- GooString *gs;
-+ const GooString *gs;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
- if (((Object *) uin->d)->isString()) {
- gs = ((Object *) uin->d)->getString();
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- } else
- lua_pushnil(L);
- return 1;
-@@ -2051,7 +2053,7 @@ static int m_Object_dictAdd(lua_State *
- pdfdoc_changed_error(L);
- if (!((Object *) uin->d)->isDict())
- luaL_error(L, "Object is not a Dict");
-- ((Object *) uin->d)->dictAdd(copyString(s), std::move(*((Object *) uobj->d)));
-+ ((Object *) uin->d)->dictAdd(s, std::move(*((Object *) uobj->d)));
- return 0;
- }
-
-@@ -2465,14 +2467,14 @@ m_PDFDoc_INT(getErrorCode);
-
- static int m_PDFDoc_getFileName(lua_State * L)
- {
-- GooString *gs;
-+ const GooString *gs;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
- gs = ((PdfDocument *) uin->d)->doc->getFileName();
- if (gs != NULL)
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- else
- lua_pushnil(L);
- return 1;
-@@ -2553,7 +2555,7 @@ m_PDFDoc_INT(getNumPages);
-
- static int m_PDFDoc_readMetadata(lua_State * L)
- {
-- GooString *gs;
-+ const GooString *gs;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
-@@ -2561,7 +2563,7 @@ static int m_PDFDoc_readMetadata(lua_Sta
- if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
- gs = ((PdfDocument *) uin->d)->doc->readMetadata();
- if (gs != NULL)
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- else
- lua_pushnil(L);
- } else
-@@ -2571,7 +2573,7 @@ static int m_PDFDoc_readMetadata(lua_Sta
-
- static int m_PDFDoc_getStructTreeRoot(lua_State * L)
- {
-- StructTreeRoot *obj;
-+ const StructTreeRoot *obj;
- udstruct *uin, *uout;
- uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
-@@ -2579,7 +2581,7 @@ static int m_PDFDoc_getStructTreeRoot(lu
- if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
- obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
- uout = new_StructTreeRoot_userdata(L);
-- uout->d = obj;
-+ uout->d = const_cast<StructTreeRoot *>(obj);
- uout->pc = uin->pc;
- uout->pd = uin->pd;
- } else
-@@ -3024,12 +3026,12 @@ m_poppler_get_GUINT(Attribute,getRevisio
-
- static int m_Attribute_setRevision(lua_State * L)
- {
-- Guint i;
-+ unsigned int i;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- i = (Guint) luaL_checkint(L, 2);
-+ i = (unsigned int) luaL_checkint(L, 2);
- ((Attribute *) uin->d)->setRevision(i);
- return 0;
- }
-@@ -3038,12 +3040,12 @@ m_poppler_get_BOOL(Attribute, isHidden);
-
- static int m_Attribute_setHidden(lua_State * L)
- {
-- GBool i;
-+ bool i;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- i = (GBool) lua_toboolean(L, 2);
-+ i = (bool) lua_toboolean(L, 2);
- ((Attribute *) uin->d)->setHidden(i);
- return 0;
- }
-@@ -3180,7 +3182,7 @@ static int m_StructElement_getParentRef(
- // Ref is false if the C++ functione return false
- static int m_StructElement_getPageRef(lua_State * L)
- {
-- GBool b;
-+ bool b;
- Ref *r;
- udstruct *uin, *uout;
- uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
-@@ -3214,28 +3216,28 @@ static int m_StructElement_getTypeName(l
-
- static int m_StructElement_setRevision(lua_State * L)
- {
-- Guint i;
-+ unsigned int i;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- i = (Guint) luaL_checkint(L, 2);
-+ i = (unsigned int) luaL_checkint(L, 2);
- ((StructElement *) uin->d)->setRevision(i);
- return 0;
- }
-
- static int m_StructElement_getText(lua_State * L)
- {
-- GBool i;
-+ bool i;
- GooString *gs;
- udstruct *uin;
- uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
- if (uin->pd != NULL && uin->pd->pc != uin->pc)
- pdfdoc_changed_error(L);
-- i = (GBool) lua_toboolean(L, 2);
-+ i = (bool) lua_toboolean(L, 2);
- gs = ((StructElement *) uin->d)->getText(i);
- if (gs != NULL)
-- lua_pushlstring(L, gs->getCString(), gs->getLength());
-+ lua_pushlstring(L, gs->c_str(), gs->getLength());
- else
- lua_pushnil(L);
- return 1;
-@@ -3321,7 +3323,7 @@ static int m_StructElement_findAttribute
- {
- Attribute::Type t;
- Attribute::Owner o;
-- GBool g;
-+ bool g;
- udstruct *uin, *uout;
- const Attribute *a;
- uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement);
-@@ -3329,7 +3331,7 @@ static int m_StructElement_findAttribute
- pdfdoc_changed_error(L);
- t = (Attribute::Type) luaL_checkint(L,1);
- o = (Attribute::Owner) luaL_checkint(L,2);
-- g = (GBool) lua_toboolean(L, 3);
-+ g = (bool) lua_toboolean(L, 3);
- a = ((StructElement *) uin->d)->findAttribute(t,g,o);
-
- if (a!=NULL){