From 5da1eabab7124791890627dde9a2883c05a39407 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Mon, 22 Apr 2019 18:10:09 +0000 Subject: cairo: make libpng support optional --- ...n-t-build-cairo-sphinx-unless-PNG-enabled.patch | 32 ++++++++++++++++++++++ .../pkgs/development/libraries/cairo/default.nix | 6 +++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch (limited to 'nixpkgs/pkgs/development/libraries/cairo') diff --git a/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch b/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch new file mode 100644 index 000000000000..702c4d49e484 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch @@ -0,0 +1,32 @@ +From 8b7816ea38a1869e7de94341e3ea9e1eebb8eb4f Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Mon, 22 Apr 2019 13:08:30 +0000 +Subject: [PATCH 4/5] util: don't build cairo-sphinx unless PNG enabled + +cairo-sphinx won't build without libpng, because +cairo_surface_write_to_png won't be defined. +--- + util/Makefile.am | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/util/Makefile.am b/util/Makefile.am +index 82d0a804c..119b59f48 100644 +--- a/util/Makefile.am ++++ b/util/Makefile.am +@@ -25,11 +25,13 @@ if BUILD_SPHINX + if CAIRO_HAS_DLSYM + if CAIRO_HAS_SCRIPT_SURFACE + if CAIRO_HAS_TEE_SURFACE ++if CAIRO_HAS_PNG_FUNCTIONS + SUBDIRS += cairo-sphinx + endif + endif + endif + endif ++endif + + AM_CPPFLAGS = -I$(top_srcdir)/src \ + -I$(top_builddir)/src \ +-- +2.19.2 + diff --git a/nixpkgs/pkgs/development/libraries/cairo/default.nix b/nixpkgs/pkgs/development/libraries/cairo/default.nix index 149ac5490461..0f2acbaff7b5 100644 --- a/nixpkgs/pkgs/development/libraries/cairo/default.nix +++ b/nixpkgs/pkgs/development/libraries/cairo/default.nix @@ -1,5 +1,6 @@ { config, stdenv, fetchurl, fetchpatch, pkgconfig, libiconv, autoreconfHook , libintl, expat, zlib, libpng, pixman, xorg +, pngSupport ? true , freetypeSupport ? true, freetype , fontconfigSupport ? freetypeSupport, fontconfig , gobjectSupport ? true, glib @@ -43,6 +44,7 @@ in stdenv.mkDerivation rec { ./0001-test-don-t-always-build-FreeType-dependent-test.patch ./0002-gl-don-t-implicitly-include-X11-headers.patch ./0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch + ./0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch ]; outputs = [ "out" "dev" "devdoc" ]; @@ -64,7 +66,8 @@ in stdenv.mkDerivation rec { ]); propagatedBuildInputs = - with xorg; [ expat pixman zlib libpng ] + with xorg; [ expat pixman zlib ] + ++ optional pngSupport libpng ++ optionals xlibSupport [ libX11 libXext ] ++ optional xlibXrenderSupport libXrender ++ optionals xcbSupport [ libxcb xcbutil ] @@ -81,6 +84,7 @@ in stdenv.mkDerivation rec { "--enable-quartz-image" "--enable-ft" ] else ([ "--enable-tee" ] + ++ optionals (!pngSupport) [ "--disable-png" "--disable-svg" ] ++ optional xcbSupport "--enable-xcb" ++ optional glSupport "--enable-gl" ++ optional pdfSupport "--enable-pdf" -- cgit 1.4.1