# -*- 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            links
version         2.16
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.

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

checksums       rmd160  e1fa96766e914d6205a32664e33cff94f719f8ce \
                sha256  82f03038d5e050a65681b9888762af41c40fd42dec7e59a8d630bfb0ee134a3f \
                size    6697222

maintainers     nomaintainer
use_bzip2       yes

depends_build   port:pkgconfig
depends_lib     path:lib/libssl.dylib:openssl \
                port:bzip2 \
                port:zlib \
                port:xz \
                port:libevent

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

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

variant svg requires x11 description {Enable SVG support} {
    depends_lib-append      port: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      port:jpeg 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}