From: Robert Nagy Subject: Re: editors/libreoffice: fix build with new poppler To: Matthias Kilian Cc: ports@openbsd.org Date: Wed, 29 Oct 2025 21:44:47 +0100 ok On 29/10/25 21:21 +0100, Matthias Kilian wrote: > Hi, > > this fixes the build of editors/libreoffice with the new version of > poppler. Patches picked from upstream. > > Ok? > > Ciao, > Kili > > Index: patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx > =================================================================== > RCS file: patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx > diff -N patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-sdext_source_pdfimport_xpdfwrapper_wrapper_gpl_cxx 27 Oct 2025 20:41:43 -0000 > @@ -0,0 +1,44 @@ > +Fix build with poppler-25.10.0. > + > +From upstream commits ae83e577501c504f89b434606f05ff1d555729c9 and > +89841fc69446a597b24b978344cd3c8d656aae09. > + > +Index: sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx > +--- sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx.orig > ++++ sdext/source/pdfimport/xpdfwrapper/wrapper_gpl.cxx > +@@ -203,6 +203,22 @@ int main(int argc, char **argv) > + // PDFDoc takes over ownership for all strings below > + GooString* pFileName = new GooString(myStringToStdString(argv[1])); > + > ++#if POPPLER_CHECK_VERSION(22, 6, 0) > ++ std::optional ownerPasswordStr = {}; > ++ if (aPwBuf[0] != 0) { > ++ ownerPasswordStr = std::make_optional(aPwBuf); > ++ } else if (ownerPassword) { > ++ ownerPasswordStr = std::make_optional(myStringToStdString(ownerPassword)); > ++ } > ++ std::optional userPasswordStr = {}; > ++ if (aPwBuf[0] != 0) { > ++ userPasswordStr = std::make_optional(aPwBuf); > ++ } else if (userPassword) { > ++ userPasswordStr = std::make_optional(myStringToStdString(userPassword)); > ++ } > ++ pDocUnique = std::make_unique( > ++ std::unique_ptr(pFileName), ownerPasswordStr, userPasswordStr); > ++#else > + // check for password string(s) > + GooString* pOwnerPasswordStr(aPwBuf[0] != 0 > + ? new GooString(aPwBuf) > +@@ -214,12 +230,6 @@ int main(int argc, char **argv) > + : (userPassword > + ? new GooString(myStringToStdString(userPassword)) > + : nullptr)); > +-#if POPPLER_CHECK_VERSION(22, 6, 0) > +- pDocUnique = std::unique_ptr( > +- new PDFDoc(std::make_unique(pFileName), > +- std::optional(pOwnerPasswordStr), > +- std::optional(pUserPasswordStr))); > +-#else > + pDocUnique = std::unique_ptr( > + new PDFDoc(pFileName, pOwnerPasswordStr, pUserPasswordStr)); > + #endif -- Regards, Robert Nagy