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

# getline, MAP_ANON
legacysupport.newest_darwin_requires_legacy 14

# Commit-based until next release, to avoid numerous patches.
github.setup        alba4k albafetch 430291185a85a018bea5832e6dac5ccbad1c3f6f
version             4.2.1
revision            0

description         Faster neofetch alternative, written in C
long_description    ${name} is a simple and fast program to display \
                    a lot of system information in a neofetch-like layout \
                    in way less than a second.

categories          sysutils
installs_libs       no
license             MIT
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer

checksums           rmd160  6d4a5a959a31a108b1d7eba9ee7a3b0ec68de8f1 \
                    sha256  afee8da46c7d492736b7bd1ed8da4cd5f60b9228249d36a500fcdb0e4adec5db \
                    size    368259
github.tarball_from archive

use_configure       no

patchfiles-append   0001-Fix-Makefile.patch

post-patch {
    reinplace "s|@DESTDIR@|${destroot}${prefix}|" ${worksrcpath}/Makefile
}

if {${os.platform} eq "darwin" && ${os.major} < 15} {
    patchfiles-append \
                    0002-meson.build-legacysupport.patch

    post-patch {
        reinplace "s|@PREFIX@|${prefix}|" ${worksrcpath}/meson.build
    }
}

# Yes, it is called from a Makefile.
depends_build-append \
                    port:meson

if {${os.platform} ne "darwin"} {
    depends_build-append \
                    path:bin/pkg-config:pkgconfig
    depends_lib-append \
                    port:pciutils
}

compiler.c_standard 1999
