From df8c1816bc78a380ff23de29964daaf8e403e381 Mon Sep 17 00:00:00 2001
From: Julian Viereck <julian.viereck@gmail.com>
Date: Thu, 22 Nov 2012 23:41:03 +0100
Subject: [PATCH] New version of cairo have .xz file format

---
 install | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/install b/install
index f5eb10c..c9b4758 100755
--- a/install
+++ b/install
@@ -2,7 +2,7 @@
 
 PKG_CONFIG="http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz"
 PIXMAN="http://www.cairographics.org/releases/pixman-0.28.0.tar.gz"
-CAIRO="http://cairographics.org/releases/cairo-1.12.8.tar.gz"
+CAIRO="http://cairographics.org/releases/cairo-1.12.8.tar.xz"
 FREETYPE="http://download.savannah.gnu.org/releases/freetype/freetype-2.4.10.tar.gz"
 LIBPNG="ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.2.40.tar.gz"
 PREFIX=${1-/usr/local}
@@ -29,6 +29,18 @@ fetch() {
     && install $dir
 }
 
+fetch_xz() {
+  local tarball=`basename $1`
+  echo "... downloading $tarball"
+  local dir=${tarball/.tar.xz/}
+  curl -# -L $1 -o $tarball \
+    && echo "... unpacking" \
+    && tar -xJf $tarball \
+    && echo "... removing tarball" \
+    && rm -fr $tarball \
+    && install $dir
+}
+
 install() {
   local dir=$1
   echo "... installing $1"
@@ -47,4 +59,4 @@ test `which pkg-config` || fetch $PKG_CONFIG
 require 'pkg-config'
 fetch $FREETYPE
 fetch $PIXMAN
-fetch $CAIRO
+fetch_xz $CAIRO