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

name            libsdl2_image
github.setup    libsdl-org SDL_image 2.8.12 release-
categories      devel graphics
license         zlib
maintainers     {jmr @jmroot} openmaintainer
description     Add on library for libSDL handling several image formats

long_description \
    This is a simple library to load images of various formats as SDL surfaces. \
    This library supports BMP, PPM, PCX, GIF, JPEG, PNG, TGA, and TIFF formats.

github.tarball_from releases
distname        SDL2_image-${version}

checksums       rmd160 15ca6b35de0a22c80653c08c54ecfe9819260e8d \
                sha256 393f5efb50536ec13ca4f4affb69cc9966d3c3f969e6c5e701faddf9f9785381

depends_build   path:bin/pkg-config:pkgconfig
depends_lib     port:libsdl2 \
                port:tiff \
                port:webp

configure.args  --disable-avif \
                --disable-imageio \
                --disable-jxl \
                --disable-sdltest \
                --disable-tif-shared \
                --disable-webp-shared

compiler.blacklist *gcc-4.* { clang < 211 }

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} CHANGES.txt LICENSE.txt README.txt \
        ${destroot}${docdir}
}

variant jxl description {Enable JPEG XL support (experimental)} {
    depends_lib-append  port:libjxl
    configure.args-replace  --disable-jxl \
                            --enable-jxl
    configure.args-append   --disable-jxl-shared
}

github.livecheck.regex  {(2\.[^"]+)}
