# -*- 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
# $Id: Portfile 89881 2012-02-14 02:13:33Z takanori@macports.org $

PortSystem      1.0

name            dvipng
version         1.14
revision        2

categories      tex
maintainers     dports openmaintainer
description     a DVI-to-PNG converter
long_description \
    This program makes PNG and/or GIF graphics from DVI files as obtained \
    from TeX and its relatives. It is intended to produce anti-aliased    \
    screen-resolution images as fast as is possible.

homepage        http://savannah.nongnu.org/projects/dvipng/
platforms       darwin
license         LGPL

master_sites    sourceforge

checksums       rmd160  df1ac7709c7a2c81dd28bfc5cfbaf69a35ba6f64 \
                sha256  43f5b57d0fab29398dcec1b849e8bebbcacb0b9c06875d2ac84a049be3c5b350

patchfiles      patch-special.c.diff

depends_build   port:texinfo
depends_lib     port:gd2 \
                port:texlive-bin \
                port:texlive-basic \
                port:freetype \
                port:t1lib \
                port:libpng \
                port:bzip2 \
                port:ghostscript

# texlive-bin-extra used to contain dvipng before it was split off
# into this port; deactivate old version to prevent conflict
pre-activate {
    if { ![catch {set vers [lindex [registry_active texlive-bin-extra] 0]}]
         && ([vercmp [lindex $vers 1] 23089] < 0
             || [vercmp [lindex $vers 1] 23089] == 0
             && [lindex $vers 2] < 1)} {
        set deactivate_proc registry_deactivate_composite
        if {[info commands registry_deactivate_composite] == {}} {
            set deactivate_proc registry_deactivate
        }
        $deactivate_proc texlive-bin-extra "" [list ports_nodepcheck 1]
    }
}
