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

# dprintf
legacysupport.newest_darwin_requires_legacy 10

name                sdlbook
github.setup        rofl0r SDLBook f4de11f6994dad55d9e53152fdfe20fc6bb22d6e
version             20250401
revision            2
categories          office
maintainers         {@barracuda156 macos-powerpc.org:barracuda} openmaintainer
license             GPL-3
description         Simple djvu/pdf e-book viewer
long_description    {*}${description} based on djvulibre, libmupdf and SDL.

checksums           rmd160  8339fb146de1655f77bcf36c594d51ba41b6e0ac \
                    sha256  0ca1e2c275c41573ec730a79b2877d6329947f8c0bf87161b15f14d3f41d036a \
                    size    32883
github.tarball_from archive

post-patch {
    reinplace "s|/usr/local|${prefix}|" ${worksrcpath}/Makefile
    # https://github.com/rofl0r/SDLBook/issues/10
    reinplace "s|install -D -m|install -m|" ${worksrcpath}/Makefile
}

depends_lib-append  port:djvulibre \
                    port:libsdl2 \
                    port:mupdf

# link.h:64: error: redefinition of typedef ‘fz_link’
compiler.c_standard 2011

build.args          SDL2=1
