# -*- 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           cmake 1.1
PortGroup           github 1.0

github.setup        hyprwm hyprutils 0.2.4 v
revision            0
categories          devel
license             BSD
maintainers         nomaintainer
description         C++ library for utilities used across the Hypr* ecosystem
long_description    ${name} is a small {*}${description}.
checksums           rmd160  4cbd394811022c9860caf5bee784090a8dc85ad2 \
                    sha256  ce8455a7bb74e2266910f9a3c1fcbcc9fa4317ca057ba6e8fbf79ec95c8ef699 \
                    size    23619
github.tarball_from archive

depends_build-append \
                    path:bin/pkg-config:pkgconfig
depends_lib-append  port:libpixman

# The port requires C++23, and builds either on macOS 13+ with clangs,
# or on old systems which can use libstdc++ with modern gcc.
platforms           {darwin < 11 > 21}

# https://github.com/hyprwm/hyprutils/commit/d504d45114ad96cc143bcc2107529b2bf544f248
patchfiles-append   d504d45114ad96cc143bcc2107529b2bf544f248.patch

# Match settings of hyprlang port.
compiler.cxx_standard       2020
compiler.blacklist-append   {clang} {macports-clang-1[1-6]}
if {${configure.cxx_stdlib} eq "libc++"} {
    compiler.blacklist-append \
                            macports-gcc-13
}

configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF

test.run            yes
