mame-0.210.recipe revision bddf7b65
1SUMMARY="A multi-purpose emulation framework"
2DESCRIPTION="MAME\'s purpose is to preserve decades of software history. As \
3electronic technology continues to rush forward, MAME prevents this important \
4\"vintage\" software from being lost and forgotten. This is achieved by \
5documenting the hardware and how it functions. The source code to MAME \
6serves as this documentation. The fact that the software is usable serves \
7primarily to validate the accuracy of the documentation (how else can you \
8prove that you have recreated the hardware faithfully?). Over time, MAME \
9(originally stood for Multiple Arcade Machine Emulator) absorbed the \
10sister-project MESS (Multi Emulator Super System), so MAME now documents a \
11wide variety of (mostly vintage) computers, video game consoles and \
12calculators, in addition to the arcade video games that were its initial focus."
13HOMEPAGE="https://www.mamedev.org/"
14COPYRIGHT="1997-2019 MAMEDev and contributors"
15LICENSE="GNU GPL v2"
16REVISION="1"
17SOURCE_URI="https://github.com/mamedev/mame/archive/mame${portVersion/./}.tar.gz"
18CHECKSUM_SHA256="4d0b23f3c9f9b2f6283ed78d5afc9a6391d2ee6ce5f0f4bcc2a357ec14aa06c4"
19SOURCE_FILENAME="mame-$portVersion.tar.gz"
20SOURCE_DIR="mame-mame${portVersion/./}"
21PATCHES="mame-$portVersion.patchset"
22ADDITIONAL_FILES="
23	mame.sh
24	mame.rdef.in
25	"
26
27ARCHITECTURES="!x86_gcc2 x86 x86_64"
28SECONDARY_ARCHITECTURES="x86"
29
30bits=64
31makejobs=$jobArgs
32commandBinDir=$binDir
33commandSuffix=$secondaryArchSuffix
34if [ "$targetArchitecture" = x86_gcc2 ]; then
35	bits=
36	commandBinDir=$prefix/bin
37	commandSuffix=
38	makejobs=1
39fi
40
41PROVIDES="
42	mame$secondaryArchSuffix = $portVersion
43	cmd:castool$commandSuffix
44	cmd:chdman$commandSuffix
45	cmd:floptool$commandSuffix
46	cmd:imgtool$commandSuffix
47	cmd:jedutil$commandSuffix
48	cmd:ldresample$commandSuffix
49	cmd:ldverify$commandSuffix
50	cmd:mame.sh
51	cmd:mame$commandSuffix
52	cmd:nltool$commandSuffix
53	cmd:nlwav$commandSuffix
54	cmd:pngcmp$commandSuffix
55	cmd:regrep$commandSuffix
56	cmd:romcmp$commandSuffix
57	cmd:split$commandSuffix
58	cmd:src2html$commandSuffix
59	cmd:srcclean$commandSuffix
60	cmd:testkeys$commandSuffix
61	cmd:unidasm$commandSuffix
62"
63
64REQUIRES="
65	haiku$secondaryArchSuffix
66	lib:libexpat$secondaryArchSuffix
67	lib:libflac$secondaryArchSuffix
68	lib:libfontconfig$secondaryArchSuffix
69	lib:libfreetype$secondaryArchSuffix
70	lib:libGL$secondaryArchSuffix
71	lib:libjpeg$secondaryArchSuffix
72	lib:liblua$secondaryArchSuffix >= 5.3
73	lib:libpugixml$secondaryArchSuffix
74	lib:libSDL2_2.0$secondaryArchSuffix
75	lib:libSDL2_ttf$secondaryArchSuffix
76	lib:libsqlite3$secondaryArchSuffix
77	lib:libutf8proc$secondaryArchSuffix
78	lib:libz$secondaryArchSuffix
79"
80
81BUILD_REQUIRES="
82	haiku${secondaryArchSuffix}_devel
83	glm${secondaryArchSuffix}_devel
84	devel:libexpat$secondaryArchSuffix
85	devel:libflac$secondaryArchSuffix
86	devel:libfontconfig$secondaryArchSuffix
87	devel:libfreetype$secondaryArchSuffix
88	devel:libGL$secondaryArchSuffix
89	devel:libjpeg$secondaryArchSuffix
90	devel:liblua$secondaryArchSuffix >= 5.3
91	devel:libogg$secondaryArchSuffix
92	devel:libpugixml$secondaryArchSuffix
93	devel:librapidjson$secondaryArchSuffix
94	devel:libSDL2_2.0$secondaryArchSuffix
95	devel:libSDL2_ttf$secondaryArchSuffix
96	devel:libsqlite3$secondaryArchSuffix
97	devel:libutf8proc$secondaryArchSuffix
98	devel:libz$secondaryArchSuffix
99"
100BUILD_PREREQUIRES="
101	cmd:gcc$secondaryArchSuffix
102	cmd:ld$secondaryArchSuffix
103	cmd:libtoolize
104	cmd:make
105	cmd:pkg_config$secondaryArchSuffix
106	cmd:python2
107	cmd:sed
108	cmd:strip$secondaryArchSuffix
109"
110
111defineDebugInfoPackage mame$secondaryArchSuffix \
112	$commandBinDir/castool \
113	$commandBinDir/chdman \
114	$commandBinDir/floptool \
115	$commandBinDir/imgtool \
116	$commandBinDir/jedutil \
117	$commandBinDir/ldresample \
118	$commandBinDir/ldverify \
119	$commandBinDir/mame \
120	$commandBinDir/nltool \
121	$commandBinDir/nlwav \
122	$commandBinDir/pngcmp \
123	$commandBinDir/regrep \
124	$commandBinDir/romcmp \
125	$commandBinDir/split \
126	$commandBinDir/src2html \
127	$commandBinDir/srcclean \
128	$commandBinDir/testkeys \
129	$commandBinDir/unidasm
130
131BUILD()
132{
133#	make clean
134
135	# This is wrong on so many levels
136	SYS_LDFLAGS="-lbsd -lnetwork " # trailing space required!
137	for _i in flac libutf8proc lua RapidJSON sqlite3; do
138		SYS_CFLAGS+="`pkg-config $_i --cflags`"
139		SYS_LDFLAGS+="`pkg-config $_i --libs`"
140	done
141
142	ARCHOPTS="$SYS_CFLAGS $SYS_LDFLAGS" \
143	make \
144		REGENIE=1 \
145		TOOLS=1 \
146		PRECOMPILE=0 \
147		NOWERROR=1 \
148		USE_SYSTEM_LIB_EXPAT=1 \
149		USE_SYSTEM_LIB_ZLIB=1 \
150		USE_SYSTEM_LIB_JPEG=1 \
151		USE_SYSTEM_LIB_FLAC=1 \
152		USE_SYSTEM_LIB_LUA=1 \
153		USE_SYSTEM_LIB_SQLITE3=1 \
154		USE_SYSTEM_LIB_UTF8PROC=1 \
155		USE_SYSTEM_LIB_GLM=1 \
156		USE_SYSTEM_LIB_RAPIDJSON=1 \
157		USE_SYSTEM_LIB_PUGIXML=1 \
158		-j $makejobs
159}
160
161INSTALL()
162{
163	# Based on https://projects.archlinux.de/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/mame
164
165	# Arch cleanup
166	# 32 bit main binary called as "mame" which would collide with our symlink
167	if [ "$targetArchitecture" = x86_64 ]; then
168		mv mame$bits mame
169	fi
170
171	# Install the binaries
172	mkdir -p "$commandBinDir"
173	for _i in castool chdman floptool imgtool jedutil ldresample ldverify \
174	mame nltool nlwav pngcmp regrep romcmp split src2html srcclean \
175	testkeys unidasm; do
176		install -m755 $_i -t "$commandBinDir"
177		strip "$commandBinDir"/$_i
178	done
179
180	# Create the startscript
181	cp $portDir/additional-files/mame.sh "$commandBinDir"/mame.sh
182	chmod +x "$commandBinDir"/mame.sh
183
184	# Add extra attributes to the binaries...
185	local APP_SIGNATURE="application/x-vnd.mame"
186	local MAJOR="`echo "$portVersion" | cut -d. -f1`"
187	local MIDDLE="`echo "$portVersion" | cut -d. -f2`"
188	local MINOR="0"
189	sed \
190		-e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \
191		-e "s|@MAJOR@|$MAJOR|" \
192		-e "s|@MIDDLE@|$MIDDLE|" \
193		-e "s|@MINOR@|$MINOR|" \
194		-e "s|@SUMMARY@|Multiple Arcade Machine Emulator|" \
195		-e "s|@DESCRIPTION@|$SUMMARY|" \
196		$portDir/additional-files/mame.rdef.in > mame.rdef
197
198	addResourcesToBinaries mame.rdef "$commandBinDir/mame"
199
200	# ...and to our startscript, but we can't use addResourcesToBinaries here
201	rc mame.rdef
202	resattr -o "$commandBinDir"/mame.sh mame.rsrc
203
204	# Creating icon in Haiku's leaf-menu
205	addAppDeskbarSymlink "$commandBinDir"/mame.sh "MAME"
206
207	# Install the extra bits
208	install -Dm644 src/osd/modules/opengl/shader/glsl*.*h -t "$libDir/"/mame/shader/
209	cp -ar {artwork,bgfx,plugins,language,ctrlr,keymaps,hash} "$libDir"/mame/
210
211	# FS#28203 fix from AUR
212	sed -i 's|KEYCODE_2_PAD|KEYCODE_2PAD|' "$libDir"/mame/ctrlr/*.cfg
213	sed -i 's|KEYCODE_4_PAD|KEYCODE_4PAD|' "$libDir"/mame/ctrlr/*.cfg
214	sed -i 's|KEYCODE_6_PAD|KEYCODE_6PAD|' "$libDir"/mame/ctrlr/*.cfg
215	sed -i 's|KEYCODE_8_PAD|KEYCODE_8PAD|' "$libDir"/mame/ctrlr/*.cfg
216
217	# Install man-pages
218	install -dm0755 "$manDir"/man{1,6}
219	install -m644 docs/man/*.1* "$manDir"/man1
220	install -m644 docs/man/*.6* "$manDir"/man6
221}
222