# -*- 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        distcc distcc 3.4 v
revision            1
checksums           rmd160  7d0fbbcffc28ec53e580f0da18d6370daec04b55 \
                    sha256  2b99edda9dad9dbf283933a02eace6de7423fe5650daa4a728c950e5cd37bd7d \
                    size    1239519

categories          devel net
platforms           darwin
maintainers         nomaintainer
license             GPL-2+

description         Distributed C compiler

long_description    distcc is a program to distribute compilation of C or \
                    C++ code across several machines on a network without \
                    requiring that they share filesystems, have the same \
                    headers/libraries or have syncronized clocks. distcc \
                    should always generate the same results as a local \
                    compile but is often 2 to 3 times faster.

github.tarball_from releases

post-patch {
    reinplace "s|^#! */usr/bin/env python3$|#!${configure.python}|" \
                    ${worksrcpath}/update-distcc-symlinks.py \
                    {*}[glob ${worksrcpath}/include_server/*.py]
}

configure.universal_args-delete --disable-dependency-tracking

configure.args-append \
                    --disable-Werror \
                    --without-avahi \
                    --without-libiberty

set pyver 3.13
set python_version [join [split ${pyver} "."] ""]
configure.python ${prefix}/bin/python${pyver}

depends_build-append \
                    port:py${python_version}-setuptools

depends_lib-append  port:python${python_version} \
                    port:popt

notes {
    If you are upgrading from a distcc version before 3.3, you must run\
    update-distcc-symlinks on every server machine, and add manually\
    (see MASQUERADING of distcc(1)) those compilers it does not detect.
}
