# $Id: Portfile 50984 2009-05-14 21:08:43Z and.damore@macports.org $

PortSystem        1.0

name              mdk
version           1.2.3
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 1c74ec62c847792706be412289c8152b

depends_build     path:bin/pkg-config:pkgconfig \
                  port:automake

depends_lib       port:guile \
                  port: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 \
                  patch-mixlib-xmix_vm.c

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

build.type        gnu
use_automake      yes
use_autoconf      yes

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

variant gui {
   configure.args-delete  --disable-gui
   depends_lib-append     port:gtk2 \
                          port:libglade2

   patchfiles-append patch-mixgtk-Makefile.am
}

