lol

calligra: build with poppler 22.03 and drop poppler_0_61

+17 -125
+16
pkgs/applications/office/calligra/default.nix
··· 30 30 sha256 = "11dzrp9q05dmvnwp4vk4ihcibqcf4xyr0ijscpi716cyy730flma"; 31 31 excludes = [ "CMakeLists.txt" ]; 32 32 }) 33 + # Fixes for building calligra with modern poppler[-qt5] 34 + (fetchpatch { 35 + name = "poppler-22.03.0.patch"; 36 + url = "https://github.com/archlinux/svntogit-packages/raw/8f328bef497a9e3bc628e4e294c1a70b0c8b0eab/trunk/poppler-22.03.0.patch"; 37 + sha256 = "sha256-bOTnQcavXF49LIshNgzhXhyoEjzLmQJC/U7hO5P0bfY="; 38 + }) 39 + # Fixes for building calligra with gcc11/c++17 40 + (fetchpatch { 41 + name = "build_c++17_poppler.patch"; 42 + url = "https://github.com/archlinux/svntogit-packages/raw/bbbe35f97eb1033798f1cf95d427890168598199/trunk/068cd9ae.patch"; 43 + sha256 = "sha256-d9/ILwSeW+ov11DF191hzIaUafO/rjQrAeONwqDSKbA="; 44 + }) 33 45 ]; 46 + postPatch = '' 47 + substituteInPlace CMakeLists.txt \ 48 + --replace 'CMAKE_CXX_STANDARD 11' 'CMAKE_CXX_STANDARD 17' 49 + ''; 34 50 35 51 nativeBuildInputs = [ extra-cmake-modules kdoctools ]; 36 52
-20
pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch
··· 1 - diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc 2 - --- a/poppler/JPEG2000Stream.cc 3 - +++ b/poppler/JPEG2000Stream.cc 4 - @@ -201,7 +201,7 @@ void JPXStream::init() 5 - if (getDict()) smaskInData = getDict()->lookup("SMaskInData"); 6 - 7 - int bufSize = BUFFER_INITIAL_SIZE; 8 - - if (oLen.isInt()) bufSize = oLen.getInt(); 9 - + if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt(); 10 - 11 - if (cspace.isArray() && cspace.arrayGetLength() > 0) { 12 - 13 - @@ -365,7 +365,7 @@ void JPXStream::init() 14 - } 15 - 16 - int bufSize = BUFFER_INITIAL_SIZE; 17 - - if (oLen.isInt()) bufSize = oLen.getInt(); 18 - + if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt(); 19 - 20 - if (cspace.isArray() && cspace.arrayGetLength() > 0) {
-94
pkgs/development/libraries/poppler/0.61.nix
··· 1 - { stdenv 2 - , lib 3 - , fetchurl 4 - , fetchpatch 5 - , cairo 6 - , cmake 7 - , curl 8 - , fontconfig 9 - , freetype 10 - , lcms 11 - , libiconv 12 - , libintl 13 - , libjpeg 14 - , ninja 15 - , openjpeg 16 - , pkg-config 17 - , zlib 18 - , withData ? true, poppler_data 19 - , qt5Support ? false, qtbase ? null 20 - , introspectionSupport ? false, gobject-introspection ? null 21 - , utils ? false 22 - , minimal ? false, suffix ? "glib" 23 - }: 24 - 25 - let 26 - version = "0.61.1"; 27 - mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}"; 28 - in 29 - stdenv.mkDerivation rec { 30 - pname = "poppler-${suffix}"; 31 - inherit version; 32 - 33 - src = fetchurl { 34 - url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz"; 35 - sha256 = "1afdrxxkaivvviazxkg5blsf2x24sjkfj92ib0d3q5pm8dihjrhj"; 36 - }; 37 - 38 - outputs = [ "out" "dev" ]; 39 - 40 - patches = [ 41 - # Fix internal crash: a negative number that should not be 42 - (fetchpatch { 43 - name = "CVE-2018-13988"; 44 - url = "https://cgit.freedesktop.org/poppler/poppler/patch/?id=004e3c10df0abda214f0c293f9e269fdd979c5ee"; 45 - sha256 = "1l8713s57xc6g81bldw934rsfm140fqc7ggd50ha5mxdl1b3app2"; 46 - }) 47 - # Fix internal crash: a negative number that should not be (not the above!) 48 - ./0.61-CVE-2019-9959.patch 49 - ]; 50 - 51 - nativeBuildInputs = [ 52 - cmake 53 - ninja 54 - pkg-config 55 - ]; 56 - 57 - buildInputs = [ 58 - libiconv 59 - libintl 60 - ] 61 - ++ lib.optional withData poppler_data; 62 - 63 - # TODO: reduce propagation to necessary libs 64 - propagatedBuildInputs = with lib; 65 - [ zlib freetype fontconfig libjpeg openjpeg ] 66 - ++ optionals (!minimal) [ cairo lcms curl ] 67 - ++ optional qt5Support qtbase 68 - ++ optional introspectionSupport gobject-introspection; 69 - 70 - # Not sure when and how to pass it. It seems an upstream bug anyway. 71 - CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11"; 72 - 73 - cmakeFlags = [ 74 - (mkFlag true "XPDF_HEADERS") 75 - (mkFlag (!minimal) "GLIB") 76 - (mkFlag (!minimal) "CPP") 77 - (mkFlag (!minimal) "LIBCURL") 78 - (mkFlag utils "UTILS") 79 - (mkFlag qt5Support "QT5") 80 - ]; 81 - 82 - dontWrapQtApps = true; 83 - 84 - meta = with lib; { 85 - homepage = "https://poppler.freedesktop.org/"; 86 - description = "A PDF rendering library"; 87 - longDescription = '' 88 - Poppler is a PDF rendering library based on the xpdf-3.0 code base. 89 - ''; 90 - license = licenses.gpl2Plus; 91 - platforms = platforms.all; 92 - maintainers = with maintainers; [ ttuegel ]; 93 - }; 94 - }
+1 -5
pkgs/top-level/all-packages.nix
··· 19952 19952 polkit = callPackage ../development/libraries/polkit { }; 19953 19953 19954 19954 poppler = callPackage ../development/libraries/poppler { lcms = lcms2; }; 19955 - poppler_0_61 = callPackage ../development/libraries/poppler/0.61.nix { lcms = lcms2; }; 19956 19955 19957 19956 poppler_gi = lowPrio (poppler.override { 19958 19957 introspectionSupport = true; ··· 25321 25320 25322 25321 calibre-web = callPackage ../servers/calibre-web { }; 25323 25322 25324 - calligra = libsForQt5.callPackage ../applications/office/calligra { 25325 - # Must use the same Qt version as Calligra itself: 25326 - poppler = libsForQt5.poppler_0_61; 25327 - }; 25323 + calligra = libsForQt5.callPackage ../applications/office/calligra { }; 25328 25324 25329 25325 perkeep = callPackage ../applications/misc/perkeep { }; 25330 25326
-6
pkgs/top-level/qt5-packages.nix
··· 166 166 suffix = "qt5"; 167 167 }; 168 168 169 - poppler_0_61 = callPackage ../development/libraries/poppler/0.61.nix { 170 - lcms = pkgs.lcms2; 171 - qt5Support = true; 172 - suffix = "qt5"; 173 - }; 174 - 175 169 pulseaudio-qt = callPackage ../development/libraries/pulseaudio-qt { }; 176 170 177 171 qca-qt5 = callPackage ../development/libraries/qca-qt5 { };