# -*- 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
PortGroup               makefile 1.0

github.setup            hashcat hashcat 6.2.6 v
github.tarball_from     archive
revision                2

categories              security
platforms               {darwin >= 15}
license                 MIT
maintainers             @gaming-hacker openmaintainer

description             World's fastest and most advanced password recovery utility.
long_description        hashcat is the world's fastest and most advanced \
                        password recovery utility, supporting five unique modes \
                        of attack for over 200 highly-optimized hashing algorithms. \
                        hashcat currently supports CPUs, GPUs, and other hardware \
                        accelerators on Linux, Windows, and macOS, and has \
                        facilities to help enable distributed password cracking

homepage                https://hashcat.net/hashcat/

build.target            {}

checksums               rmd160  63fcf5f9230208dc6fa3da86212f66f5df8b836c \
                        sha256  b25e1077bcf34908cc8f18c1a69a2ec98b047b2cbcf0f51144dcf3ba1e0b7b2a \
                        size    14234640

depends_lib-append      port:xxhash \
                        port:zlib \
                        port:minizip \
                        port:libiconv

patchfiles-append       patch-remove-arch.patch

set build_env {
                        SHARED=1
                        USE_SYSTEM_ZLIB=1
                        USE_SYSTEM_OPENCL=1
                        USE_SYSTEM_XXHASH=1
}

build.env-append        {*}$build_env
destroot.env-append     {*}$build_env

# Code does not actually need C11 but spits out numerous warnings like:
# warning: redefinition of typedef 'UINT_PTR' is a C11 feature [-Wtypedef-redefinition]
# Also see https://github.com/hashcat/hashcat/issues/4045
if {[string match *clang* ${configure.cc}]} {
    configure.cflags-append \
                        -Wno-typedef-redefinition
}
