void-packages/srcpkgs/mupdf/template
2017-04-11 20:01:31 +02:00

68 lines
1.9 KiB
Bash

# Template file for 'mupdf'
pkgname=mupdf
version=1.11
revision=1
wrksrc="${pkgname}-${version}-source"
hostmakedepends="pkg-config zlib-devel libcurl-devel freetype-devel
libjpeg-turbo-devel jbig2dec-devel libXext-devel libXcursor-devel
libXrandr-devel libXinerama-devel harfbuzz-devel
MesaLib-devel libopenjpeg2-devel"
makedepends="${hostmakedepends}"
depends="desktop-file-utils"
short_desc="Lightweight PDF and XPS viewer"
maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="AGPL-3"
homepage="http://mupdf.com"
distfiles="http://mupdf.com/downloads/archive/${pkgname}-${version}-source.tar.gz"
checksum=209474a80c56a035ce3f4958a63373a96fad75c927c7b1acdc553fc85855f00a
pre_configure() {
rm -rf thirdparty/{curl,freetype,harfbuzz,jpeg,zlib,jbig2dec,openjpeg}
}
do_configure() {
if [ "$CROSS_BUILD" ]; then
export CFLAGS="-fPIC"
unset LDFLAGS
make CC=cc LD=ld AR=ar build=release generate
fi
}
do_build() {
CFLAGS+=" -fPIC"
if [ "$CROSS_BUILD" ]; then
make CROSSCOMPILE=yes CURL_LIBS='-lcurl -lpthread' build=release
make CROSSCOMPILE=yes CFLAGS="$CFLAGS" build=release -C thirdparty/mujs
else
make CURL_LIBS='-lcurl -lpthread' build=release
make build=release CFLAGS="$CFLAGS" -C thirdparty/mujs
fi
}
do_install() {
make build=release prefix=${DESTDIR}/usr install
mv ${DESTDIR}/usr/bin/mupdf-x11-curl ${DESTDIR}/usr/bin/mupdf
rm ${DESTDIR}/usr/bin/mupdf-x11
vinstall build/release/libmupdf.a 644 usr/lib
vinstall thirdparty/mujs/build/libmujs.a 644 usr/lib
vinstall ${FILESDIR}/mupdf.xpm 644 usr/share/pixmaps
vinstall ${FILESDIR}/mupdf.desktop 644 usr/share/applications
}
mupdf-devel_package() {
short_desc+=" - development files"
depends="libjpeg-turbo-devel jbig2dec-devel libopenjpeg2-devel"
pkg_install() {
vmove usr/include
vmove usr/lib
}
}
mupdf-tools_package() {
short_desc+=" - tools"
pkg_install() {
vmove usr/bin/mujstest
vmove usr/bin/muraster
vmove usr/bin/mutool
vmove usr/share/man/man1/mutool.1
}
}