Subject: [PATCH] testing/opencsg: New aport

From: Marian Buschsieweke <[email-masked]>
Date: Wed, 9 Oct 2019 22:41:03 +0200

A library that does image-based CSG rendering using OpenGL
http://www.opencsg.org/
---
 testing/opencsg/APKBUILD       | 38 ++++++++++++++++++++++++++++++++++
 testing/opencsg/freeglut.patch | 11 ++++++++++
 2 files changed, 49 insertions(+)
 create mode 100644 testing/opencsg/APKBUILD
 create mode 100644 testing/opencsg/freeglut.patch

diff --git a/testing/opencsg/APKBUILD b/testing/opencsg/APKBUILD
new file mode 100644
index 0000000000..f85fffafd7
--- /dev/null
+++ b/testing/opencsg/APKBUILD
@@ -0,0 +1,38 @@
+# Maintainer: Marian Buschsieweke <[email-masked]>
+pkgname=opencsg
+pkgver=1.4.2
+pkgrel=0
+pkgdesc="A library that does image-based CSG rendering using OpenGL"
+url="http://www.opencsg.org/"
+arch="all"
+license="GPL-2.0-only"
+subpackages="$pkgname-dev $pkgname-example"
+makedepends="glew-dev freeglut-dev"
+source="
+	http://www.opencsg.org/OpenCSG-${pkgver}.tar.gz
+	freeglut.patch
+	"
+builddir="$srcdir/OpenCSG-$pkgver"
+
+build() {
+	make -j1
+}
+
+check() {
+	make check
+}
+
+package() {
+	for folder in src example; do
+		sed -e 's/\/usr\/local\//\/usr\//g' -i $folder/Makefile
+		make INSTALL_ROOT="$pkgdir" install -j 1 -C $folder
+	done
+}
+
+example() {
+	mkdir -p "$subpkgdir"/usr/
+	mv "$pkgdir"/usr/bin "$subpkgdir"/usr/
+}
+
+sha512sums="fbe6f925982717ecca7bd0eacc4fc5b362c80c7663b1ff0d9a228f2b5e1d3625d3e6d324d9e634665c74e9c0fc37d10290ece293e59a3eba67035b6b700b7778  OpenCSG-1.4.2.tar.gz
+5927a6e9b90a44f7f427003b6367ec986827ee135fe4817c12cd7ef1dae2e7db6be146b987fa4054cc2803eff6bf026ad81c7e6521cf43144da7b4c5990ae78d  freeglut.patch"
diff --git a/testing/opencsg/freeglut.patch b/testing/opencsg/freeglut.patch
new file mode 100644
index 0000000000..08a91a8c85
--- /dev/null
+++ b/testing/opencsg/freeglut.patch
@@ -0,0 +1,11 @@
+--- OpenCSG-1.4.2.old/example/main.cpp
++++ OpenCSG-1.4.2/example/main.cpp
+@@ -35,7 +35,7 @@
+ #ifdef __APPLE__
+ #include <GLUT/glut.h>
+ #else
+-#include <GL/glut.h>
++#include <GL/freeglut.h>
+ #endif
+ 
+ enum { 
-- 
2.23.0