# -*- 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
PortGroup               python 1.0

name                    py-pyepl
version                 1.0.29
revision                1
license                 GPL-2+
platforms               darwin
maintainers             nomaintainer

description             PyEPL (the Python Experiment-Programming Library) is a library for coding psychology experiments in Python. (awcard support disabled)

long_description        ${description}.  It supports presentation of both visual and auditory stimuli, and supports both manual (keyboard/joystick) and sound (microphone) input as responses.

homepage                http://pyepl.sourceforge.net/
     
distname                pyepl-${version}
master_sites            sourceforge:pyepl
extract.suffix          .tgz

checksums               md5     009e5a537bcf27b8810afa416487a8d6 \
                        sha1    bd84ad6b765e5aa49e5da3ab0c8ebdd0fd6b14b6 \
                        rmd160  7a83e6c0359e9b9ba856575e7d881a0770e8a57b

python.versions         27

if {${name} ne ${subport}} {
    depends_lib             port:libsndfile \
                            port:libsamplerate \
                            port:swig-python \
                            port:py${python.version}-numpy \
                            port:py${python.version}-opengl \
                            port:py${python.version}-pyrex \
                            port:py${python.version}-ode \
                            port:py${python.version}-game

    patchfiles              patch-setup.py.diff \
                            patch-code-hardware-Makefile.diff \
                            patch-code-hardware-sound-Makefile.diff \
                            patch-code-hardware-vr-Makefile.diff \
                            cflags.diff

    pre-configure {
      reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/setup.py  
      reinplace "s|\"_awCard.so\"|\"_awCard.so\", \"awCard.py\"|g" ${worksrcpath}/setup.py
  
      reinplace "s|@@PYTHON.INC@@|${python.include}|g" ${worksrcpath}/code/hardware/Makefile
  
      reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/code/hardware/sound/Makefile
  
      reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/code/hardware/vr/Makefile
  
      reinplace "s|@@PYTHON@@|${python.bin}|g" ${worksrcpath}/code/hardware/vr/Makefile
  
      set hroot "${worksrcpath}/code/hardware"
      foreach {i} {/eeg/pulse /eeg/scalp /rt /sound /vr} {
        reinplace "s|shell python|shell ${python.bin}|g" ${hroot}${i}/Makefile  
      }
  
      reinplace "s|-law|-L${prefix}/lib -law|g" ${worksrcpath}/code/hardware/eeg/pulse/Makefile
    }
    livecheck.type  none
} else {
    livecheck.url   http://git.debian.org/?p=pkg-exppsy/pymvpa.git
    livecheck.regex {upstream\/([0-9.]+)}
}