diff --git a/srcpkgs/libreoffice/patches/poppler-22.03.0.patch b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch new file mode 100644 index 00000000000..c6544b2575f --- /dev/null +++ b/srcpkgs/libreoffice/patches/poppler-22.03.0.patch @@ -0,0 +1,28 @@ +diff --git a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx +index ad6320139..e5f6d9c68 100644 +--- a/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx ++++ b/sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx +@@ -138,6 +138,15 @@ int main(int argc, char **argv) + _setmode( _fileno( g_binary_out ), _O_BINARY ); + #endif + ++#if POPPLER_CHECK_VERSION(22, 3, 0) ++ PDFDoc aDoc( std::make_unique(pFileName), ++ GooString(pOwnerPasswordStr), ++ GooString(pUserPasswordStr) ); ++ ++ PDFDoc aErrDoc( std::make_unique(pErrFileName), ++ GooString(pOwnerPasswordStr), ++ GooString(pUserPasswordStr) ); ++#else + PDFDoc aDoc( pFileName, + pOwnerPasswordStr, + pUserPasswordStr ); +@@ -145,6 +154,7 @@ int main(int argc, char **argv) + PDFDoc aErrDoc( pErrFileName, + pOwnerPasswordStr, + pUserPasswordStr ); ++#endif + + // Check various permissions for aDoc. + PDFDoc &rDoc = aDoc.isOk()? aDoc: aErrDoc; diff --git a/srcpkgs/libreoffice/patches/poppler-22.04.0.patch b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch new file mode 100644 index 00000000000..47f59673d69 --- /dev/null +++ b/srcpkgs/libreoffice/patches/poppler-22.04.0.patch @@ -0,0 +1,71 @@ +# Patch from FreeBSD (https://cgit.freebsd.org/ports/commit/?id=d9b5ef800dbd) + +--- a/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx ++++ b/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +@@ -474,11 +474,17 @@ int PDFOutDev::parseFont( long long nNewId, GfxFont* g + { + // TODO(P3): Unfortunately, need to read stream twice, since + // we must write byte count to stdout before ++#if !POPPLER_CHECK_VERSION(22, 3, 0) + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize ); ++#else ++ std::optional> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() ); ++#endif + if( pBuf ) + { + aNewFont.isEmbedded = true; ++#if !POPPLER_CHECK_VERSION(22, 3, 0) + gfree(pBuf); ++#endif + } + } + +@@ -492,21 +498,32 @@ void PDFOutDev::writeFontFile( GfxFont* gfxFont ) cons + return; + + int nSize = 0; +- char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize ); ++#if !POPPLER_CHECK_VERSION(22, 3, 0) ++ char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize ); ++#else ++ std::optional> pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef() ); ++#endif + if( !pBuf ) + return; + + // ---sync point--- see SYNC STREAMS above + fflush(stdout); +- ++#if !POPPLER_CHECK_VERSION(22, 3, 0) + if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast(nSize) ) ++#else ++ if( fwrite(reinterpret_cast(pBuf.value().data()), sizeof(char), nSize, g_binary_out) != static_cast(nSize) ) ++#endif + { +- gfree(pBuf); ++#if !POPPLER_CHECK_VERSION(22, 3, 0) ++ gfree(pBuf); ++#endif + exit(1); // error + } + // ---sync point--- see SYNC STREAMS above + fflush(g_binary_out); +- gfree(pBuf); ++#if !POPPLER_CHECK_VERSION(22, 3, 0) ++ gfree(pBuf); ++#endif + } + + #if POPPLER_CHECK_VERSION(0, 83, 0) +@@ -759,7 +776,11 @@ void PDFOutDev::updateFont(GfxState *state) + { + assert(state); + ++#if !POPPLER_CHECK_VERSION(22, 3, 0) + GfxFont *gfxFont = state->getFont(); ++#else ++ GfxFont *gfxFont = state->getFont().get(); ++#endif + if( !gfxFont ) + return; + diff --git a/srcpkgs/libreoffice/template b/srcpkgs/libreoffice/template index 6d35e14a327..158df0f30eb 100644 --- a/srcpkgs/libreoffice/template +++ b/srcpkgs/libreoffice/template @@ -1,7 +1,7 @@ # Template file for 'libreoffice' pkgname=libreoffice version=7.3.3.2 -revision=2 +revision=3 build_style=meta make_build_target="build-nocheck" nocross="Several dependencies are nocross=yes"