# -*- 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

PortSystem          1.0
PortGroup           github 1.0

github.setup        P-H-C phc-winner-argon2 20190702
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
name                argon2
categories          devel
maintainers         {khindenburg @kurthindenburg} openmaintainer
license             Apache-2

description         Password-hashing implmention that won the P-H-C

long_description \
    Argon2 is a password-hashing function that summarizes the state of the \
    art in the design of memory-hard functions and can be used to hash \
    passwords for credential storage, key derivation, or other applications.

checksums           rmd160  05b78cfa2309a25b6fed447236f1f37f92732cee \
                    sha256  3fa0b89e4db51141a071fae29387b08c23dc97813be04c2e15dcc1a9f6db2c00 \
                    size    1505325

patchfiles          install-manpage.patch \
                    no-rpath.patch

use_configure no

variant universal {}
build.args-append   OPTTEST=1
build.env-append    CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]" \
                    PREFIX=${prefix}
destroot.destdir    PREFIX=${destroot}${prefix}
destroot.args-append \
                    OPTTEST=1
destroot.env-append CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

test.run            yes
test.args-append    OPTTEST=1
test.env-append     CC=${configure.cc} \
                    "CFLAGS=${configure.cflags} [get_canonical_archflags cc]" \
                    "LDFLAGS=${configure.ldflags} [get_canonical_archflags ld]"

platform darwin 8 {
    depends_build-append port:gmake
    build.cmd            gmake
}
