cairo: 1.16.0 -> 1.18.0

- libiconv and expat are no longer used.
- libintl and xcbutil no longer appear to be used.
- The GL backend has been removed.
- We can no longer disable PDF support, since something always
propagates zlib.
- Not sure whether the Requires.private is still needed, so I've left
it.

+52 -108
+52 -108
pkgs/development/libraries/cairo/default.nix
··· 1 - { config, lib, stdenv, fetchurl, fetchpatch, pkg-config, libiconv 2 - , libintl, expat, zlib, libpng, pixman, fontconfig, freetype 3 - , x11Support? !stdenv.isDarwin, libXext, libXrender 1 + { lib, stdenv, fetchurl, fetchpatch, gtk-doc, meson, ninja, pkg-config, python3 2 + , docbook_xsl, fontconfig, freetype, libpng, pixman, zlib 3 + , x11Support? !stdenv.isDarwin || true, libXext, libXrender 4 4 , gobjectSupport ? true, glib 5 - , xcbSupport ? x11Support, libxcb, xcbutil # no longer experimental since 1.12 6 - , libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms 7 - , glSupport ? x11Support && config.cairo.gl or (libGLSupported && stdenv.isLinux) 8 - , libGL # libGLU libGL is no longer a big dependency 9 - , pdfSupport ? true 5 + , xcbSupport ? x11Support, libxcb 10 6 , darwin 11 7 , testers 12 8 }: ··· 17 13 inherit (finalAttrs) pname version; 18 14 in { 19 15 pname = "cairo"; 20 - version = "1.16.0"; 16 + version = "1.18.0"; 21 17 22 18 src = fetchurl { 23 19 url = "https://cairographics.org/${if lib.mod (builtins.fromJSON (lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${pname}-${version}.tar.xz"; 24 - sha256 = "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy"; 20 + hash = "sha256-JDoHNrl4oz3uKfnMp1IXM7eKZbVBggb+970cPUzxC2Q="; 25 21 }; 26 22 27 - patches = [ 28 - # Fixes CVE-2018-19876; see Nixpkgs issue #55384 29 - # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2018-19876 30 - # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/5 31 - # 32 - # This patch is the merged commit from the above PR. 33 - (fetchpatch { 34 - name = "CVE-2018-19876.patch"; 35 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/6edf572ebb27b00d3c371ba5ae267e39d27d5b6d.patch"; 36 - hash = "sha256-wZ51BZWlXByFY3/CTn7el2A9aYkwL1FygJ2zqnN+UIQ="; 37 - }) 38 - 39 - # Fix PDF output. 40 - # https://gitlab.freedesktop.org/cairo/cairo/issues/342 41 - (fetchpatch { 42 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/5e34c5a9640e49dcc29e6b954c4187cfc838dbd1.patch"; 43 - hash = "sha256-yCwsDUY7efVvOZkA6a0bPS+RrVc8Yk9bfPwWHeOjq5o="; 44 - }) 45 - 46 - # Fixes CVE-2020-35492; see https://github.com/NixOS/nixpkgs/issues/120364. 47 - # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2020-35492 48 - # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/85 49 - (fetchpatch { 50 - name = "CVE-2020-35492.patch"; 51 - includes = [ "src/cairo-image-compositor.c" ]; 52 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/78266cc8c0f7a595cfe8f3b694bfb9bcc3700b38.patch"; 53 - hash = "sha256-cXKzLMENx4/BHXLZg3Kfkx3esCnaNaB7WvjNfL77FhE="; 54 - }) 55 - 56 - # Workaround https://gitlab.freedesktop.org/cairo/cairo/-/issues/121 57 - ./skip-configure-stderr-check.patch 58 - 59 - # Fixes cairo crash on macOS Big Sur 60 - # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/-/issues/420 61 - (fetchpatch { 62 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/e22d7212acb454daccc088619ee147af03883974.diff"; 63 - hash = "sha256-8G98nsPz3MLEWPDX9F0jKgXC4hC4NNdFQLSpmW3ay2s="; 64 - }) 65 - 66 - # Fix clang build failures on newer LLVM versions 67 - # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/119 68 - (fetchpatch { 69 - name = "fix-types.patch"; 70 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/38e486b34d435130f2fb38c429e6016c3c82cd53.patch"; 71 - hash = "sha256-vmluOJSuTRiQHmbBBVCxOIkZ0O0ZEo0J4mgrUPn0SIo="; 72 - }) 73 - 74 - # Fix unexpected color addition on grayscale images (usually text). 75 - # Upstream fix: https://gitlab.freedesktop.org/cairo/cairo/-/merge_requests/114 76 - # Can be removed after 1.18 release 77 - (fetchpatch { 78 - name = "fix-grayscale-anialias.patch"; 79 - url = "https://gitlab.freedesktop.org/cairo/cairo/-/commit/4f4d89506f58a64b4829b1bb239bab9e46d63727.diff"; 80 - hash = "sha256-mbTg67e7APfdELsuMAgXdY3xokWbGtHF7VDD5UyYqKM="; 81 - }) 82 - 83 - ]; 84 - 85 23 outputs = [ "out" "dev" "devdoc" ]; 86 24 outputBin = "dev"; # very small 87 25 separateDebugInfo = true; 88 26 89 27 nativeBuildInputs = [ 28 + gtk-doc 29 + meson 30 + ninja 90 31 pkg-config 32 + python3 91 33 ]; 92 34 93 35 buildInputs = [ 94 - libiconv 95 - libintl 36 + docbook_xsl 96 37 ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ 97 38 CoreGraphics 98 39 CoreText ··· 100 41 Carbon 101 42 ]); 102 43 103 - propagatedBuildInputs = [ fontconfig expat freetype pixman zlib libpng ] 44 + propagatedBuildInputs = [ fontconfig freetype pixman libpng zlib ] 104 45 ++ optionals x11Support [ libXext libXrender ] 105 - ++ optionals xcbSupport [ libxcb xcbutil ] 46 + ++ optionals xcbSupport [ libxcb ] 106 47 ++ optional gobjectSupport glib 107 - ++ optional glSupport libGL 108 48 ; # TODO: maybe liblzo but what would it be for here? 109 49 110 - configureFlags = [ 111 - "--enable-tee" 112 - ] ++ (if stdenv.isDarwin then [ 113 - "--disable-dependency-tracking" 114 - "--enable-quartz" 115 - "--enable-quartz-font" 116 - "--enable-quartz-image" 117 - "--enable-ft" 118 - ] else (optional xcbSupport "--enable-xcb" 119 - ++ optional glSupport "--enable-gl" 120 - ++ optional pdfSupport "--enable-pdf" 121 - )) ++ optional (!x11Support) "--disable-xlib"; 50 + mesonFlags = [ 51 + "-Dgtk_doc=true" 122 52 123 - preConfigure = 124 - # On FreeBSD, `-ldl' doesn't exist. 125 - lib.optionalString stdenv.isFreeBSD 126 - '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in 127 - do 128 - cat "$i" | sed -es/-ldl//g > t 129 - mv t "$i" 130 - done 131 - '' 132 - + 133 - '' 134 - # Work around broken `Requires.private' that prevents Freetype 135 - # `-I' flags to be propagated. 136 - sed -i "src/cairo.pc.in" \ 137 - -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype.dev}/include/freetype2 -I${freetype.dev}/include|g' 138 - substituteInPlace configure --replace strings $STRINGS 139 - ''; 53 + # error: #error config.h must be included before this header 54 + "-Dsymbol-lookup=disabled" 55 + 56 + # Only used in tests, causes a dependency cycle 57 + "-Dspectre=disabled" 58 + 59 + (lib.mesonEnable "glib" gobjectSupport) 60 + (lib.mesonEnable "tests" finalAttrs.doCheck) 61 + (lib.mesonEnable "xlib" x11Support) 62 + (lib.mesonEnable "xcb" xcbSupport) 63 + # ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ 64 + # "--cross-file=${builtins.toFile "cross-file.conf" '' 65 + # [properties] 66 + # ipc_rmid_deferred_release = ${ 67 + # { 68 + # linux = "true"; 69 + # freebsd = "true"; 70 + # netbsd = "false"; 71 + # }.${stdenv.hostPlatform.parsed.kernel.name} or 72 + # throw "Unknown value for ipc_rmid_deferred_release" 73 + # } 74 + # ''}" 75 + ]; 76 + 77 + preConfigure = '' 78 + patchShebangs version.py 79 + ''; 140 80 141 81 enableParallelBuilding = true; 142 82 143 83 doCheck = false; # fails 144 84 145 - postInstall = lib.optionalString stdenv.isDarwin glib.flattenInclude; 85 + postInstall = '' 86 + # Work around broken `Requires.private' that prevents Freetype 87 + # `-I' flags to be propagated. 88 + sed -i "$out/lib/pkgconfig/cairo.pc" \ 89 + -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype.dev}/include/freetype2 -I${freetype.dev}/include|g' 90 + '' + lib.optionalString stdenv.isDarwin glib.flattenInclude; 146 91 147 92 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 148 93 ··· 151 96 longDescription = '' 152 97 Cairo is a 2D graphics library with support for multiple output 153 98 devices. Currently supported output targets include the X 154 - Window System, Quartz, Win32, image buffers, PostScript, PDF, 155 - and SVG file output. Experimental backends include OpenGL 156 - (through glitz), XCB, BeOS, OS/2, and DirectFB. 99 + Window System, XCB, Quartz, Win32, image buffers, PostScript, 100 + PDF, and SVG file output. 157 101 158 102 Cairo is designed to produce consistent output on all output 159 103 media while taking advantage of display hardware acceleration ··· 162 106 homepage = "http://cairographics.org/"; 163 107 license = with licenses; [ lgpl2Plus mpl10 ]; 164 108 pkgConfigModules = [ 109 + "cairo-pdf" 165 110 "cairo-ps" 166 111 "cairo-svg" 167 - ] ++ lib.optional gobjectSupport "cairo-gobject" 168 - ++ lib.optional pdfSupport "cairo-pdf"; 112 + ] ++ lib.optional gobjectSupport "cairo-gobject"; 169 113 platforms = platforms.all; 170 114 }; 171 115 })