| 1 | # Description: A 2D graphics library with support for multiple output devices |
| 2 | # URL: http://www.cairographics.org/ |
| 3 | # Maintainer: Tilman Sauerbeck tilman at crux dot nu |
| 4 | # Arch Maintainer: CRUX-ARM System Team, devel at crux-arm dot nu |
| 5 | # Depends on: fontconfig libpng xorg-libxrender xorg-libpixman |
| 6 | |
| 7 | name=cairo |
| 8 | version=1.8.10 |
| 9 | release=1 |
| 10 | source=(http://cairographics.org/releases/$name-$version.tar.gz) |
| 11 | |
| 12 | build() { |
| 13 | cd $name-$version |
| 14 | |
| 15 | export DEFAULT_LIBS="-L$CLFS/usr/lib" |
| 16 | export DEFAULT_CFLAGS="-I$CLFS/usr/include" |
| 17 | export png_LIBS="$DEFAULT_LIBS -lpng12" |
| 18 | export png_CFLAGS="$DEFAULT_CFLAGS -I$CLFS/usr/include/libpng12" |
| 19 | export xlib_LIBS="$DEFAULT_LIBS -lX11" |
| 20 | export xlib_CFLAGS="$DEFAULT_CFLAGS" |
| 21 | export xlib_xrender_LIBS="$DEFAULT_LIBS -lXrender" |
| 22 | export xlib_xrender_CFLAGS="$DEFAULT_CFLAGS" |
| 23 | export pixman_LIBS="$DEFAULT_LIBS -lpixman-1" |
| 24 | export pixman_CFLAGS="$DEFAULT_CFLAGS -I$CLFS/usr/include/pixman-1" |
| 25 | export FONTCONFIG_LIBS="$DEFAULT_LIBS -lfontconfig" |
| 26 | export FONTCONFIG_CFLAGS="$DEFAULT_CFLAGS" |
| 27 | export FREETYPE_LIBS="$DEFAULT_LIBS -lfreetype -lz" |
| 28 | export FREETYPE_CFLAGS="$DEFAULT_CFLAGS -I$CLFS/usr/include/freetype2" |
| 29 | export CAIRO_LIBS="$PNG_LIBS $xlib_LIBS $xlib_xrender_LIBS $pixman_LIBS $FONTCONFIG_LIBS $FREETYPE_LIBS" |
| 30 | export CAIRO_CFLAGS="$PNG_CFLAGS $xlib_CFLAGS $xlib_xrender_CFLAGS $pixman_CFLAGS $FONTCONFIG_CFLAGS $FREETYPE_CFLAGS" |
| 31 | |
| 32 | sed 's|use_png=no|use_png=yes|' -i configure |
| 33 | |
| 34 | ./configure --build=$CHOST \ |
| 35 | --host=$CTARGET \ |
| 36 | --prefix=/usr \ |
| 37 | --enable-xlib=yes \ |
| 38 | --enable-xlib-xrender=yes \ |
| 39 | --enable-png=yes \ |
| 40 | --enable-ft=yes |
| 41 | |
| 42 | sed -i $(find . -type f -name Makefile) \ |
| 43 | -e "s|png_LIBS =.*|png_LIBS = $png_LIBS|" \ |
| 44 | -e "s|png_CFLAGS =.*|png_CFLAGS = $png_CFLAGS|" \ |
| 45 | -e "s|xlib_LIBS =.*|xlib_LIBS = $xlib_LIBS|" \ |
| 46 | -e "s|xlib_CFLAGS =.*|xlib_CFLAGS = $xlib_CFLAGS|" \ |
| 47 | -e "s|xlib_xrender_LIBS =.*|xlib_xrender_LIBS = $xlib_xrender_LIBS|" \ |
| 48 | -e "s|xlib_xrender_CFLAGS =.*|xlib_xrender_CFLAGS = $xlib_xrender_CFLAGS|" \ |
| 49 | -e "s|pixman_LIBS =.*|pixman_LIBS = $pixman_LIBS|" \ |
| 50 | -e "s|pixman_CFLAGS =.*|pixman_CFLAGS = $pixman_CFLAGS|" \ |
| 51 | -e "s|FONTCONFIG_LIBS =.*|FONTCONFIG_LIBS = $FONTCONFIG_LIBS|" \ |
| 52 | -e "s|FONTCONFIG_CFLAGS =.*|FONTCONFIG_CFLAGS = $FONTCONFIG_CFLAGS|" \ |
| 53 | -e "s|FREETYPE_LIBS =.*|FREETYPE_LIBS = $FREETYPE_LIBS|" \ |
| 54 | -e "s|FREETYPE_CFLAGS =.*|FREETYPE_CFLAGS = $FREETYPE_CFLAGS|" \ |
| 55 | -e "s|CAIRO_LIBS =.*|CAIRO_LIBS = $CAIRO_LIBS|" \ |
| 56 | -e "s|CAIRO_CFLAGS =.*|CAIRO_CFLAGS = $CAIRO_CFLAGS|" |
| 57 | |
| 58 | make |
| 59 | make DESTDIR=$PKG install |
| 60 | rm -rf $PKG/usr/share |
| 61 | } |