# -*- 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                wxWidgets-common
version             3.1.2

categories          graphics devel
platforms           darwin
supported_archs     noarch
license             wxwidgets-3.1
maintainers         {mojca @mojca} openmaintainer

description         "wxWidgets: m4 and bakefiles"
long_description    "Files for autotools and bakefiles shared for multiple versions of wxWidgets"
homepage            http://www.wxwidgets.org/

master_sites        https://raw.githubusercontent.com/wxWidgets/wxWidgets/v${version}/:main \
                    https://raw.githubusercontent.com/wxWidgets/wxWidgets/v${version}/build/bakefiles/wxpresets/presets/:bake

distfiles           wxwin.m4:main \
                    wx.bkl:bake \
                    wx_presets.py:bake \
                    wx_unix.bkl:bake \
                    wx_win32.bkl:bake \
                    wx_xrc.bkl:bake

extract.only

dist_subdir         wxWidgets/${version}

checksums           wxwin.m4 \
                    rmd160  49209c06d1d5852ca3c50dd8ec9cc8ae5dcbaf71 \
                    sha256  d6a8e781905b911b39c96ddda58e2b37522da709d75e28df87d37b8e4f3abdbb \
                    size    40400 \
                    wx.bkl \
                    rmd160  4b7d1964b64df23fd073eb55356965bcd4013c98 \
                    sha256  95fec6e289a3fc106ebcc7cef0091fbba3b9ff0b292631d381eda0e7d0e1d17d \
                    size    21496 \
                    wx_presets.py \
                    rmd160  a640c4c7fc6f7568d3af4ff37a3f1bb7bb771024 \
                    sha256  b306047d3668ddaf5c178f5dcf66342983bd564a5fa43a23997a837f3103aadb \
                    size    464 \
                    wx_unix.bkl \
                    rmd160  db4e42372ec0a73f76285eef4af7fdc10aa51e58 \
                    sha256  8fdda613c2cbe7c2f8a9c213fc24227151c535efee4c1d85ff0a6b77bd0dc059 \
                    size    10538 \
                    wx_win32.bkl \
                    rmd160  b76a74129b48e5323676ada672966d2ffbb481d7 \
                    sha256  0fe240c6ff8d1c6634442407370a76f4a99268162a78bbd826abd9715cf675c8 \
                    size    16159 \
                    wx_xrc.bkl \
                    rmd160  059754a4f42fca46e392bdae4aa8611b5c895232 \
                    sha256  6d801e0d5759fbf4a06f07ffcc7defcbf2e1a5b241b36ac68cf44646efb829e8 \
                    size    2194

use_configure       no
build {}

destroot {
    xinstall -m 755 -d ${destroot}${prefix}/share/aclocal
    xinstall -m 755 -d ${destroot}${prefix}/share/bakefile/presets
    xinstall -m 644 ${distpath}/wxwin.m4 ${destroot}${prefix}/share/aclocal
    foreach f {wx.bkl wx_presets.py wx_unix.bkl wx_win32.bkl wx_xrc.bkl} {
        xinstall -m 644 ${distpath}/${f} ${destroot}${prefix}/share/bakefile/presets
    }
}

# TODO: pre-activate step to clean up any remainings/leftovers from wxWidgets_select
#       (I'm not sure about the best way to do this)
pre-activate {
    file delete -force ${prefix}/share/aclocal/wxwin.m4
    foreach f {wx.bkl wx_presets.py wx_unix.bkl wx_win32.bkl wx_xrc.bkl} {
       file delete -force ${prefix}/share/bakefile/presets/${f}
    }
}

livecheck.url       https://github.com/wxWidgets/wxWidgets/tags
livecheck.regex     {archive/v([0-9.]+).tar.gz}