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

# dprintf
legacysupport.newest_darwin_requires_legacy 10

github.setup        rofl0r proxychains-ng 4.17 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
maintainers         nomaintainer
categories          devel
license             GPL-2
description         hook preloader
long_description    ${name} is a {*}${description} which hooks calls to \
                    sockets indynamically linked programs and redirects \
                    it through one or more socks/http proxies.

master_sites        ${homepage}/archive/
distname            ${github.tag_prefix}${version}
worksrcdir          ${name}-${version}

checksums           rmd160  83073f3df35c28c0a8d6ad2b522669c8727a1a8b \
                    sha256  1a2dc68fcbcb2546a07a915343c1ffc75845f5d9cc3ea5eb3bf0b62a66c0196f \
                    size    52568

patchfiles-append   patch-EAI_OVERFLOW.diff

# https://github.com/rofl0r/proxychains-ng/issues/578
patchfiles-append   patch-fix-memcpy.diff

# error: ‘struct <anonymous>’ has no member named ‘in_addr’
compiler.blacklist-append \
                    *gcc-4.0 *gcc-4.2

platform darwin {
    # https://github.com/rofl0r/proxychains-ng/issues/579
    if {${os.major} > 22 && [string match *clang* ${configure.compiler}]} {
        configure.cflags-append \
                    -Wno-error=incompatible-function-pointer-types
    }
}

destroot.target-append install-config
