SUMMARY="A CSS parser and selection engine" 
DESCRIPTION="
LibCSS is a CSS (Cascading Style Sheet) parser and selection engine.
" 
HOMEPAGE="http://www.netsurf-browser.org/projects/libcss/"
COPYRIGHT="2007-2014 J-M Bell"
LICENSE="MIT"
SOURCE_URI="http://download.netsurf-browser.org/libs/releases/libcss-$portVersion-src.tar.gz"
CHECKSUM_SHA256="ecaa09b07d4ecfd4644163bc0f0332b81aaaffbb9a373465e15e44e06666faf1"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PATCHES="libcss-0.3.0.patchset"

PROVIDES="
	libcss$secondaryArchSuffix = $portVersion
	lib:libcss$secondaryArchSuffix = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libparserutils${secondaryArchSuffix}
	lib:libwapcaplet${secondaryArchSuffix}
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libparserutils${secondaryArchSuffix} >= 0.2.0
	devel:libwapcaplet${secondaryArchSuffix} >= 0.2.1
	devel:libiconv
	"

BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:perl
	cmd:pkg_config$secondaryArchSuffix
	netsurf_buildsystem >= 1.3
	"

BUILD()
{
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir
}

INSTALL()
{
	make install PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir
	mkdir -p $developLibDir

	prepareInstalledDevelLib libcss
	fixPkgconfig
	
	# devel package
	packageEntries devel $developDir
}

TEST()
{
	make test PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		LDFLAGS="-liconv -lwapcaplet -lparserutils"
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	libcss${secondaryArchSuffix}_devel = $portVersion
	devel:libcss$secondaryArchSuffix = $portVersion
"
