1SUMMARY="XBoard-compatible 3D chess interface and engine"
2DESCRIPTION="DreamChess is an open source chess game. Our primary target \
3platforms are Windows, macOS and Linux. DreamChess features 3D OpenGL \
4graphics and provides various chess board sets, ranging from classic wooden \
5to flat figurines.
6
7A moderately strong chess engine is included: Dreamer. However, should this \
8engine be too weak for you, then you can use any other XBoard-compatible \
9chess engine, including the popular Crafty and GNU Chess.
10
11Other features include music, sound effects, on-screen move lists using SAN \
12notation, undo functionality, and savegames in PGN format.
13
14The DreamChess team currently consists of only a handful of people. We could \
15use help in many areas, such as programming, graphics, sound and testing. If \
16you���re interested in helping out, please send an email to feedback at \
17dreamchess.org."
18HOMEPAGE="https://www.dreamchess.org/"
19COPYRIGHT="2003-2007 Andrew Ball, Annie Kirkpatrick, Brandon May, Kris McAulay, \
20Walter van Niftrik, Rogier van Schaijk, Lawrence Sebald, Matthew P. Smith
21	1991-1993 The Regents of the University of California
22	1998-2005 Gilles Vollant"
23LICENSE="GNU GPL v3"
24REVISION="5"
25SOURCE_URI="https://github.com/dreamchess/dreamchess/archive/$portVersion.tar.gz"
26CHECKSUM_SHA256="b070a34acf69ed92e523902683d104abb295d78b6f37663f4668e929b9e90470"
27PATCHES="dreamchess-$portVersion.patchset"
28ADDITIONAL_FILES="dreamchess.rdef.in"
29
30ARCHITECTURES="all !x86_gcc2"
31SECONDARY_ARCHITECTURES="x86"
32
33PROVIDES="
34	dreamchess$secondaryArchSuffix = $portVersion
35	app:DreamChess$secondaryArchSuffix
36	"
37REQUIRES="
38	haiku$secondaryArchSuffix
39	lib:libexpat$secondaryArchSuffix
40	lib:libGL$secondaryArchSuffix
41	lib:libGLU$secondaryArchSuffix
42	lib:libglew$secondaryArchSuffix
43	lib:libmxml$secondaryArchSuffix
44	lib:libSDL2_2.0$secondaryArchSuffix
45	lib:libSDL2_image_2.0$secondaryArchSuffix
46	lib:libSDL2_mixer_2.0$secondaryArchSuffix
47	lib:libz$secondaryArchSuffix
48	"
49
50BUILD_REQUIRES="
51	haiku${secondaryArchSuffix}_devel
52	devel:libexpat$secondaryArchSuffix
53	devel:libGL$secondaryArchSuffix
54	devel:libGLU$secondaryArchSuffix
55	devel:libglew$secondaryArchSuffix
56	devel:libmxml$secondaryArchSuffix
57	devel:libSDL2$secondaryArchSuffix
58	devel:libSDL2_image$secondaryArchSuffix
59	devel:libSDL2_mixer$secondaryArchSuffix
60	devel:libz$secondaryArchSuffix
61	"
62BUILD_PREREQUIRES="
63	cmd:awk
64	cmd:bison
65	cmd:cmake
66	cmd:find
67	cmd:flex
68	cmd:gcc$secondaryArchSuffix
69	cmd:ld$secondaryArchSuffix
70	cmd:make
71	"
72
73BUILD()
74{
75	mkdir -p build
76	cd build
77	cmake .. \
78		-DCMAKE_BUILD_TYPE=Release \
79		-DCMAKE_INSTALL_PREFIX=$appsDir/DreamChess \
80		-DCMAKE_INSTALL_BINDIR=$appsDir/DreamChess \
81		-DCMAKE_INSTALL_MANDIR=$appsDir/DreamChess/man \
82		-DCMAKE_INSTALL_DOCDIR=$appsDir/DreamChess/doc \
83		-DCMAKE_INSTALL_FULL_DATADIR=$appsDir/DreamChess/data \
84		-DCMAKE_INSTALL_DATAROOTDIR=$appsDir/DreamChess/data \
85		-DCMAKE_INSTALL_DATADIR=$appsDir/DreamChess/data
86	make $jobArgs
87}
88
89INSTALL()
90{
91	cd build
92	make install
93
94	mv $appsDir/DreamChess/dreamchess $appsDir/DreamChess/DreamChess
95	rm -rf $appsDir/DreamChess/{man,data/applications,data/icons}
96
97	local APP_SIGNATURE="application/x-vnd.DreamChess"
98	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
99	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
100	local MINOR="`echo "$portVersion" | cut -d. -f3`"
101	local LONG_INFO="$SUMMARY"
102	sed \
103		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
104		-e "s|@MAJOR@|$MAJOR|" \
105		-e "s|@MIDDLE@|$MIDDLE|" \
106		-e "s|@MINOR@|$MINOR|" \
107		-e "s|@LONG_INFO@|$LONG_INFO|" \
108		$portDir/additional-files/dreamchess.rdef.in > dreamchess.rdef
109
110	addResourcesToBinaries dreamchess.rdef $appsDir/DreamChess/DreamChess
111	addAppDeskbarSymlink $appsDir/DreamChess/DreamChess DreamChess
112}
113