summary refs log tree commit diff
path: root/pkgs/development/libraries/cairo
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2013-03-11 19:19:48 -0400
committerShea Levy <shea@shealevy.com>2013-03-11 19:19:48 -0400
commit897840f76fe3866f434d7c691da6a4c30d43317c (patch)
tree0d28cc13afab8615927e91183f334ef108e51d45 /pkgs/development/libraries/cairo
parent901c7ff8ba3e9a537d34204230cf5c0e9ef47c77 (diff)
downloadnixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar.gz
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar.bz2
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar.lz
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar.xz
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.tar.zst
nixlib-897840f76fe3866f434d7c691da6a4c30d43317c.zip
Add cairo-1.12.2
Needed for an upcoming fix to eclipse.

Signed-off-by: Shea Levy <shea@shealevy.com>
Diffstat (limited to 'pkgs/development/libraries/cairo')
-rw-r--r--pkgs/development/libraries/cairo/1.12.2.nix85
1 files changed, 85 insertions, 0 deletions
diff --git a/pkgs/development/libraries/cairo/1.12.2.nix b/pkgs/development/libraries/cairo/1.12.2.nix
new file mode 100644
index 000000000000..254998b6e7a1
--- /dev/null
+++ b/pkgs/development/libraries/cairo/1.12.2.nix
@@ -0,0 +1,85 @@
+{ postscriptSupport ? true
+, pdfSupport ? true
+, pngSupport ? true
+, xcbSupport ? false
+, gobjectSupport ? true, glib
+, stdenv, fetchurl, pkgconfig, x11, fontconfig, freetype, xlibs
+, zlib, libpng, pixman, libxcb ? null, xcbutil ? null
+, gettext, libiconvOrEmpty
+}:
+
+assert postscriptSupport -> zlib != null;
+assert pngSupport -> libpng != null;
+assert xcbSupport -> libxcb != null && xcbutil != null;
+
+stdenv.mkDerivation rec {
+  name = "cairo-1.12.2";
+
+  src = fetchurl {
+    url = "http://cairographics.org/releases/${name}.tar.xz";
+    sha1 = "bc2ee50690575f16dab33af42a2e6cdc6451e3f9";
+  };
+
+  buildInputs =
+    [ pkgconfig x11 fontconfig xlibs.libXrender ]
+    ++ stdenv.lib.optionals xcbSupport [ libxcb xcbutil ]
+
+    # On non-GNU systems we need GNU Gettext for libintl.
+    ++ stdenv.lib.optional (!stdenv.isLinux) gettext
+
+    ++ libiconvOrEmpty;
+
+  propagatedBuildInputs =
+    [ freetype pixman ] ++
+    stdenv.lib.optional gobjectSupport glib ++
+    stdenv.lib.optional postscriptSupport zlib ++
+    stdenv.lib.optional pngSupport libpng;
+
+  configureFlags =
+    [ "--enable-tee" ]
+    ++ stdenv.lib.optional xcbSupport "--enable-xcb"
+    ++ stdenv.lib.optional pdfSupport "--enable-pdf";
+
+  preConfigure = ''
+    # Work around broken `Requires.private' that prevents Freetype
+    # `-I' flags to be propagated.
+    sed -i "src/cairo.pc.in" \
+        -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype}/include/freetype2 -I${freetype}/include|g'
+  ''
+
+  # On FreeBSD, `-ldl' doesn't exist.
+  + (stdenv.lib.optionalString stdenv.isFreeBSD
+       '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
+          do
+            cat "$i" | sed -es/-ldl//g > t
+            mv t "$i"
+          done
+       '');
+
+  enableParallelBuilding = true;
+
+  # The default `--disable-gtk-doc' is ignored.
+  postInstall = "rm -rf $out/share/gtk-doc";
+
+  meta = {
+    description = "A 2D graphics library with support for multiple output devices";
+
+    longDescription = ''
+      Cairo is a 2D graphics library with support for multiple output
+      devices.  Currently supported output targets include the X
+      Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.  Experimental backends include OpenGL
+      (through glitz), XCB, BeOS, OS/2, and DirectFB.
+
+      Cairo is designed to produce consistent output on all output
+      media while taking advantage of display hardware acceleration
+      when available (e.g., through the X Render Extension).
+    '';
+
+    homepage = http://cairographics.org/;
+
+    licenses = [ "LGPLv2+" "MPLv1" ];
+
+    platforms = stdenv.lib.platforms.all;
+  };
+}