1SUMMARY="A free library of language lexers for use with Scintilla"
2DESCRIPTION="Lexilla is a free library of language lexers that can be used \
3with the Scintilla editing component. It comes with complete source code and \
4a license that permits use in any free project or commercial product.
5Originally, this functionality was incorporated inside Scintilla. \
6It has been extracted as a separate project to make it easier for \
7contributors to work on support for new languages and to fix bugs in existing \
8lexers. It also defines a protocol where projects can implement their own \
9lexers and distribute them as they wish."
10HOMEPAGE="https://scintilla.org"
11COPYRIGHT="1998-2023 Neil Hodgson"
12LICENSE="Scintilla"
13REVISION="1"
14SOURCE_URI="https://prdownloads.sf.net/scintilla/lexilla${portVersion//\./}.tgz"
15CHECKSUM_SHA256="a4ab4e2a2ee79c92ad598c8fecab7c100c30224ccf589bf9173ddf9971ad87d0"
16SOURCE_DIR="lexilla"
17srcGitRev2="e391de7b72f7cc58c8d267524d9581e1a875d6e9"
18SOURCE_URI_2="https://github.com/KapiX/scintilla-haiku-lexers/archive/$srcGitRev2.tar.gz"
19CHECKSUM_SHA256_2="a3a0121dd641355fbb1a5ff8fe8896d574ad809975867a5ffdefc609448194c7"
20SOURCE_DIR_2="scintilla-haiku-lexers-$srcGitRev2"
21SCINTILLA_VERSION="5.3.4"
22SOURCE_URI_3="https://prdownloads.sf.net/scintilla/scintilla${SCINTILLA_VERSION//\./}.tgz"
23CHECKSUM_SHA256_3="3f01b1aef2b7e98f628af2cff965876f5d15ee2801d9df96dd3aced8f087cb46"
24SOURCE_DIR_3="scintilla"
25
26ARCHITECTURES="all !x86_gcc2"
27SECONDARY_ARCHITECTURES="x86"
28
29PROVIDES="
30	lexilla$secondaryArchSuffix = $portVersion
31	lib:liblexilla$secondaryArchSuffix = $portVersion
32	"
33REQUIRES="
34	haiku$secondaryArchSuffix
35	"
36
37PROVIDES_devel="
38	lexilla${secondaryArchSuffix}_devel = $portVersion
39	devel:liblexilla$secondaryArchSuffix = $portVersion
40	"
41REQUIRES_devel="
42	lexilla$secondaryArchSuffix == $portVersion base
43	"
44
45BUILD_REQUIRES="
46	haiku${secondaryArchSuffix}_devel
47	"
48BUILD_PREREQUIRES="
49	makefile_engine
50	cmd:ar
51	cmd:g++$secondaryArchSuffix
52	cmd:make
53	"
54
55BUILD()
56{
57	local SCINTILLA_INCLUDE=$sourceDir/../scintilla/include
58	mkdir -p $SCINTILLA_INCLUDE
59	cp -R $sourceDir3/include/* $SCINTILLA_INCLUDE
60
61	ls -la $sourceDir/../scintilla/include
62	cd src
63	make $jobArgs
64
65	cd $sourceDir2
66	cp -R $sourceDir/lexlib/ .
67	make all OBJ_DIR=objects SYSTEM_INCLUDE_PATHS="$sourceDir3/include $sourceDir/include"
68	rm -rf objects/*.d objects/*.o
69}
70
71INSTALL()
72{
73	INCLUDE_DIR=$includeDir/lexilla
74	LEXERS_DIR=$libDir/lexilla
75
76	mkdir -p $libDir
77	mkdir -p $INCLUDE_DIR
78	mkdir -p $LEXERS_DIR
79
80	cp -a bin/liblexilla.so $libDir/liblexilla.so
81	cp include/Lexilla.h $INCLUDE_DIR
82	cp include/SciLexer.h $INCLUDE_DIR
83
84	cp $sourceDir2/objects/Lex* $LEXERS_DIR
85
86	prepareInstalledDevelLibs liblexilla
87	packageEntries devel $developDir
88}
89