Date: Tuesday, August 1, 2017 @ 18:59:01 Author: foutrelis Revision: 247378
Backport upstream commit for building in C++11 mode Added: pdf2djvu/trunk/0001-configure-enable-the-C-11-standard.patch Modified: pdf2djvu/trunk/PKGBUILD -----------------------------------------------+ 0001-configure-enable-the-C-11-standard.patch | 104 ++++++++++++++++++++++++ PKGBUILD | 12 +- 2 files changed, 111 insertions(+), 5 deletions(-) Added: 0001-configure-enable-the-C-11-standard.patch =================================================================== --- 0001-configure-enable-the-C-11-standard.patch (rev 0) +++ 0001-configure-enable-the-C-11-standard.patch 2017-08-01 18:59:01 UTC (rev 247378) @@ -0,0 +1,104 @@ +From 8f8abd65767ad5d1f2b5d675509789d6c04524d9 Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <[email protected]> +Date: Fri, 11 Nov 2016 17:26:13 +0100 +Subject: [PATCH] configure: enable the C++11 standard. + +--- + acinclude.m4 | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++- + configure.ac | 3 ++- + 2 files changed, 58 insertions(+), 2 deletions(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 4dedbfc..c12339c 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -1,4 +1,4 @@ +-dnl | Copyright © 2015 Jakub Wilk <[email protected]> ++dnl | Copyright © 2015-2016 Jakub Wilk <[email protected]> + dnl | + dnl | This file is part of pdf2djvu. + dnl | +@@ -95,4 +95,59 @@ AC_DEFUN( + ] + ) + ++# AX_CXX_COMPILE_STDCXX_11 is too thorough. It would reject GCC 4.6, even ++# though this compiler implements enough C++11 bits for our purposes. ++ ++m4_define([_P_CXX11_CODE], [ ++ void* test() ++ { ++ auto t = nullptr; ++ return t; ++ } ++]) ++ ++# P_CXX11() ++ ++AC_DEFUN( ++ [P_CXX11], ++ [ ++ have_cxx11=no ++ AC_MSG_CHECKING([whether $CXX supports C++11]) ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([_P_CXX11_CODE])], ++ [ ++ AC_MSG_RESULT([yes]) ++ have_cxx11=yes ++ ], ++ [ ++ AC_MSG_RESULT([no]) ++ for cxx_std in 'gnu++11' 'gnu++0x' ++ do ++ cxx_opt="-std=$cxx_std" ++ AC_MSG_CHECKING([whether $CXX $cxx_opt supports C++11]) ++ p_CXXFLAGS="$CXXFLAGS" ++ CXXFLAGS="$CXXFLAGS $cxx_opt" ++ AC_COMPILE_IFELSE( ++ [AC_LANG_PROGRAM([_P_CXX11_CODE])], ++ [ ++ AC_MSG_RESULT([yes]) ++ have_cxx11=yes ++ ], ++ [ ++ AC_MSG_RESULT([no]) ++ CXXFLAGS="$p_CXXFLAGS" ++ ] ++ ) ++ test $have_cxx11 = yes && break ++ done ++ ] ++ ) ++ if test $have_cxx11 = no ++ then ++ AC_MSG_ERROR([the compiler does not support C++11]) ++ fi ++ ] ++) ++ ++ + dnl vim:ts=4 sts=4 sw=4 et ft=config +diff --git a/configure.ac b/configure.ac +index 38eec41..67b8c9e 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -30,6 +30,8 @@ AC_PREPROC_IFELSE( + + AC_PROG_CXX + ++P_CXX11 ++ + AC_SYS_LARGEFILE + + AC_OPENMP +@@ -165,7 +167,6 @@ P_CHECK_FUNC( + # Turn on compile warnings: + + P_MAYBE_ADD_CXXFLAGS( +- [-std=gnu++98], + [-Wall], + [-Wempty-body], + [-Werror=overloaded-virtual], +-- +2.13.3 + Modified: PKGBUILD =================================================================== --- PKGBUILD 2017-08-01 18:41:39 UTC (rev 247377) +++ PKGBUILD 2017-08-01 18:59:01 UTC (rev 247378) @@ -11,15 +11,16 @@ license=('GPL') depends=('poppler' 'djvulibre' 'gcc-libs' 'graphicsmagick' 'exiv2') makedepends=('python2-nose' 'ttf-liberation') -source=(https://github.com/jwilk/pdf2djvu/releases/download/$pkgver/pdf2djvu-$pkgver.tar.xz{,.asc}) +source=(https://github.com/jwilk/pdf2djvu/releases/download/$pkgver/pdf2djvu-$pkgver.tar.xz{,.asc} + 0001-configure-enable-the-C-11-standard.patch) validpgpkeys=('CDB5A1243ACDB63009AD07212D4EB3A6015475F5') prepare() { cd ${srcdir}/${pkgname}-${pkgver} - # Must compile in C++11 mode because poppler/PDFDoc.h makes use of nullptr - # Issue introduced in poppler 0.57.0: https://bugs.freedesktop.org/101208 - sed -i '/CXXFLAGS/s/-std=gnu++98//' configure + # Build in C++11 mode; needed when building against poppler >= 0.57.0 + patch -Np1 -i ../0001-configure-enable-the-C-11-standard.patch + autoreconf -v } build() { @@ -42,4 +43,5 @@ make install DESTDIR=${pkgdir} } md5sums=('4c78d594db304dca7435592eb85e15a4' - 'SKIP') + 'SKIP' + '9c32ee3f6a3b8c9316d6825dc6bebe74')
