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

name                    webp
version                 1.6.0
revision                0
checksums               rmd160  dbe9eebcc201d67675e7c9da74e502b69d158d96 \
                        sha256  e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564 \
                        size    4296070

categories              graphics science devel
maintainers             {ryandesign @ryandesign} openmaintainer
license                 BSD

description             image format library providing lossy compression \
                        for photographic images

long_description        WebP is a new image format that provides lossy \
                        compression for photographic images. In a large \
                        scale study of 900,000 web images, WebP images \
                        were 39.8% smaller than jpeg images of similar \
                        quality. \
                        \
                        A WebP file consists of VP8 image data, and a \
                        container based on RIFF. Webmasters, web developers \
                        and browser developers can use the WebP format \
                        to create smaller, better-looking images that can \
                        help make the web faster.

homepage                https://developers.google.com/speed/webp/
master_sites            http://downloads.webmproject.org/releases/webp/

depends_lib             port:giflib \
                        path:include/turbojpeg.h:libjpeg-turbo \
                        port:libpng \
                        port:tiff

distname                libwebp-${version}

patchfiles              configure.patch

configure.args-append   --disable-sdl \
                        --disable-silent-rules \
                        --disable-wic \
                        --enable-gif \
                        --enable-jpeg \
                        --enable-libwebpdecoder \
                        --enable-libwebpdemux \
                        --enable-libwebpextras \
                        --enable-libwebpmux \
                        --enable-png \
                        --enable-tiff

post-destroot {
    set docdir ${destroot}${prefix}/share/doc/${name}
    xinstall -d ${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        AUTHORS \
        ChangeLog \
        COPYING \
        NEWS \
        PATENTS \
        README.md \
        doc/api.md \
        ${docdir}
}

variant debug description {Compile with debugging information and reduce optimization level} {
    configure.optflags -O1
    configure.cflags-append -ggdb
    configure.cxxflags-append -ggdb
}

livecheck.type          regex
livecheck.url           ${homepage}download
livecheck.regex         /libwebp-(\[0-9.\]+)[quotemeta ${extract.suffix}]
