# -*- 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.3.0
revision            0

categories          graphics devel
platforms           any
supported_archs     noarch
license             wxwidgets-3.1
maintainers         nomaintainer

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  d9949d6c856f2927d098fd1d8a082f0403b7022f \
                    sha256  06ae586fc13e1f2f7240e0067d6c1269cf62bdb814e6ebc6b8c40117984ebd8a \
                    size    38996 \
                    wx.bkl \
                    rmd160  4b7d1964b64df23fd073eb55356965bcd4013c98 \
                    sha256  95fec6e289a3fc106ebcc7cef0091fbba3b9ff0b292631d381eda0e7d0e1d17d \
                    size    21496 \
                    wx_presets.py \
                    rmd160  a640c4c7fc6f7568d3af4ff37a3f1bb7bb771024 \
                    sha256  b306047d3668ddaf5c178f5dcf66342983bd564a5fa43a23997a837f3103aadb \
                    size    464 \
                    wx_unix.bkl \
                    rmd160  0a6aa6e186aad11baf628735d012f6f1c4cb2425 \
                    sha256  38ce8e7f757bc87db7e17cb4bcaddcab3354165cf5ef7995e29f64220c7c08e2 \
                    size    10527 \
                    wx_win32.bkl \
                    rmd160  5444a0736e426923caedc1c155f8065b79f09b43 \
                    sha256  e4e1b6654a816046c641b06ad6b8a998078556ceaaf580327122eb0c4cc18b15 \
                    size    15910 \
                    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/refs/tags/v([0-9.]+).tar.gz}
