fork
Configure Feed
Select the types of activity you want to include in your feed.
lol
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{ stdenv, fetchurl, pkgconfig, libiconv
2, libintl, expat, zlib, libpng, pixman, fontconfig, freetype, xorg
3, gobjectSupport ? true, glib
4, xcbSupport ? true # no longer experimental since 1.12
5, glSupport ? true, libGL ? null # libGLU_combined is no longer a big dependency
6, pdfSupport ? true
7, darwin
8}:
9
10assert glSupport -> libGL != null;
11
12let
13 version = "1.15.12";
14 inherit (stdenv.lib) optional optionals;
15in stdenv.mkDerivation rec {
16 name = "cairo-${version}";
17
18 src = fetchurl {
19 url = "https://cairographics.org/${if stdenv.lib.mod (builtins.fromJSON (stdenv.lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${name}.tar.xz";
20 sha256 = "1jcl0mnqq6j2xip8p506g2cj54sfycm339rrd3p4g2jljhdhh8vn";
21 };
22
23 outputs = [ "out" "dev" "devdoc" ];
24 outputBin = "dev"; # very small
25
26 nativeBuildInputs = [
27 pkgconfig
28 libiconv
29 libintl
30 ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
31 CoreGraphics
32 CoreText
33 ApplicationServices
34 Carbon
35 ]);
36
37 propagatedBuildInputs =
38 with xorg; [ libXext fontconfig expat freetype pixman zlib libpng libXrender ]
39 ++ optionals xcbSupport [ libxcb xcbutil ]
40 ++ optional gobjectSupport glib
41 ++ optional glSupport libGL
42 ; # TODO: maybe liblzo but what would it be for here?
43
44 configureFlags = if stdenv.isDarwin then [
45 "--disable-dependency-tracking"
46 "--enable-quartz"
47 "--enable-quartz-font"
48 "--enable-quartz-image"
49 "--enable-ft"
50 ] else ([ "--enable-tee" ]
51 ++ optional xcbSupport "--enable-xcb"
52 ++ optional glSupport "--enable-gl"
53 ++ optional pdfSupport "--enable-pdf"
54 );
55
56 preConfigure =
57 # On FreeBSD, `-ldl' doesn't exist.
58 stdenv.lib.optionalString stdenv.isFreeBSD
59 '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
60 do
61 cat "$i" | sed -es/-ldl//g > t
62 mv t "$i"
63 done
64 ''
65 +
66 ''
67 # Work around broken `Requires.private' that prevents Freetype
68 # `-I' flags to be propagated.
69 sed -i "src/cairo.pc.in" \
70 -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype.dev}/include/freetype2 -I${freetype.dev}/include|g'
71 '';
72
73 enableParallelBuilding = true;
74
75 doCheck = false; # fails
76
77 postInstall = stdenv.lib.optionalString stdenv.isDarwin glib.flattenInclude;
78
79 meta = with stdenv.lib; {
80 description = "A 2D graphics library with support for multiple output devices";
81
82 longDescription = ''
83 Cairo is a 2D graphics library with support for multiple output
84 devices. Currently supported output targets include the X
85 Window System, Quartz, Win32, image buffers, PostScript, PDF,
86 and SVG file output. Experimental backends include OpenGL
87 (through glitz), XCB, BeOS, OS/2, and DirectFB.
88
89 Cairo is designed to produce consistent output on all output
90 media while taking advantage of display hardware acceleration
91 when available (e.g., through the X Render Extension).
92 '';
93
94 homepage = http://cairographics.org/;
95
96 license = with licenses; [ lgpl2Plus mpl10 ];
97
98 platforms = platforms.all;
99 };
100}