# -*- 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             meson 1.0
PortGroup             legacysupport 1.1

# error: use of undeclared identifier 'strnlen'
legacysupport.newest_darwin_requires_legacy 10

github.setup          dosbox-staging dosbox-staging 0.80.1 v
github.tarball_from   archive
revision              1

categories            emulators
license               GPL-3+
maintainers           {@kakuhen} openmaintainer
description           A modernized fork of the DOSBox emulator
long_description      DOSBox Staging is a fork of the DOSBox project that \
    focuses on ease of use, modern technology and best practices. This fork \
    attempts to modernize the DOSBox codebase by using current development \
    practices and tools, fixing issues, and adding features that better \
    support today's systems.

checksums             rmd160  dc587d2f09d0125e28b55b461a3f10db9fb9763c \
                      sha256  2ca69e65e6c181197b63388c60487a3bcea804232a28c44c37704e70d49a0392 \
                      size    3876041

depends_build-append  port:ccache \
                      path:bin/cmake:cmake \
                      port:pkgconfig

depends_lib-append    port:fluidsynth \
                      port:iir1 \
                      port:libpng \
                      port:libsdl2 \
                      port:libsdl2_image \
                      port:libsdl2_net \
                      port:libslirp \
                      port:munt-mt32emu \
                      port:opusfile \
                      port:speexdsp \
                      port:zlib

compiler.cxx_standard 2017

# error: no member named 'merge' in 'std::__1::set<ChannelFeature
compiler.blacklist-append {clang < 1002}

variant debug description {Provides a debug build of the software} {
    configure.args-append -Dbuildtype=debug
}

if {![variant_isset debug]} {
    configure.args-append -Dbuildtype=release
}

# Do not download any subprojects
meson.wrap_mode       nodownload

# Disable OpenGL, as it causes assertion failures
configure.args-append -Duse_opengl=false

# For some reason, zlib flags do not get added by Meson. This helps prevent
# linker errors when object files reference symbols like "_deflate".
configure.ldflags-append -lz
