SUMMARY="library for processing UTF-8 encoded Unicode strings"
DESCRIPTION="utf8proc is a small, clean C library that provides Unicode \
normalization, case-folding, and other operations for data in the UTF-8 \
encoding, supporting Unicode version 7.0."
LICENSE="MIT"
REVISION="1"
HOMEPAGE="http://julialang.org/utf8proc/"
COPYRIGHT="2006-2013 Public Software Group"

SOURCE_URI="http://download.netsurf-browser.org/libs/releases/libutf8proc-1.1.6-src.tar.gz"
CHECKSUM_SHA256="16e0dacf459bf42098614b714a262633de26ba5a03f05812d6d052c9aeeac384"
PATCHES="libutf8proc-1.1.6.patchset"

ARCHITECTURES="x86_gcc2 x86 x86_64"

PROVIDES="
	libutf8proc = $portVersion
	lib:libutf8proc = 1.1.6 compat >= 1
	"

PROVIDES_devel="
	libutf8proc_devel = $portVersion
	devel:libutf8proc = 1.1.6 compat >= 1
"

REQUIRES="
	haiku
"

BUILD_PREREQUIRES="
	haiku_devel
	netsurf_buildsystem
	cmd:gcc
	cmd:make
"

BUILD()
{
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem
	make PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		COMPONENT_TYPE=lib-shared
}

INSTALL()
{
	make install PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir LIBDIR=$relativeLibDir
	make install PREFIX=$prefix NSSHARED=/system/data/netsurf-buildsystem \
		INCLUDEDIR=$relativeIncludeDir LIBDIR=$relativeLibDir COMPONENT_TYPE=lib-shared

	mkdir -p $prefix/develop/lib

	prepareInstalledDevelLib libutf8proc
	fixPkgconfig

	packageEntries devel $developDir
}
