mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
mupdf: build shared library and apps
* don't use builtin libs * create devel package
This commit is contained in:
@@ -9,7 +9,7 @@ transparency, encryption, hyperlinks, annotations, searching and more. It also \
|
||||
reads XPS and OpenXPS documents. MuPDF is written modularly, so features can \
|
||||
be added on by integrators if they so desire.
|
||||
"
|
||||
HOMEPAGE="http://www.mupdf.com/"
|
||||
HOMEPAGE="http://www.mupdf.com"
|
||||
LICENSE="AGPL-3.0"
|
||||
COPYRIGHT="2006-2013 Artifex Software, Inc"
|
||||
SRC_URI="http://www.mupdf.com/downloads/mupdf-$portVersion-source.tar.gz"
|
||||
@@ -17,13 +17,16 @@ SOURCE_DIR="mupdf-$portVersion-source"
|
||||
CHECKSUM_SHA256="9813ee330950a641364181649ebd369c947adbcea9d41ed953ec5365640ea563"
|
||||
PATCHES="mupdf-1.6.patchset"
|
||||
|
||||
REVISION="3"
|
||||
REVISION="4"
|
||||
ARCHITECTURES="x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
mupdf$secondaryArchSuffix = $portVersion compat >= 1.1
|
||||
devel:libmupdf$secondaryArchSuffix = $portVersion compat >= 1.1
|
||||
lib:libmupdf$secondaryArchSuffix = $portVersion compat >= 1.1
|
||||
cmd:mudraw$secondaryArchSuffix
|
||||
cmd:mujstest$secondaryArchSuffix
|
||||
cmd:mutool$secondaryArchSuffix
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
@@ -35,9 +38,9 @@ REQUIRES="
|
||||
"
|
||||
BUILD_REQUIRES="
|
||||
devel:libfreetype$secondaryArchSuffix
|
||||
devel:libopenjp2$secondaryArchSuffix
|
||||
devel:libjbig2dec$secondaryArchSuffix
|
||||
devel:libjpeg$secondaryArchSuffix
|
||||
devel:libopenjp2$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
@@ -48,22 +51,55 @@ BUILD_PREREQUIRES="
|
||||
cmd:make
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
"
|
||||
PATCHES="
|
||||
mupdf-1.6.patchset
|
||||
mupdf-1.6-openjpeg21-1.patch
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
# don't use builtin libjpeg
|
||||
rm -rf thirdparty/jpeg scripts/jpeg
|
||||
make build=release $jobArgs libs
|
||||
# don't use builtin libs
|
||||
rm -rf thirdparty
|
||||
|
||||
# static lib
|
||||
my_soname=libmupdf.so.$portVersion
|
||||
my_soname_js_none=libmupdf-js-none.so.$portVersion
|
||||
sed -e "\$a\$(MUPDF_LIB): \$(MUPDF_JS_NONE_LIB)" \
|
||||
-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname} -Wl,--no-undefined -o \$@ \$^ \$(MUPDF_JS_NONE_LIB) \$(LIBS)" \
|
||||
-e "/^MUPDF_LIB :=/s:=.*:= \$(OUT)/${my_soname}:" \
|
||||
-e "\$a\$(MUPDF_JS_NONE_LIB):" \
|
||||
-e "\$a\\\t\$(QUIET_LINK) \$(CC) \$(LDFLAGS) --shared -Wl,-soname -Wl,${my_soname_js_none} -Wl,--no-undefined -o \$@ \$^ \$(LIBS)" \
|
||||
-e "/install/s: COPYING : :" \
|
||||
-i Makefile || die
|
||||
make XCFLAGS=-fpic build=release $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install-libs \
|
||||
make build=release install \
|
||||
prefix=$prefix \
|
||||
bindir=$binDir \
|
||||
docdir=$docDir \
|
||||
libdir=$libDir \
|
||||
incdir=$includeDir \
|
||||
mandir=$manDir
|
||||
|
||||
ln -s libmupdf.so.$portVersion $libDir/libmupdf.so
|
||||
|
||||
prepareInstalledDevelLibs libmupdf
|
||||
|
||||
# devel package
|
||||
packageEntries devel \
|
||||
$developDir
|
||||
}
|
||||
|
||||
|
||||
# ----- devel package -------------------------------------------------------
|
||||
|
||||
PROVIDES_devel="
|
||||
mupdf${secondaryArchSuffix}_devel = $portVersion
|
||||
devel:libmupdf$secondaryArchSuffix = $portVersion compat >= 1
|
||||
"
|
||||
REQUIRES_devel="
|
||||
mupdf$secondaryArchSuffix == $portVersion
|
||||
"
|
||||
|
||||
26
app-text/mupdf/patches/mupdf-1.6-openjpeg21-1.patch
Normal file
26
app-text/mupdf/patches/mupdf-1.6-openjpeg21-1.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
diff -Naur mupdf-1.6-source.orig/source/fitz/load-jpx.c mupdf-1.6-source/source/fitz/load-jpx.c
|
||||
--- mupdf-1.6-source.orig/source/fitz/load-jpx.c 2014-09-30 13:25:12.000000000 +0200
|
||||
+++ mupdf-1.6-source/source/fitz/load-jpx.c 2014-11-17 18:45:27.202705119 +0100
|
||||
@@ -1,13 +1,5 @@
|
||||
#include "mupdf/fitz.h"
|
||||
|
||||
-/* Without the definition of OPJ_STATIC, compilation fails on windows
|
||||
- * due to the use of __stdcall. We believe it is required on some
|
||||
- * linux toolchains too. */
|
||||
-#define OPJ_STATIC
|
||||
-#ifndef _MSC_VER
|
||||
-#define OPJ_HAVE_STDINT_H
|
||||
-#endif
|
||||
-
|
||||
#include <openjpeg.h>
|
||||
|
||||
static void fz_opj_error_callback(const char *msg, void *client_data)
|
||||
@@ -117,7 +109,7 @@
|
||||
opj_stream_set_read_function(stream, fz_opj_stream_read);
|
||||
opj_stream_set_skip_function(stream, fz_opj_stream_skip);
|
||||
opj_stream_set_seek_function(stream, fz_opj_stream_seek);
|
||||
- opj_stream_set_user_data(stream, &sb);
|
||||
+ opj_stream_set_user_data(stream, &sb, NULL);
|
||||
/* Set the length to avoid an assert */
|
||||
opj_stream_set_user_data_length(stream, size);
|
||||
|
||||
@@ -98,7 +98,7 @@ index 75573da..c6588be 100644
|
||||
|
||||
|
||||
From 9a1e2d416be441c199f83239ec3fa0e336c4e0b6 Mon Sep 17 00:00:00 2001
|
||||
From: Sergei Reznikov <diver@gelios.net>
|
||||
From: Gerasim Troeglazov <3deyes@gmail.com>
|
||||
Date: Tue, 31 Mar 2015 16:21:27 +0300
|
||||
Subject: gcc2 fixes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user