# -*- 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 107662 2013-07-04 00:53:04Z jeremyhu@macports.org $

PortSystem      1.0
PortGroup       archcheck 1.0

name            libsoup
version         2.42.2
set branch      [join [lrange [split ${version} .] 0 1] .]
categories      gnome net
platforms       darwin
license         LGPL-2+
maintainers     devans openmaintainer
description     Soup is an HTTP library implementation in C.

long_description \
    Soup provides a queued asynchronous callback-based \
    mechanism for sending and servicing SOAP requests \
    and a WSDL (Web Service Definition Language) for C \
    compilers which generates client stubs and server \
    skeletons for easily calling and implementing SOAP \
    methods.

homepage        http://www.gnome.org/
master_sites    gnome:sources/${name}/${branch}/
use_xz          yes

checksums       rmd160  a8bd5d643b5ec3c837eaca1c229cff18727c815f \
                sha256  1f4f9cc55ba483dc8defea0c3f97cc507dc48384c5529179e29c1e6d05630dbf

depends_build   port:pkgconfig

depends_lib     port:libxml2 \
                port:glib-networking \
                port:gobject-introspection \
                port:sqlite3 \
                port:gconf \
                port:intltool \
                port:libproxy \
                port:libgnome-keyring

archcheck.files \
    lib/gio/modules/libgiognutls.so \
    lib/gio/modules/libgiolibproxy.so \
    lib/libsqlite3.dylib \
    lib/libxml2.dylib

# Introspection requires gvfs (and others), but gvfs requires libsoup...
configure.args \
    --disable-more-warnings \
    --disable-silent-rules \
    --enable-introspection

# Don't do intltool's INTLTOOL_PERL dance
use_autoreconf  yes
autoreconf.args -fvi

# gobject-introspection uses g-ir-scanner, which uses $CC from env
build.args-append       CC="${configure.cc} ${configure.cc_archflags}"

test.run        yes
test.target     check

variant no_gnome description "Disable GNOME support" {
    depends_lib-delete \
        port:gconf \
        port:libgnome-keyring

    configure.args-append \
        --without-gnome
}

platform darwin 8 {
    depends_run-append      port:gmake
    depends_skip_archcheck-append gmake
    build.cmd               ${prefix}/bin/gmake
    destroot.cmd            ${prefix}/bin/gmake
}

livecheck.type  gnome
