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

codeberg.setup      jschlatow taskopen 2.0.3 v
revision            0

categories          office
license             GPL-2
maintainers         {judaew @judaew} openmaintainer

description         Tool for taking notes and open urls with taskwarrior
long_description    {*}${description}

checksums           rmd160  1e0b42c729dc7f22feefa265f3dc1b2dbfb92fd8 \
                    sha256  8fb69dae0663f2a6e894338e567b7af7bbcff45356c7c7308cf9912edc7c38d6 \
                    size    36508

depends_build-append \
                    port:nim

depends_lib-append  port:pcre \
                    port:vim

# Match Nim:
compiler.c_standard 2011

post-extract {
    xinstall -d ${worksrcpath}/bin
    ln -s ${configure.cc} ${worksrcpath}/bin/gcc
}

build.cmd-prepend   PATH=./bin:${prefix}/bin:${prefix}/sbin:/usr/bin:/usr/sbin:/bin:/sbin

# https://codeberg.org/jschlatow/taskopen/issues/179
destroot {
    xinstall -m 755 ${worksrcpath}/${name} ${destroot}${prefix}/bin/
}

notes "
    If you see an error on launch `could not import: pcre_free_study`,\
    the app picks a wrong pcre library. Set DYLD_LIBRARY_PATH to fix that:

    export DYLD_LIBRARY_PATH=${prefix}/lib:\$DYLD_LIBRARY_PATH
"
