1SUMMARY="A library to access multiple forms of archives"
2DESCRIPTION="Physfs is short for PhysicsFS. It's a C library that provides \
3abstract access to various archives. It is intended for use in video games, \
4and the design was somewhat inspired by Quake 3's file subsystem.
5
6The programmer defines a \"write directory\" on the physical filesystem to \
7which all writing through the PhysicsFS is restricted for security reasons.
8PhysicsFS gives you platform-abstracted means to determine if CD-ROMs are \
9available, the user's home directory (where in the real filesystem your \
10game is running), etc."
11HOMEPAGE="https://icculus.org/physfs"
12COPYRIGHT="2001-2017 Ryan C. Gordon"
13LICENSE="PHYSFS"
14REVISION="2"
15SOURCE_URI="http://icculus.org/physfs/downloads/physfs-$portVersion.tar.bz2"
16CHECKSUM_SHA256="304df76206d633df5360e738b138c94e82ccf086e50ba84f456d3f8432f9f863"
17
18ARCHITECTURES="all"
19SECONDARY_ARCHITECTURES="x86"
20
21PROVIDES="
22	physfs$secondaryArchSuffix = $portVersion compat >= 3.0
23	cmd:test_physfs$secondaryArchSuffix = $portVersion compat >= 3.0
24	lib:libphysfs$secondaryArchSuffix = $portVersion compat >= 3.0
25	"
26REQUIRES="
27	haiku$secondaryArchSuffix
28	"
29
30PROVIDES_devel="
31	physfs${secondaryArchSuffix}_devel = $portVersion compat >= 3.0
32	devel:libphysfs$secondaryArchSuffix = $portVersion compat >= 3.0
33	"
34REQUIRES_devel="
35	physfs$secondaryArchSuffix == $portVersion base
36	"
37
38BUILD_REQUIRES="
39	haiku${secondaryArchSuffix}_devel
40	"
41BUILD_PREREQUIRES="
42	cmd:cmake
43	cmd:gcc$secondaryArchSuffix
44	cmd:make
45	"
46
47PATCH()
48{
49	sed -i "s,DESTINATION include,DESTINATION $relativeIncludeDir," CMakeLists.txt
50	sed -i "s,DESTINATION bin,DESTINATION $relativeBinDir," CMakeLists.txt
51}
52
53BUILD()
54{
55	cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \
56		-DCMAKE_INSTALL_PREFIX=$prefix \
57		-DLIB_SUFFIX="/${secondaryArchSuffix/_/}" \
58		-DPHYSFS_BUILD_STATIC=OFF
59	make -C build $jobArgs
60}
61
62INSTALL()
63{
64	make -C build install
65
66	prepareInstalledDevelLib libphysfs
67	fixPkgconfig
68
69	# devel package
70	packageEntries devel \
71			$developDir
72}
73