SUMMARY="QR Code encoding library - KDL support"
DESCRIPTION="
qrencode is a library for encoding data in a QR Code symbol, a kind of 2D \
symbology that can be scanned by handy terminals such as a mobile phone with \
CCD. The capacity of QR Code is up to 7000 digits or 4000 characters, and has \
high robustness.

This version of qrencode is build specifically for use in Haiku's Kernel \
Debugger. It can be used as a way to export kernel messages when you don't \
have a serial port on the debugged machine.
"
HOMEPAGE="http://fukuchi.org/works/qrencode/"
COPYRIGHT="2006-2012 Kentaro Fukuchi"
LICENSE="GNU LGPL v2.1"
SOURCE_URI="http://fukuchi.org/works/qrencode/qrencode-$portVersion.tar.gz"
CHECKSUM_SHA256="e794e26a96019013c0e3665cb06b18992668f352c5553d0a553f5d144f7f2a72"
SOURCE_DIR="qrencode-$portVersion"
REVISION="1"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PATCHES="qrencode_kdl-3.4.4.patchset"

PROVIDES="
	qrencode_kdl = $portVersion
	"
BUILD_PREREQUIRES="
	haiku_devel
	cmd:gcc
	cmd:ld
	"

BUILD()
{
	export CFLAGS=""
	gcc -c -static -Dmalloc=debug_malloc -Dcalloc=debug_calloc -Dfree=debug_free \
		-DHAVE_CONFIG_H=1 bitstream.c mask.c mmask.c mqrspec.c qrencode.c qrinput.c \
		qrspec.c rscode.c split.c
	ar rcs libqrencode_kdl.a bitstream.o mask.o mmask.o mqrspec.o qrencode.o qrinput.o \
		qrspec.o rscode.o split.o
}

INSTALL()
{
	mkdir -p $libDir
	mkdir -p $includeDir
	cp libqrencode_kdl.a $libDir/
	cp qrencode.h $includeDir/

	prepareInstalledDevelLibs libqrencode_kdl

	# devel package
	packageEntries devel \
		$developDir
}

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

PROVIDES_devel="
	qrencode_kdl_devel = $portVersion compat >= 3
	devel:libqrencode_kdl = 3.4.4 compat >= 3
	"
REQUIRES_devel="
	haiku
	"
