# -*- 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           gitlab 1.0
PortGroup           makefile 1.0

gitlab.setup        mschwartz phred 762496a0d90c2897de3dc184b22ade576a3f6cff
version             2024.07.25
revision            0
categories          editors
license             BSD
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
description         Themable and small and performant vim-like editor
long_description    {*}${description}, written in C++.
checksums           rmd160  02a67292ab8580e5d904ab11496a82df83c2d0d7 \
                    sha256  5aa76aa791427a511dadd0156645f6859a15478d340c1223b7142e23851b79b2 \
                    size    2566263

patchfiles          patch-Makefile.diff patch-src.diff

# https://gitlab.com/mschwartz/phred/-/merge_requests/38
patchfiles-append   0001-CommandBuffer.cpp-add-missing-header.patch \
                    0002-Git.cpp-add-missing-header.patch

post-patch {
    reinplace "s|@CXX@|${configure.cxx}|g" ${worksrcpath}/Makefile
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/Makefile \
        ${worksrcpath}/src/EmbeddedLua.cpp ${worksrcpath}/src/main.cpp
}

depends_lib-append  port:lua \
                    port:ncurses

compiler.cxx_standard 2020

# https://gitlab.com/mschwartz/phred/-/issues/82
configure.cxxflags-append \
                    -Wno-error=sign-compare -Wno-error=inline

build.env-append    CCOPTS=${configure.cxxflags}

destroot.env-append DESTDIR=${destroot}
