# SliTaz package receipt.

PACKAGE="nitrogen"
VERSION="1.6.1"
CATEGORY="x-window"
TAGS="wallpaper"
SHORT_DESC="A background browser and setter for X windows."
MAINTAINER="mallory@sweetpeople.org"
LICENSE="GPL2"
WEB_SITE="https://github.com/l3ib/nitrogen"

TARBALL="$PACKAGE-$VERSION.tar.gz"
WGET_URL="$WEB_SITE/releases/download/$VERSION/$TARBALL"

DEPENDS="gcc-lib-base gtkmm libpng"
BUILD_DEPENDS="cairomm-dev glib-dev gtk+-dev gtkmm gtkmm-dev libpng-dev 
	pkg-config xorg-libXinerama-dev"

current_version()
{
	wget -O - ${WGET_URL%/down*} 2>/dev/null | \
	sed '/archive.*tar/!d;s|.*/\(.*\).tar.*|\1|;q'
}

# Rules to configure and make the package.
compile_rules()
{
	# Binutils 2.22 break many packages build without LDFLAGS set correctly.
	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
	
	sed -e '/png.h/d' < src/Thumbview.cc > src/Thumbview.cc.patched
#	mv src/Thumbview.cc.patched src/Thumbview.cc

	./configure				\
		--prefix=/usr			\
		--infodir=/usr/share/info	\
		--mandir=/usr/share/man		\
		$CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	mkdir -p $fs/usr/share/pixmaps

	cp -a $install/usr/bin	$fs/usr
	cp -a $install/usr/share/icons/hicolor/32x32/apps/nitrogen.png \
				$fs/usr/share/pixmaps/
}