From 25f2da0d70d3d102d989497d5f44902eb9203380 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 9 Apr 2022 00:36:00 +0200 Subject: [PATCH 1/4] scribusUnstable: Fix build with Poppler 22.04 --- pkgs/applications/office/scribus/unstable.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/applications/office/scribus/unstable.nix b/pkgs/applications/office/scribus/unstable.nix index 754c9ba03d4..d3f706bbf05 100644 --- a/pkgs/applications/office/scribus/unstable.nix +++ b/pkgs/applications/office/scribus/unstable.nix @@ -84,6 +84,11 @@ mkDerivation rec { url = "https://github.com/scribusproject/scribus/commit/48263954a7dee0be815b00f417ae365ab26cdd85.patch"; sha256 = "1WE9kALFw79bQH88NUafXaZ1Y/vJEKTIWxlk5c+opsQ="; }) + # For Poppler 22.04 + (fetchpatch { + url = "https://github.com/scribusproject/scribus/commit/f2237b8f0b5cf7690e864a22ef7a63a6d769fa36.patch"; + sha256 = "FXpLoX/a2Jy3GcfzrUUyVUfEAp5wAy2UfzfVA5lhwJw="; + }) ]; nativeBuildInputs = [ From 556edebe3cec7ff1f4b131ff8da5478000cdea65 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 9 Apr 2022 00:39:33 +0200 Subject: [PATCH 2/4] inkscape: Fix build with poppler 22.04 --- pkgs/applications/graphics/inkscape/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix index 0958676cc99..06144f41626 100644 --- a/pkgs/applications/graphics/inkscape/default.nix +++ b/pkgs/applications/graphics/inkscape/default.nix @@ -79,6 +79,13 @@ stdenv.mkDerivation rec { url = "https://gitlab.com/inkscape/inkscape/-/commit/a18c57ffff313fd08bc8a44f6b6bf0b01d7e9b75.patch"; sha256 = "UZb8ZTtfA5667uo5ZlVQ5vPowiSgd4ItAJ9U1BOsRQg="; }) + + # Fix build with poppler 22.04 + # https://gitlab.com/inkscape/inkscape/-/merge_requests/4266 + (fetchpatch { + url = "https://gitlab.com/inkscape/inkscape/-/commit/d989cdf1059c78bc3bb6414330242073768d640b.patch"; + sha256 = "2cJZdunbRgPIwhJgz1dQoQRw3ZYZ2Fp6c3hpVBV2PbE="; + }) ]; postPatch = '' From 7c952f772c790085de5fff2206b16720fa1fadd1 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 9 Apr 2022 00:35:33 +0200 Subject: [PATCH 3/4] =?UTF-8?q?poppler:=2022.03.0=20=E2=86=92=2022.04.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://lists.freedesktop.org/archives/poppler/2022-April/015171.html --- pkgs/development/libraries/poppler/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index 5547e492a65..3e22483eb07 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -35,13 +35,13 @@ let in stdenv.mkDerivation rec { pname = "poppler-${suffix}"; - version = "22.03.0"; # beware: updates often break cups-filters build, check texlive and scribusUnstable too! + version = "22.04.0"; # beware: updates often break cups-filters build, check texlive and scribusUnstable too! outputs = [ "out" "dev" ]; src = fetchurl { url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz"; - sha256 = "sha256-cox4upTXWlX2tjVdT72qb0mTTZYWvljl5nmpz9CYDh4="; + sha256 = "sha256-gT+0uQ572mPfUyBcVIYCuucoiHpg9ASKrk29mxkn3v8="; }; nativeBuildInputs = [ From ced814af20ced2b7b17da68f5ee6059781458d45 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Wed, 4 May 2022 14:42:39 +0200 Subject: [PATCH 4/4] libreoffice-fresh: Fix build with poppler 22.04 --- .../office/libreoffice/default.nix | 3 + .../office/libreoffice/poppler-22-04-0.patch | 100 ++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 pkgs/applications/office/libreoffice/poppler-22-04-0.patch diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix index 5ebde5e10de..a67c9c2a70a 100644 --- a/pkgs/applications/office/libreoffice/default.nix +++ b/pkgs/applications/office/libreoffice/default.nix @@ -90,6 +90,9 @@ in (mkDrv rec { url = "https://github.com/archlinux/svntogit-packages/raw/f82958b9538f86e41b51f1ba7134968d2f3788d1/trunk/poppler-22.03.0.patch"; sha256 = "5h4qJmx6Q3Q3dHUlSi8JXBziN2mAswGVWk5aDTLTwls="; }) + + # Fix build with poppler 22.04 + ./poppler-22-04-0.patch ]; ### QT/KDE diff --git a/pkgs/applications/office/libreoffice/poppler-22-04-0.patch b/pkgs/applications/office/libreoffice/poppler-22-04-0.patch new file mode 100644 index 00000000000..c907bf1680b --- /dev/null +++ b/pkgs/applications/office/libreoffice/poppler-22-04-0.patch @@ -0,0 +1,100 @@ +Patch from OpenSUSE +https://build.opensuse.org/package/view_file/LibreOffice:Factory/libreoffice/poppler-22-04-0.patch?expand=1&rev=45e176f964509ebe3560d0dbf1ec8be9 +Index: libreoffice-7.3.3.1/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +=================================================================== +--- libreoffice-7.3.3.1.orig/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx ++++ libreoffice-7.3.3.1/sdext/source/pdfimport/xpdfwrapper/pdfioutdev_gpl.cxx +@@ -474,12 +474,21 @@ int PDFOutDev::parseFont( long long nNew + { + // TODO(P3): Unfortunately, need to read stream twice, since + // we must write byte count to stdout before ++#if POPPLER_CHECK_VERSION(22, 04, 0) // readEmbFontFile signature changed ++ auto pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef()); ++ if ( pBuf ) ++ { ++ aNewFont.isEmbedded = true; ++ nSize = pBuf->size(); ++ } ++#else + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize ); + if( pBuf ) + { + aNewFont.isEmbedded = true; + gfree(pBuf); + } ++#endif + } + + m_aFontMap[ nNewId ] = aNewFont; +@@ -492,21 +501,35 @@ void PDFOutDev::writeFontFile( GfxFont* + return; + + int nSize = 0; ++#if POPPLER_CHECK_VERSION(22, 04, 0) // readEmbFontFile signature changed ++ auto pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef()); ++ if ( !pBuf ) ++ return; ++ nSize = pBuf->size(); ++#else + char* pBuf = gfxFont->readEmbFontFile( m_pDoc->getXRef(), &nSize ); + if( !pBuf ) + return; ++#endif + + // ---sync point--- see SYNC STREAMS above + fflush(stdout); + ++#if POPPLER_CHECK_VERSION(22, 04, 0) // readEmbFontFile signature changed ++ if( fwrite(pBuf->data(), sizeof(unsigned char), nSize, g_binary_out) != static_cast(nSize) ) ++ { ++#else + if( fwrite(pBuf, sizeof(char), nSize, g_binary_out) != static_cast(nSize) ) + { + gfree(pBuf); ++#endif + exit(1); // error + } + // ---sync point--- see SYNC STREAMS above + fflush(g_binary_out); ++#if !POPPLER_CHECK_VERSION(22, 04, 0) // readEmbFontFile signature changed + gfree(pBuf); ++#endif + } + + #if POPPLER_CHECK_VERSION(0, 83, 0) +@@ -759,7 +782,11 @@ void PDFOutDev::updateFont(GfxState *sta + { + assert(state); + ++#if POPPLER_CHECK_VERSION(22, 04, 0) ++ std::shared_ptr gfxFont = state->getFont(); ++#else + GfxFont *gfxFont = state->getFont(); ++#endif + if( !gfxFont ) + return; + +@@ -776,7 +803,11 @@ void PDFOutDev::updateFont(GfxState *sta + m_aFontMap.find( fontID ); + if( it == m_aFontMap.end() ) + { ++#if POPPLER_CHECK_VERSION(22, 04, 0) ++ nEmbedSize = parseFont( fontID, gfxFont.get(), state ); ++#else + nEmbedSize = parseFont( fontID, gfxFont, state ); ++#endif + it = m_aFontMap.find( fontID ); + } + +@@ -806,7 +837,11 @@ void PDFOutDev::updateFont(GfxState *sta + + if (nEmbedSize) + { ++#if POPPLER_CHECK_VERSION(22, 04, 0) ++ writeFontFile(gfxFont.get()); ++#else + writeFontFile(gfxFont); ++#endif + } + } +