Subject: [alpine-aports] [PATCH 1/2] testing/glfw: new aport

From: Daniel Sabogal <[email-masked]>
Date: Fri, 19 Aug 2016 11:58:38 -0400

http://www.glfw.org/
Multi-platform library for OpenGL and Vulkan application development
---
 testing/glfw/APKBUILD | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 testing/glfw/APKBUILD

diff --git a/testing/glfw/APKBUILD b/testing/glfw/APKBUILD
new file mode 100644
index 0000000..5ec631e
--- /dev/null
+++ b/testing/glfw/APKBUILD
@@ -0,0 +1,35 @@
+# Contributor: Daniel Sabogal <[email-masked]>
+# Maintainer:
+pkgname=glfw
+pkgver=3.2
+pkgrel=0
+pkgdesc="Multi-platform library for OpenGL and Vulkan application development"
+url="http://www.glfw.org/"
+arch="all"
+license="zlib"
+depends=""
+depends_dev="libxinerama-dev linux-headers mesa-dev"
+makedepends="$depends_dev cmake libx11-dev libxcursor-dev libxrandr-dev"
+subpackages="$pkgname-dev"
+source="$pkgname-$pkgver.tar.gz::https://github.com/glfw/$pkgname/archive/$pkgver.tar.gz"
+
+builddir="$srcdir/$pkgname-$pkgver"
+
+build() {
+	cd "$builddir"
+	cmake . \
+		-DCMAKE_BUILD_TYPE=Release \
+		-DCMAKE_INSTALL_PREFIX=/usr \
+		-DBUILD_SHARED_LIBS=ON \
+		|| return 1
+	make || return 1
+}
+
+package() {
+	cd "$builddir"
+	make DESTDIR="$pkgdir/" install || return 1
+}
+
+md5sums="a4a7248d771717a84c8997b7b712cd57  glfw-3.2.tar.gz"
+sha256sums="cb3aab46757981a39ae108e5207a1ecc4378e68949433a2b040ce2e17d8f6aa6  glfw-3.2.tar.gz"
+sha512sums="55982cba8b6605fe5489f7396fb5101f3eedd121d13a51ab8178e4bd2c8b348a8b7869fcd00dbefe5725b5c04942318c2a99f13832da4bfa74db42ab2812f3a2  glfw-3.2.tar.gz"
-- 
2.8.3

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Daniel Sabogal <[email-masked]>
Date: Fri, 19 Aug 2016 11:58:39 -0400

Fixes #5921
build mupdf with OpenGL backend
split mupdf-x11, mupdf-gl, and mupdf-tools into subpackages
---
 testing/mupdf/APKBUILD | 48 ++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 38 insertions(+), 10 deletions(-)

diff --git a/testing/mupdf/APKBUILD b/testing/mupdf/APKBUILD
index 92fee92..9c1f3f5 100644
--- a/testing/mupdf/APKBUILD
+++ b/testing/mupdf/APKBUILD
@@ -2,22 +2,22 @@
 # Maintainer: Michael Zhou <[email-masked]>
 pkgname=mupdf
 pkgver=1.9a
-pkgrel=1
+pkgrel=2
 pkgdesc="A lightweight PDF and XPS viewer"
 url="http://mupdf.com"
 arch="all"
 license="AGPL3+"
 depends=""
 makedepends="freetype-dev jpeg-dev jbig2dec-dev libx11-dev libxext-dev
-	openjpeg-dev harfbuzz-dev"
-install=""
-subpackages="$pkgname-doc $pkgname-dev"
+	openjpeg-dev harfbuzz-dev glfw-dev"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-x11:_x11
+	$pkgname-gl:_gl $pkgname-tools:_tools"
 source="http://mupdf.com/downloads/archive/$pkgname-$pkgver-source.tar.gz
 	shared-lib.patch
 	mupdf-openjpeg-2.1.patch
 	"
 
-builddir="$srcdir/$pkgname-${pkgver}-source"
+builddir="$srcdir/$pkgname-$pkgver-source"
 prepare() {
 	default_prepare || return 1
 
@@ -31,16 +31,44 @@ prepare() {
 }
 
 build() {
-	cd "$builddir"
-	make prefix=/usr || return 1
+	make HAVE_GLFW=yes SYS_GLFW_LIBS="-lglfw -lGL" \
+		prefix=/usr -C "$builddir" || return 1
 }
 
 package() {
-	cd "$builddir"
-	make prefix=/usr DESTDIR="$pkgdir" install || return 1
+	make HAVE_GLFW=yes \
+		prefix=/usr DESTDIR="$pkgdir" \
+		-C "$builddir" install || return 1
+
 	ln -s libmupdf.so.0 "$pkgdir"/usr/lib/libmupdf.so
 	ln -s libmupdfthird.so.0 "$pkgdir"/usr/lib/libmupdfthird.so
-	ln -s /usr/bin/$pkgname-x11 "$pkgdir"/usr/bin/$pkgname
+}
+
+_x11() {
+	pkgdesc="A lightweight PDF and XPS viewer with X11 backend"
+	depends="!mupdf-gl mupdf"
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/mupdf-x11 \
+		"$subpkgdir"/usr/bin/ || return 1
+	ln -s /usr/bin/mupdf-x11 "$subpkgdir"/usr/bin/mupdf
+}
+
+_gl() {
+	pkgdesc="A lightweight PDF and XPS viewer with OpenGL backend"
+	depends="!mupdf-x11 mupdf"
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/mupdf-gl \
+		"$subpkgdir"/usr/bin/ || return 1
+	ln -s /usr/bin/mupdf-gl "$subpkgdir"/usr/bin/mupdf
+}
+
+_tools() {
+	pkgdesc="Tools for a lightweight PDF and XPS viewer"
+	depends="mupdf"
+	mkdir -p "$subpkgdir"/usr/bin
+	mv "$pkgdir"/usr/bin/mutool \
+		"$pkgdir"/usr/bin/mujstest \
+		"$subpkgdir"/usr/bin/ || return 1
 }
 
 md5sums="658b90788a57d858dcb069cf326e11c3  mupdf-1.9a-source.tar.gz
-- 
2.8.3

---