Mail archive
alpine-aports

[alpine-aports] [PATCH 2/2] testing/mupdf: build mupdf-gl and add subpackages

From: Daniel Sabogal <dsabogalcc_at_gmail.com>
Date: Sun, 21 Aug 2016 23:23:21 -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 a3f0b40..7b554aa 100644
--- a/testing/mupdf/APKBUILD
+++ b/testing/mupdf/APKBUILD
_at_@ -2,22 +2,22 @@
 # Maintainer: Michael Zhou <zhoumichaely_at_gmail.com>
 pkgname=mupdf
 pkgver=1.9a
-pkgrel=2
+pkgrel=3
 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
 	openjpeg-2.1.1.patch
 	"
 
-builddir="$srcdir/$pkgname-${pkgver}-source"
+builddir="$srcdir/$pkgname-$pkgver-source"
 prepare() {
 	default_prepare || return 1
 
_at_@ -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
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Sun Aug 21 2016 - 23:23:21 GMT