# SliTaz package receipt.

PACKAGE="tix"
SOURCE="Tix"
VERSION="8.4.3"
CATEGORY="development"
SHORT_DESC="Tk Interface eXtension."
MAINTAINER="pascal.bellard@slitaz.org"
LICENSE="BSD"
TARBALL="$SOURCE$VERSION-src.tar.gz"
WEB_SITE="https://tix.sourceforge.net/"
WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"

DEPENDS="tcl xorg-libX11 xorg-libXau xorg-libXdmcp libxcb"
BUILD_DEPENDS="tcl-dev tk-dev xorg-dev"

# What is the latest version available today?
current_version()
{
	wget -O - https://sourceforge.net/projects/tix/files/tix/ 2>/dev/null | \
	sed '/scope="row/!d;s|.*href="|"https://sourceforge.net|;q' | xargs wget -O - 2>/dev/null | \
	sed '/scope="row/!d;s|.*/tix/||;s|/.*||;q'
}

# Rules to configure and make the package.
compile_rules()
{
	# tcl 8.6 support
	sed -i 's|#include.*tcl\.h.*|#define USE_INTERP_RESULT 1\n&|' \
		generic/tix.h generic/tixPort.h generic/tixUtils.c \
		PyTix-2.0/2.0/_tkinter.c PyTix-2.0/2.0/tkappinit.c
	./configure --prefix=/usr $CONFIGURE_ARGS &&
	make &&
	make DESTDIR=$DESTDIR install
}

# Rules to gen a SliTaz package suitable for Tazpkg.
genpkg_rules()
{
	cp -a $install/usr $fs
}