# -*- 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            ddd
version         3.4.0
revision        1
checksums       rmd160  952664d887de7f1f94fe124ac287c340738b723d \
                sha256  5d4cbc8a0bb0458543866d679308c53a3ef066e402fe5a1918e19698a3d3580f \
                size    5742233

categories      devel
license         GPL-3+
maintainers     nomaintainer
description     Data Display Debugger
long_description \
    DDD is a graphical front-end for GDB and other command-line debuggers.
homepage        https://www.gnu.org/software/ddd/
master_sites    gnu

depends_lib \
    port:ncurses \
    lib:libXm:openmotif \
    port:xorg-libXaw \
    port:xorg-libXp

patchfiles      r7360.patch r7410.patch

platform darwin {
    patchfiles-append   patch-fix-crash.diff
}

configure.args  --enable-builtin-manual \
                --enable-builtin-app-defaults

# make will build the executable "ddd" and the X resource file "Ddd" in the same directory,
# as HFS+ is case-insensitive by default, this will loosely FAIL.
build.args      EXEEXT=.exe

# Use unversioned root directory.
build.args-append \
                dddrootdir=${prefix}/share/${name}

destroot.args   {*}${build.args}

post-destroot {
    move ${destroot}${prefix}/bin/ddd.exe ${destroot}${prefix}/bin/ddd
}

livecheck.type  regex
livecheck.url   https://ftp.gnu.org/gnu/${name}/?C=M&O=D
livecheck.regex ${name}-(\\d+(?:\\.\\d+)*)
