# -*- 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 107377 2013-06-26 18:15:45Z michaelld@macports.org $

PortSystem          1.0
PortGroup           qt4 1.0
PortGroup           python 1.0

name                py-qscintilla

# WARNING: The version of these python bindings must match the version
#          number of the installed qscintilla port, or configure/building
#          will fail with strange error messages.
version             2.7.2
revision            1

categories          python devel
license             {GPL-2 GPL-3}
maintainers         michaelld openmaintainer
description         Python bindings for QScintilla
homepage            http://www.riverbankcomputing.com/software/qscintilla/
platforms           darwin

long_description    Python bindings for QScintilla, \
                    a port to Qt of Neil Hodgson's Scintilla C++ editor control.

dist_subdir         qscintilla
distname            QScintilla-gpl-${version}
master_sites        sourceforge:pyqt

checksums           md5     0fbfb06078f206a241a62c94861cce21 \
                    sha1    2a11fb6be2c3005bc6502f929a0a339d4303af9b \
                    rmd160  09552e7c41695822e7eebf86781901c7de90e521

python.versions     24 25 26 27 31 32 33
python.default_version 27

if {$subport != $name} {

   depends_lib-append  port:qscintilla port:py${python.version}-pyqt4
   
   universal_variant   no
   use_configure       yes

   set python_ver_dot [join [split ${python.version} ""] "."]

   configure.pre_args
   configure.dir       ${worksrcpath}/Python
   configure.cmd       ${python.bin} configure.py \
       --sip=${prefix}/bin/sip-${python_ver_dot} \
       --pyqt-sipdir=${prefix}/share/py${python.version}-sip/PyQt4 \
       --apidir=${qt_data_dir}/qsci

   build.dir           ${worksrcpath}/Python
   build.cmd           make
   build.target

   destroot.dir        ${worksrcpath}/Python
   destroot.cmd        ${build.cmd}
   destroot.destdir

   post-destroot {
       move ${destroot}${qt_data_dir}/qsci/api/python/QScintilla2.api \
           ${destroot}${qt_data_dir}/qsci/api/python/QScintilla2-Python${python_ver_dot}.api
   }
}

livecheck.type      regex
livecheck.url       ${homepage}download
livecheck.regex     >QScintilla-gpl-\(\\d+.\\d+.\\d+\).tar.gz<
