~yerinalexey/apkbuilds

7a935d45ba3bb966a0f46a9eb7adefc68aaa908e — Alexey Yerin 1 year, 2 months ago 92bc3ce
fna3d: New apkbuild
3 files changed, 76 insertions(+), 0 deletions(-)

M README.md
A local/fna3d/APKBUILD
A local/fna3d/install.patch
M README.md => README.md +1 -0
@@ 17,6 17,7 @@ regular repositories.
* `minitimer` - a timer for your terminal
* `senpai` - IRC client for bouncers
* `blockbench` - low-poly 3D model editor
* `fna3d` - 3D Graphics Library for FNA (for celeste)

## License


A local/fna3d/APKBUILD => local/fna3d/APKBUILD +54 -0
@@ 0,0 1,54 @@
# Contributor:
# Maintainer:
pkgname=fna3d
pkgver=23.09
pkgrel=0
pkgdesc="3D Graphics Library for FNA"
url="http://fna-xna.github.io/"
arch="all"
license="Zlib"
depends=""
makedepends="cmake samurai sdl2-dev"
subpackages="$pkgname-dev"
_mojoshader_commit=b4d377fa4b31a9b35e0ef70bdc229cbb4fed0f38
_vulkan_headers_commit=85470b32ad5d0d7d67fdf411b6e7b502c09c9c52
source="
	FNA3D-$pkgver.tar.gz::https://github.com/FNA-XNA/FNA3D/archive/$pkgver.tar.gz
	mojoshader-$_mojoshader_commit.tar.gz::https://github.com/icculus/mojoshader/archive/$_mojoshader_commit.tar.gz
	Vulkan-Headers-$_vulkan_headers_commit.tar.gz::https://github.com/KhronosGroup/Vulkan-Headers/archive/$_vulkan_headers_commit.tar.gz

	install.patch
"
builddir="$srcdir/FNA3D-$pkgver"
options="!check" # ?

prepare() {
	default_prepare

	rm -r "$builddir"/MojoShader "$builddir"/Vulkan-Headers
	cp -r "$srcdir"/mojoshader-$_mojoshader_commit "$builddir"/MojoShader
	cp -r "$srcdir"/Vulkan-Headers-$_vulkan_headers_commit "$builddir"/Vulkan-Headers
}

build() {
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake -B build -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=1 \
		-DCMAKE_BUILD_TYPE=Release
	cmake --build build
}

package() {
	echo "pkgdir - $pkgdir"
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
f5d34251f08f8924d903399e6277ae96d2e2149b6049b04199b009ff6ebc0102ed65c5575cba82f906596795bc1dcb1e4fbfe3611599d405cb44c267c6fb9c1d  FNA3D-23.09.tar.gz
40bab427ffddd46e2ea6dc7b80ce5f7c16a26bdc3a30a7766447fe12e11873246633b432a9807ea09caa08cb77f2f1ffce9bfe3463577be7e19495d82dc309ec  mojoshader-b4d377fa4b31a9b35e0ef70bdc229cbb4fed0f38.tar.gz
836e1b78d5086fde7d562628ba04801159c9a2ddcc40bd2f94b2cf3e77b914b61f604ee0d4937c900aaf76ca1074ca86a2260d5e86a3418087a661296c4e10da  Vulkan-Headers-85470b32ad5d0d7d67fdf411b6e7b502c09c9c52.tar.gz
254d8c4dcf9d0f3b618e0dce1491a330475c2c081f29dd18c59738bf93e4cbaf3e4d96397eef85972a60879d98a1b0f971b6655e7b5b030052e5fe7799bf757f  install.patch
"

A local/fna3d/install.patch => local/fna3d/install.patch +21 -0
@@ 0,0 1,21 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -194,3 +194,17 @@
 		target_link_libraries(FNA3D PUBLIC ${SDL2_LIBRARIES})
 	endif()
 endif()
+
+# Installation
+include(GNUInstallDirs)
+install(
+	DIRECTORY include/
+	DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+)
+install(
+	TARGETS FNA3D
+	INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+	RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
+	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+	ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+)