1SUMMARY="Numerical analysis and data processing library"
2DESCRIPTION="ALGLIB is a cross-platform numerical analysis and data \
3processing library. It supports several programming languages (C\+\+, C\#, \
4Delphi) and several operating systems (Windows and POSIX, including Linux).
5
6ALGLIB features include:
7* Data analysis (classification/regression, statistics)
8* Optimization and nonlinear solvers
9* Interpolation and linear/nonlinear least-squares fitting
10* Linear algebra (direct algorithms, EVD/SVD), direct and iterative linear \
11solvers
12* Fast Fourier Transform and many other algorithms"
13HOMEPAGE="https://www.alglib.net/"
14COPYRIGHT="1999-2019 Sergey Bochkanov"
15LICENSE="GNU GPL v2"
16REVISION="1"
17SOURCE_URI="https://www.alglib.net/translator/re/alglib-$portVersion.cpp.gpl.tgz"
18CHECKSUM_SHA256="827b5f559713a3e8c7c1452ed1ffd5227adb9622d1a165ceb70c117c8ed3ccb4"
19SOURCE_DIR="alglib-cpp"
20ADDITIONAL_FILES="CMakeLists.txt.in"
21
22ARCHITECTURES="all !x86_gcc2"
23SECONDARY_ARCHITECTURES="x86"
24
25libVersion="$portVersion"
26libVersionCompat="$libVersion compat >= ${libVersion%.*}"
27
28PROVIDES="
29	alglib$secondaryArchSuffix = $portVersion
30	lib:libalglib$secondaryArchSuffix = $libVersionCompat
31	"
32REQUIRES="
33	haiku$secondaryArchSuffix
34	lib:libgfortran$secondaryArchSuffix
35	lib:libgomp$secondaryArchSuffix
36	"
37
38PROVIDES_devel="
39	alglib${secondaryArchSuffix}_devel = $portVersion
40	devel:libalglib$secondaryArchSuffix = $libVersionCompat
41	"
42REQUIRES_devel="
43	alglib$secondaryArchSuffix == $portVersion base
44	"
45
46BUILD_REQUIRES="
47	haiku${secondaryArchSuffix}_devel
48	"
49BUILD_PREREQUIRES="
50	cmd:cmake
51	cmd:g++$secondaryArchSuffix
52	cmd:make
53	cmd:pkg_config$secondaryArchSuffix
54	"
55
56defineDebugInfoPackage alglib$secondaryArchSuffix \
57	"$libDir"/libalglib.so.$portVersion \
58
59BUILD()
60{
61	# ALGLIB doesn't provide any build system
62	local VERSION="$portVersion"
63	local SOVERSION="`echo ${portVersion%.*}`"
64	sed \
65		-e "s|@VERSION@|$VERSION|" \
66		-e "s|@SOVERSION@|$SOVERSION|" \
67		$portDir/additional-files/CMakeLists.txt.in > CMakeLists.txt
68
69	cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
70		-DBUILD_TEST=ON \
71		$cmakeDirArgs
72	make -C build $jobArgs
73}
74
75INSTALL()
76{
77	make -C build install
78
79	install -m 0755 -d "$developDocDir"
80	install -m 0644 -t "$developDocDir" manual.cpp.html
81
82	prepareInstalledDevelLib libalglib
83
84	packageEntries devel \
85		$developDir
86}
87
88TEST()
89{
90	make -C build test
91}
92