# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id$

PortSystem                  1.0

name                        glib1
version                     1.2.10
revision                    7
categories                  devel
license                     LGPL
maintainers                 nomaintainer
homepage                    http://www.gtk.org/
platforms                   darwin freebsd

description                 Library with data structure functions and other constructs

long_description            General-purpose library from the GTK+ team, includes \
                            support routines for C such as lists, trees, hashes, \
                            memory allocation, and many other things.

master_sites                gnome:sources/glib/1.2/ \
                            ftp://ftp.gtk.org/pub/gtk/v1.2/ \
                            macports:lt:lt

set filename                glib-${version}${extract.suffix}

distfiles                   ${filename} \
                            ltconfig13:lt \
                            ltmain13:lt

checksums                   ${filename} \
                            md5     6fe30dad87c77b91b632def29dd69ef9 \
                            sha1    e5a9361c594608d152d5d9650154c2e3260b87fa \
                            rmd160  f19efe8c87ebeea979a4d36902d8a8209640cd95 \
                            ltconfig13 \
                            md5     ea53f42a550c9f9e653758a8ed91574e \
                            sha1    f48ac8711e15b81e4c67ec276fa58f1da4668b6e \
                            rmd160  57569892e2ed1c2b13f910a6ff745b15ee37e00e \
                            ltmain13 \
                            md5     e094ae92724c4015dbab97de151c2525 \
                            sha1    e5cb21161c8377f77f0725c7ede672c0f8167783 \
                            rmd160  95ecd24e1ca69401670665b7f7c45f0778bbca23

extract.only                ${filename}
worksrcdir                  glib-${version}

depends_build               port:pkgconfig

depends_lib                 port:gettext

patchfiles                  patch-configure \
                            patch-config.guess \
                            patch-config.sub \
                            patch-gmain.c \
                            patch-glib.h \
                            patch-gutils.c \
                            patch-glib.m4 \
                            inline.patch

post-patch {
    file copy -force ${distpath}/ltconfig13 ${worksrcpath}/ltconfig
    file copy -force ${distpath}/ltmain13 ${worksrcpath}/ltmain.sh
    # fix ltmain.sh to handle -arch flags
    system -W ${worksrcpath} "patch -p0 < ${filespath}/patch-ltmain.sh.diff"
}

configure.ccache            no

configure.ldflags-delete    -L${prefix}/lib

configure.cppflags-delete   -I${prefix}/include

configure.args              --disable-static \
                            --mandir=${prefix}/share/man \
                            --infodir=${prefix}/share/info

post-destroot {
    ln -s libglib-1.2.0.0.10.dylib ${destroot}${prefix}/lib/libglib.1.dylib
    ln -s libgmodule-1.2.0.0.10.dylib ${destroot}${prefix}/lib/libgmodule.1.dylib
    ln -s libgthread-1.2.0.0.10.dylib ${destroot}${prefix}/lib/libgthread.1.dylib
}

livecheck.type              regex
livecheck.url               http://ftp.gnome.org/pub/gnome/sources/glib/1.2/
livecheck.regex             glib-(\\d+(?:\\.\\d+)*)${extract.suffix}