# -*- 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: Portfile 118536 2014-04-04 07:27:45Z ryandesign@macports.org $

PortSystem          1.0
PortGroup           muniversal 1.0

name                nettle
version             2.7.1
categories          devel crypto
platforms           darwin
maintainers         gmx.de:exodusd uni-paderborn.de:nicke openmaintainer
license             LGPL-2.1+

description         low-level cryptographic library

long_description    Nettle is a cryptographic library that is designed to fit \
                    easily in more or less any context: In crypto toolkits \
                    for object-oriented languages (C++, Python, Pike, ...), \
                    in applications like LSH or GNUPG, or even in kernel \
                    space. It tries to solve a problem of providing a common \
                    set of cryptographic algorithms for higher-level \
                    applications by implementing a context-independent set of \
                    cryptographic algorithms. In that light, Nettle doesn't \
                    do any memory allocation or I/O, it simply provides the \
                    cryptographic algorithms for the application to use in \
                    any environment and in any way it needs.

homepage            http://www.lysator.liu.se/~nisse/nettle/
master_sites        gnu

checksums           rmd160  f5c9d950c1e55210fa1659b907378814c54312d3 \
                    sha256  bc71ebd43435537d767799e414fce88e521b7278d48c860651216e1fc6555b40

depends_lib         port:gmp

patchfiles          no-fink.patch

use_autoreconf      yes
autoreconf.args     -fvi

configure.args      --enable-shared

if {[variant_isset universal]} {
    set merger_host(x86_64) x86_64-apple-${os.platform}${os.major}
    set merger_host(i386) i686-apple-${os.platform}${os.major}
    set merger_configure_args(x86_64) --build=x86_64-apple-${os.platform}${os.major}
    set merger_configure_args(i386) --build=i686-apple-${os.platform}${os.major}
} else {
    if {${build_arch} eq "i386"} {
        configure.args-append \
            --host=i686-apple-${os.platform}${os.major} \
            --build=i686-apple-${os.platform}${os.major}
    } elseif {${build_arch} eq "x86_64"} {
        configure.args-append \
            --host=${build_arch}-apple-${os.platform}${os.major} \
            --build=${build_arch}-apple-${os.platform}${os.major}
    }
}
