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

name            links
version         2.30
revision        0
description     Lynx-like WWW browser that supports tables, menus, etc

long_description \
                Lynx-like WWW browser with text and graphics modes with many \
                features like displaying tables, menus, etc.

categories      www
license         GPL-2+
homepage        http://links.twibright.com/
master_sites    http://links.twibright.com/download/

checksums       rmd160  e90763c244fc0e79f0e9ad4ce3d138be3cdc57bb \
                sha256  c4631c6b5a11527cdc3cb7872fc23b7f2b25c2b021d596be410dadb40315f166 \
                size    6569493

maintainers     nomaintainer
use_bzip2       yes

depends_build   path:bin/pkg-config:pkgconfig

depends_lib     port:bzip2 \
                port:libevent \
                port:xz \
                port:zlib

openssl.branch  3

patchfiles      X.patch

configure.args  --disable-graphics \
                --disable-javascript \
                --mandir=${prefix}/share/man \
                --with-ssl \
                --without-libjpeg \
                --without-libpng \
                --without-librsvg \
                --without-libtiff \
                --without-openmp \
                --without-x

configure.checks.implicit_function_declaration.whitelist-append memrchr

post-patch {
    reinplace s|/etc/|${prefix}/etc/| ${worksrcpath}/os_dep.h
}

variant svg requires x11 description {Enable SVG support} {
    depends_lib-append      path:lib/pkgconfig/librsvg-2.0.pc:librsvg
    configure.args-replace  --without-librsvg --with-librsvg
}

variant tiff requires x11 description {Enable TIFF support} {
    depends_lib-append      port:tiff
    configure.args-replace  --without-libtiff --with-libtiff
}

variant x11 {
    depends_lib-append      path:include/turbojpeg.h:libjpeg-turbo port:libpng port:xorg-libXt
    configure.args-replace  --disable-graphics --enable-graphics
    configure.args-replace  --without-libjpeg --with-libjpeg
    configure.args-replace  --without-libpng  --with-libpng
    configure.args-replace  --without-x --with-x
}

livecheck.type  regex
livecheck.url   [lindex ${master_sites} 0]
livecheck.regex {links-([0-9.]+)\.tar\.bz2}
