cairo: expression refactoring, build OpenGL support by default

Mesa is now only a small dependency.
This commit is contained in:
Vladimír Čunát 2013-05-30 14:43:26 +02:00
parent 14f36162d2
commit 2e36aee508

View File

@ -1,19 +1,13 @@
{ postscriptSupport ? true { stdenv, fetchurl, pkgconfig, libiconvOrEmpty, libintlOrEmpty
, pdfSupport ? true , expat, zlib, libpng, pixman, fontconfig, freetype, xlibs
, pngSupport ? true
, xcbSupport ? true # no longer experimental since 1.12
, glSupport ? false
, gobjectSupport ? true, glib , gobjectSupport ? true, glib
, stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs , xcbSupport ? true # no longer experimental since 1.12
, expat , glSupport ? true, mesa_noglu ? null # mesa is no longer a big dependency
, zlib, libpng, pixman, libxcb ? null, xcbutil ? null, mesa ? null
, libiconvOrEmpty, libintlOrEmpty
}: }:
assert postscriptSupport -> zlib != null; assert glSupport -> mesa_noglu != null;
assert pngSupport -> libpng != null;
assert xcbSupport -> libxcb != null && xcbutil != null; with { inherit (stdenv.lib) optional optionals; };
assert glSupport -> mesa != null;
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cairo-1.12.14"; name = "cairo-1.12.14";
@ -23,25 +17,20 @@ stdenv.mkDerivation rec {
sha256 = "04xcykglff58ygs0dkrmmnqljmpjwp2qgwcz8sijqkdpz7ix3l4n"; sha256 = "04xcykglff58ygs0dkrmmnqljmpjwp2qgwcz8sijqkdpz7ix3l4n";
}; };
buildInputs = with xlibs; nativeBuildInputs = [ pkgconfig ] ++ libintlOrEmpty ++ libiconvOrEmpty;
[ pkgconfig x11 fontconfig expat ]
++ stdenv.lib.optional (!stdenv.isDarwin) libXrender
++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ]
++ stdenv.lib.optionals glSupport [ mesa ]
++ libintlOrEmpty
++ libiconvOrEmpty;
propagatedBuildInputs = propagatedBuildInputs =
[ freetype pixman ] ++ with xlibs; [ xlibs.xlibs fontconfig expat freetype pixman zlib libpng ]
stdenv.lib.optional gobjectSupport glib ++ ++ optional (!stdenv.isDarwin) libXrender
stdenv.lib.optional postscriptSupport zlib ++ ++ optionals xcbSupport [ libxcb xcbutil ]
stdenv.lib.optional pngSupport libpng; ++ optional gobjectSupport glib
++ optionals glSupport [ mesa_noglu ]
;
configureFlags = configureFlags = [ "--enable-tee" ]
[ "--enable-tee" ] ++ optional xcbSupport "--enable-xcb"
++ stdenv.lib.optional xcbSupport "--enable-xcb" ++ optional glSupport "--enable-gl"
++ stdenv.lib.optional glSupport "--enable-gl" ;
++ stdenv.lib.optional pdfSupport "--enable-pdf";
preConfigure = preConfigure =
# On FreeBSD, `-ldl' doesn't exist. # On FreeBSD, `-ldl' doesn't exist.