# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

pkgname=wxGTK3
pkgver=3.2.8
pkgrel=1slint
arch=(x86_64)
url='https://wxwidgets.org'
license=(custom:wxWindows)
makedepends=(cmake
             git
             glu
             gst-plugins-base
             libmspack
             libnotify
             nanosvg
             qt5-base
             sdl2
             webkit2gtk-4.1)
source=(https://github.com/wxWidgets/wxWidgets/releases/download/v$pkgver/wxWidgets-$pkgver.tar.bz2)
sha256sums=('390e871fcf431d8ad75da61d814dac050ea86cb36e5d95a1e687ffa903f35442')
slackdesc=(\
"$pkgname (cross-platform GUI toolkit)"
"wxGTK3 is part of wxWidgets, a cross-platform API for writing GUI"
"applications on multiple platforms that still utilize the native"
"platform's controls and utilities."
""
"http://wxwidgets.org")
docs=("license.txt" "gpl.txt" "lgpl.txt" "licencedoc.txt" "preamble.txt" "xserver.txt" "README.md")
build() {
  pandoc -f gfm -t html5 -o wxWidgets-$pkgver/README.html wxWidgets-$pkgver/README.md || exit
  cmake -B build-gtk3 -S wxWidgets-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=None \
    -DwxBUILD_TOOLKIT=gtk3 \
    -DwxUSE_OPENGL=ON \
    -DwxUSE_REGEX=sys\
    -DwxUSE_ZLIB=sys \
    -DwxUSE_EXPAT=sys \
    -DwxUSE_LIBJPEG=sys \
    -DwxUSE_LIBPNG=sys \
    -DwxUSE_LIBTIFF=sys \
    -DwxUSE_LIBLZMA=sys \
    -DwxUSE_NANOSVG=sys \
    -DwxUSE_LIBMSPACK=ON \
    -DwxUSE_PRIVATE_FONTS=ON \
    -DwxUSE_GTKPRINT=ON
  cmake --build build-gtk3

# Run configure to generate the Makefile, cmake doesn't install translations
  cd wxWidgets
  ./configure --prefix=/usr --disable-tests
  make -j9 -C locale allmo

  DESTDIR="$PKG" cmake --install build-gtk3
}
