# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 78097 2011-04-23 15:48:57Z mcalhoun@macports.org $

PortSystem      1.0
PortGroup       archcheck 1.0

name            librsvg
version         2.34.0
revision        0
license         GPL-2 LGPL-2
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      graphics gnome
platforms       darwin
maintainers     nomaintainer
description     Gnome implementation of rsvg.

long_description \
    ${description}

homepage        http://librsvg.sourceforge.net/
master_sites    gnome:sources/${name}/${branch}/
use_bzip2       yes

checksums           md5     5eb2fcd0765aa5e47a4999985e3c27ab \
                    sha1    59e01568a6b201fc45828a76b942f790859cddeb \
                    rmd160  02638bcf084156e4e209a325a20e99d2e88e9fd8

depends_build   port:pkgconfig

depends_lib \
    port:libart_lgpl \
    path:lib/pkgconfig/cairo.pc:cairo \
    port:libcroco \
    port:fontconfig \
    port:freetype \
    path:lib/pkgconfig/glib-2.0.pc:glib2 \
    port:gtk2 \
    port:libgsf \
    port:libxml2 \
    path:lib/pkgconfig/pango.pc:pango


set pyversion 2.7
depends_run     port:python[join [split ${pyversion} "."] ""]

archcheck.files \
    lib/libart_lgpl_2.dylib \
    lib/libcairo.dylib \
    lib/libcroco-0.6.dylib \
    lib/libfontconfig.dylib \
    lib/libfreetype.dylib \
    lib/libglib-2.0.dylib \
    lib/libgsf-1.dylib \
    lib/libpango-1.0.dylib \
    lib/libxml2.dylib

post-destroot {
    set python.branch ${pyversion}
    set python.bin ${frameworks_dir}/Python.framework/Versions/${python.branch}/bin/python${python.branch}
    reinplace "s|^#!/usr/bin/env python|#!${python.bin}|g" \
        ${destroot}${prefix}/bin/rsvg

    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING COPYING.LIB NEWS README \
        ${destroot}${docdir}
}

post-activate {
    ui_debug "Updating gdk-pixbuf.loaders..."
    system "${prefix}/bin/gdk-pixbuf-query-loaders --update-cache"
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/${name}/${branch}/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
