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

name                parallel
version             20260222
revision            0
checksums           rmd160  09a82d1950a572a2323932368ee2b8a5c6fc5ac4 \
                    sha256  c6272a48972a0f2fdd3f39560d698f3c5abd3d8a4de40d52f9772f3a03ae1f48 \
                    size    2690409

categories          sysutils
license             GPL-3+
maintainers         {ciserlohn @ci42} \
                    {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer
supported_archs     noarch
platforms           any

description         GNU parallel: Shell command parallelization utility

long_description    Build and execute shell command lines from standard input in parallel

homepage            https://www.gnu.org/software/parallel/
master_sites        gnu
use_bzip2           yes

depends_lib         port:perl5

post-patch {
    set perl_bin ${prefix}/bin/perl
    set src_dir ${worksrcpath}/src/
    foreach f [list ${src_dir}niceload ${src_dir}sql ${src_dir}parallel.pod \
                   ${src_dir}niceload.pod ${src_dir}sem.pod ] {
        reinplace "s|/usr/bin/perl|${perl_bin}|" ${f}
    }
    foreach f [list ${src_dir}sem ${src_dir}parallel] {
        reinplace "s|/usr/bin/env perl|${perl_bin}|" ${f}
    }
    foreach f [list ${src_dir}parallel ${src_dir}parallel.1 \
                   ${src_dir}parallel.pod ${src_dir}parallel.html \
                   ${src_dir}sql ${src_dir}sem ${worksrcpath}/NEWS] {
        reinplace "s|/usr/bin/parallel|${prefix}/bin/parallel|" ${f}
    }
}

build.env-append    HOME=${workpath} SHELL=sh
