# -*- 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 61556 2009-12-14 21:37:06Z jmr@macports.org $

PortSystem        1.0

name              mdk
version           1.2.5
categories        lang
maintainers       gmail.com:aconchillo
platforms         darwin
description       A set of utilities for developing programs using MIX and \
                  MIXAL
long_description  MDK stands for MIX Development Kit, and provides \
                  tools for developing and executing, in a MIX virtual \
                  machine, MIXAL programs. \
                  \
                  The MIX is Donald Knuth's mythical computer, \
                  described in the first volume of The Art of Computer \
                  Programming, which is programmed using MIXAL, the MIX \
                  assembly language. \
                  \
                  MDK includes a MIXAL assembler (mixasm) and a MIX \
                  virtual machine (mixvm) with a command line \
                  interface. In addition, a GTK+ GUI to mixvm, called \
                  gmixvm, and a Guile interpreter with an embedded MIX \
                  virtual machine called mixguile, are provided. \
                  \
                  Using these interfaces, you can debug your MIXAL \
                  programs at source code level, and read/modify the \
                  contents of all the components of the MIX computer \
                  (including block devices, which are simulated using \
                  the file system).
homepage          http://www.gnu.org/software/mdk/mdk.html
master_sites      gnu:mdk/v${version}/
checksums         md5 7dce75b47695ef90ff3abfaf4e3d77fc \
                  sha1 2d314351bc4dc88bce4644c6d22fd1131996fb47

use_automake      yes
use_autoconf      yes
depends_build     path:bin/pkg-config:pkgconfig \
                  port:autoconf \
                  port:automake \
                  port:libtool

depends_lib       port:guile \
                  path:lib/pkgconfig/glib-2.0.pc:glib2 \
                  port:gmp \
                  port:bison \
                  port:gettext \
                  port:libiconv \
                  port:readline \
                  port:ncurses \
                  port:libtool \
                  port:intltool

patchfiles        patch-lib-Makefile.am \
                  patch-lib-foo.c

configure.cflags-append ${configure.cppflags}
configure.args    --disable-gui \
                  --mandir=${prefix}/share/man \
                  --infodir=${prefix}/share/info

use_parallel_build no
build.type        gnu

post-extract {
             system "touch ${worksrcpath}/lib/foo.c"
             system "cd ${worksrcpath} && aclocal -I m4"
}

variant gui description "Build the GTK+ user interface" {
   configure.args-delete  --disable-gui
   depends_lib-append     port:gtk2 \
                          port:libglade2

   patchfiles-append patch-mixgtk-Makefile.am
}
