# Description: Cross-platform C++ GUI toolkit for Unix, Windows and Mac OS X.
# URL: https://www.fltk.org/
# Maintainer: John McQuah, jmcquah at disroot dot org
# Depends on: alsa-lib libjpeg-turbo mesa util-linux xorg-libxft xorg-libxinerama

name=fltk
version=1.3.8
release=1
source=(https://fltk.org/pub/$name/$version/$name-$version-source.tar.bz2)

build() {
	cmake -S $name-$version -B build $PKGMK_FLTK -G Ninja \
		-D CMAKE_INSTALL_PREFIX=/usr \
		-D FLTK_LIBDIR=/usr/lib \
		-D CMAKE_BUILD_TYPE=Release \
		-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
		-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
		-D OPTION_CREATE_LINKS=ON \
		-D OPTION_BUILD_SHARED_LIBS=ON \
		-D OpenGL_GL_PREFERENCE=GLVND \
		-D OPTION_BUILD_HTML_DOCUMENTATION=OFF \
		-Wno-dev

	ninja -C build -j ${JOBS:-1}
	DESTDIR=$PKG ninja -C build install
}
