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

# Use legacysupport for provide the definition of AT_FDCWD for 10.9 and earlier.
# See https://trac.macports.org/ticket/65265
PortSystem          1.0
PortGroup           legacysupport 1.1

# <fnctl.h> for identifier 'AT_FDCWD'
# See https://trac.macports.org/ticket/65265
# <time.h> for identifier 'CLOCK_THREAD_CPUTIME_ID'
# See https://trac.macports.org/ticket/73288
legacysupport.newest_darwin_requires_legacy 15

name                lowdown
categories          textproc
version             3.0.1
revision            0
license             BSD

description         simple markdown translator
long_description    lowdown is a Markdown translator producing HTML5, \
                    roff documents in the ms and man formats, LaTeX, \
                    gemini ("gemtext"), OpenDocument, and ANSI/UTF8 \
                    terminal output. The open source C source code \
                    has no dependencies.

homepage            https://kristaps.bsd.lv/lowdown
master_sites        ${homepage}/snapshots
maintainers         {judaew @judaew} openmaintainer

checksums           rmd160  433b221d28fd092139131f02465803f257cd100f \
                    sha256  ac9ea2b51c8bd59350c7bf8db5e2067e9d961b1f48d362cd8a56b022850e965c \
                    size    378740

depends_build-append \
                    port:bmake

configure.universal_args
configure.pre_args  PREFIX=${prefix}
configure.args      MANDIR=${prefix}/share/man
if { ${os.platform} eq "darwin" && ${os.major} <= 14  } {
    configure.args-append LINKER_SOFLAG=-dynamiclib \
                    LINKER_SONAME=-install_name \
                    LINKER_SOSUFFIX=dylib
}

build.cmd           bmake
build.args          LDFLAGS="${configure.ldflags}"

# The install target installs only binaries but does not install the library
# and pkg-config pc file.
destroot.target-append  install_lib_common install_shared
