description="Lightweight PDF and XPS viewer" url="http://www.mupdf.com" packager="tnut " license="AGPL3" name=mupdf version=1.23.9 makedepends=(lcms2 harfbuzz libjpeg-turbo openjpeg freeglut xorg-libx11 xorg-libxcursor xorg-libxext xorg-libxrandr xorg-libxinerama freetype) source=(http://www.mupdf.com/downloads/archive/$name-$version-source.tar.gz) prepare() { sed -i '/MU.*_EXE. :/{ s/\(.(MUPDF_LIB)\)\(.*\)$/\2 | \1/ N s/$/ -lmupdf -L$(OUT)/ }' $name-$version-source/Makefile cat > $name-$version-source/user.make << EOF USE_SYSTEM_FREETYPE := yes USE_SYSTEM_HARFBUZZ := yes USE_SYSTEM_JBIG2DEC := no USE_SYSTEM_JPEGXR := no # not used without HAVE_JPEGXR USE_SYSTEM_LCMS2 := no # need lcms2-art fork USE_SYSTEM_LIBJPEG := yes USE_SYSTEM_MUJS := no # build needs source anyways USE_SYSTEM_OPENJPEG := yes USE_SYSTEM_ZLIB := yes USE_SYSTEM_GLUT := no # need freeglut2-art fork USE_SYSTEM_CURL := yes USE_SYSTEM_GUMBO := no EOF } build() { unset MAKEFLAGS cd $name-$version-source export XCFLAGS=-fPIC make build=release shared=yes unset XCFLAGS make prefix=$PKG/usr shared=yes \ docdir=$PKG/usr/share/doc/$name-$version \ install chmod 755 $PKG/usr/lib/libmupdf.so ln -svf mupdf-x11 $PKG/usr/bin/mupdf install -Dm644 COPYING $PKG/usr/share/licenses/$name/COPYING }