1SUMMARY="A native serial library for java serial communication"
2DESCRIPTION="RXTX is a Java library, using a native implementation (via JNI), \
3providing serial and parallel communication for the Java Development Toolkit \
4(JDK). All deliverables are under the GNU LGPL license. It is based on the \
5specification for Sun Java Communications API, though while many of the class \
6descriptions are the same the package used it not, since gnu.io is used \
7instead. A certain amount of compatibility is intended with API, though this \
8project should be considered as a fork and therefore compatible in spirit, \
9but not in implementation."
10HOMEPAGE="http://rxtx.qbang.org"
11COPYRIGHT="1998-2006 Keane Jarvi"
12LICENSE="GNU GPL v2"
13REVISION="3"
14SOURCE_URI="https://github.com/arduino/RXTX/archive/84a009cbb5fe2d56f828aa1e0b1301c065ea5409.tar.gz"
15CHECKSUM_SHA256="bb3c00d489407e88f6a025930c9b218ed4261c1bcebe8e4bb7d63c95c2cae90b"
16SOURCE_DIR="RXTX-84a009cbb5fe2d56f828aa1e0b1301c065ea5409"
17PATCHES="rxtx-2.2_haiku-support.patch"
18
19ARCHITECTURES="all !x86_gcc2"
20SECONDARY_ARCHITECTURES="x86"
21
22PROVIDES="
23	rxtx$secondaryArchSuffix = $portVersion
24	lib:librxtxSerial$secondaryArchSuffix = 0.0.0 compat >= 0
25	"
26REQUIRES="
27	haiku$secondaryArchSuffix
28	openjdk8$secondaryArchSuffix
29	"
30
31BUILD_REQUIRES="
32	haiku${secondaryArchSuffix}_devel
33	openjdk8$secondaryArchSuffix
34	"
35BUILD_PREREQUIRES="
36	openjdk8$secondaryArchSuffix
37	cmd:aclocal
38	cmd:autoconf
39	cmd:find
40	cmd:gcc$secondaryArchSuffix
41	cmd:javac
42	cmd:javah
43	cmd:ld$secondaryArchSuffix
44	cmd:libtoolize
45	cmd:make
46	"
47
48BUILD()
49{
50	sed -i 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/' configure.in
51	libtoolize --force --copy --install
52	aclocal
53	autoconf
54	runConfigure ./configure CPPFLAGS="-I/boot/system/lib/x86/openjdk/include/haiku"
55	make
56}
57
58INSTALL()
59{
60	mkdir -p $libDir/openjdk/jre/lib/i386
61	cp i586-pc-haiku/.libs/librxtxSerial-2.2.so $libDir/openjdk/jre/lib/i386
62	cp i586-pc-haiku/.libs/librxtxSerial.so $libDir/openjdk/jre/lib/i386
63
64	mkdir -p $libDir/openjdk/jre/lib/ext
65	cp RXTXcomm.jar $libDir/openjdk/jre/lib/ext
66}
67