# Template file for 'dwm'
pkgname=dwm
version=6.2
revision=2
makedepends="libXinerama-devel libXft-devel freetype-devel"
short_desc="Dynamic window manager for X"
maintainer="Tuxliban Torvalds <tenshalito@gmail.com>"
license="MIT"
homepage="http://dwm.suckless.org"
distfiles="https://dl.suckless.org/dwm/dwm-${version}.tar.gz"
checksum=97902e2e007aaeaa3c6e3bed1f81785b817b7413947f1db1d3b62b8da4cd110e
patch_args="-Np1"

do_build() {
	[ -e ${FILESDIR}/config.h ] && cp ${FILESDIR}/config.h config.h
	sed -i "/CFLAGS/s|\${CPPFLAGS}|& $CFLAGS|g" config.mk
	sed -i "/LDFLAGS/s|\-s|$LDFLAGS|g" config.mk
	make CC=$CC INCS="-I. -I${XBPS_CROSS_BASE}/usr/include/freetype2" LIBS="-lX11 -lXinerama -lXft -lfontconfig"
}

do_install() {
	make PREFIX=/usr DESTDIR=$DESTDIR install
	vinstall README 644 usr/share/doc/$pkgname
	vinstall ${FILESDIR}/dwm.desktop 644 usr/share/xsessions
	vlicense LICENSE
}
