### this file is sourced not run

pkgname=dunst

PKGVER=1.9.0
PKGBUILD=2
PKGARCH=x86_64

# source: step
TARBALL=dunst-$PKGVER.tar.gz
MD5SUM=adc41478b74f7f80cd9a569c9fc07e0c
SRC_URL=https://github.com/dunst-project/dunst/archive/v$PKGVER.tar.gz
BUNDLE=

SLACKREQ='dbus libXinerama libXrandr libXScrnSaver glib pango cairo
libnotify gdk-pixbuf'
# line above: dunstify's REQ
# also REQ package fatdog-scripts for:
# . /usr/local/bin/defaultbrowser was substitued for xdg-open
# . /usr/bin/dunst-context-menu.awk was substituted for dmenu

SLACKDESC="$pkgname: $pkgname $PKGVER (Desktop notifications)
$pkgname:
$pkgname: Dunst is a highly configurable and lightweight notification daemon. This
$pkgname: package also provides dunstctl, dunstify (like notify-send but better)
$pkgname: and several examples of custom notifications.
$pkgname:
$pkgname: https://dunst-project.org/
$pkgname: https://github.com/dunst-project/dunst
"

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/dunst* &&

	# this is to make notifications under Compiz dismissible by mouse click
	sed -i -e 's/ButtonRelease/ButtonPress/' src/x11/x.c &&

	# for older libnotify
	sed -i -e '/notify_notification_new/ s|icon)|icon,NULL)|' dunstify.c &&

	# make Action of `-A Action,Label` claim extra commas
	patch -Ni ../pkg/dunstify-action-label.patch &&

	# make /etc/xdg/dunst/dunstrc our own
	patch -Ni ../pkg/dunstrc-fatdog.patch &&

	true
}
### default pkg_package

### build
pkg_build() {
	cd /tmp/dunst* || return 1

	makeflags="PREFIX=/usr
	SYSCONFDIR=/etc/xdg
	SYSCONF_FORCE_NEW=1
	SYSTEMD=0
	WAYLAND=0"

	# build
	PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/$LIBDIR/pkgconfig # location of old libnotify
	make $MAKEFLAGS $makeflags EXTRA_CFLAGS= &&
	make $MAKEINSTALLFLAGS $makeflags install &&
	pkg_build_slackdesc &&

	install -D -m755 -t /usr/share/dunst/examples /tmp/pkg/examples/* &&
	true
}

# vim:ft=sh:
 
