add package djvulibre

This commit is contained in:
darealshinji 2016-04-08 19:25:22 +02:00
parent d11555c760
commit 9ba1b57e4b
5 changed files with 286 additions and 0 deletions

View File

@ -1265,6 +1265,10 @@ local-pkg-list: $(LOCAL_PKG_LIST)</pre>
<td class="package">devil</td>
<td class="website"><a href="http://openil.sourceforge.net/">DevIL</a></td>
</tr>
<tr>
<td class="package">djvulibre</td>
<td class="website"><a href="http://djvu.sourceforge.net/">DjVuLibre</a></td>
</tr>
<tr>
<td class="package">dlfcn-win32</td>
<td class="website"><a href="https://code.google.com/p/dlfcn-win32/">POSIX dlfcn wrapper for Windows</a></td>

View File

@ -0,0 +1,16 @@
This file is part of MXE.
See index.html for further information.
Desktop files not needed for MXE.
--- a/Makefile.in
+++ b/Makefile.in
@@ -32,7 +32,7 @@
@XML_YES@SUBDIRS_XML = xmltools
@XML_NO@SUBDIRS_XML =
-SUBDIRS_LAST = desktopfiles
+@DESKTOP_YES@SUBDIRS_LAST = desktopfiles
SUBDIRS = ${SUBDIRS_FIRST} ${SUBDIRS_XML} ${SUBDIRS_I18N} ${SUBDIRS_LAST}

View File

@ -0,0 +1,144 @@
This file is part of MXE.
See index.html for further information.
Add .exe to binary filenames.
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -28,6 +28,8 @@
libdir = @libdir@
mandir = @mandir@
+EXEEXT = @EXEEXT@
+
CC = @CC@
CXX = @CXX@
RM = @RM@
@@ -60,10 +62,10 @@
SUBDIRS = jb2cmp
-PROGRAMS = bzz c44 cjb2 cpaldjvu csepdjvu \
- ddjvu djvm djvmcvt djvudump \
- djvups djvuextract djvumake \
- djvused djvutxt djvuserve
+PROGRAMS = bzz$(EXEEXT) c44$(EXEEXT) cjb2$(EXEEXT) cpaldjvu$(EXEEXT) csepdjvu$(EXEEXT) \
+ ddjvu$(EXEEXT) djvm$(EXEEXT) djvmcvt$(EXEEXT) djvudump$(EXEEXT) \
+ djvups$(EXEEXT) djvuextract$(EXEEXT) djvumake$(EXEEXT) \
+ djvused$(EXEEXT) djvutxt$(EXEEXT) djvuserve$(EXEEXT)
SCRIPTS = djvudigital any2djvu
@@ -117,63 +119,63 @@
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} annotate.o ${LIBDJVU} ${LIBS}
-bzz: bzz.o
+bzz$(EXEEXT): bzz.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} bzz.o ${LIBDJVU} ${LIBS}
-c44: c44.o
+c44$(EXEEXT): c44.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} c44.o ${LIBDJVU} ${LIBS}
-cjb2: cjb2.o ${JB2OBJS}
+cjb2$(EXEEXT): cjb2.o ${JB2OBJS}
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} cjb2.o ${JB2OBJS} ${LIBDJVU} ${MORELIBS}
-cpaldjvu: cpaldjvu.o ${JB2OBJS}
+cpaldjvu$(EXEEXT): cpaldjvu.o ${JB2OBJS}
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} cpaldjvu.o ${JB2OBJS} ${LIBDJVU} ${LIBS}
-csepdjvu: csepdjvu.o ${JB2OBJS}
+csepdjvu$(EXEEXT): csepdjvu.o ${JB2OBJS}
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} csepdjvu.o ${JB2OBJS} ${LIBDJVU} ${LIBS}
-ddjvu: ddjvu.o tiff2pdf.o
+ddjvu$(EXEEXT): ddjvu.o tiff2pdf.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} ddjvu.o tiff2pdf.o ${LIBDJVU} ${MORELIBS}
-djvm: djvm.o
+djvm$(EXEEXT): djvm.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvm.o ${LIBDJVU} ${LIBS}
-djvmcvt: djvmcvt.o
+djvmcvt$(EXEEXT): djvmcvt.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvmcvt.o ${LIBDJVU} ${LIBS}
-djvudump: djvudump.o
+djvudump$(EXEEXT): djvudump.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvudump.o ${LIBDJVU} ${LIBS}
-djvups: djvups.o
+djvups$(EXEEXT): djvups.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvups.o ${LIBDJVU} ${LIBS}
-djvuextract: djvuextract.o
+djvuextract$(EXEEXT): djvuextract.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvuextract.o ${LIBDJVU} ${LIBS}
-djvumake: djvumake.o
+djvumake$(EXEEXT): djvumake.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvumake.o ${LIBDJVU} ${LIBS}
-djvused: djvused.o
+djvused$(EXEEXT): djvused.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvused.o ${LIBDJVU} ${LIBS}
-djvutxt: djvutxt.o
+djvutxt$(EXEEXT): djvutxt.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvutxt.o ${LIBDJVU} ${LIBS}
-djvuserve: djvuserve.o
+djvuserve$(EXEEXT): djvuserve.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvuserve.o ${LIBDJVU} ${LIBS}
--- a/xmltools/Makefile.in
+++ b/xmltools/Makefile.in
@@ -28,6 +28,8 @@
libdir = @libdir@
mandir = @mandir@
+EXEEXT = @EXEEXT@
+
CC = @CC@
CXX = @CXX@
RM = @RM@
@@ -55,7 +57,7 @@
CFLAGS = ${FLAGS} @CPPFLAGS@ @CFLAGS@
CXXFLAGS = ${FLAGS} ${CXXRPOFLAGS} @CPPFLAGS@ @CXXFLAGS@
-PROGRAMS = djvutoxml djvuxmlparser
+PROGRAMS = djvutoxml$(EXEEXT) djvuxmlparser$(EXEEXT)
all: ${PROGRAMS} djvuxml.1
@@ -97,11 +99,11 @@
sed < ${srcdir}/djvuxml.1.in > djvuxml.1 \
-e 's,DATADIR,${datadir},'
-djvutoxml: djvutoxml.o
+djvutoxml$(EXEEXT): djvutoxml.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvutoxml.o ${LIBDJVU} ${LIBS}
-djvuxmlparser: djvuxmlparser.o
+djvuxmlparser$(EXEEXT): djvuxmlparser.o
${LIBTOOL} --mode=link \
${CXX} -o $@ ${CXXFLAGS} djvuxmlparser.o ${LIBDJVU} ${LIBS}

View File

@ -0,0 +1,93 @@
This file is part of MXE.
See index.html for further information.
Source: https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-djvulibre
--- a/libdjvu/DjVuPort.cpp
+++ b/libdjvu/DjVuPort.cpp
@@ -466,11 +466,11 @@
// Sort in depth order
int max_dist=0;
for(pos=set;pos;++pos)
- if (max_dist < (int)(long)set[pos])
- max_dist = (int)(long)set[pos];
+ if (max_dist < (int)(size_t)set[pos])
+ max_dist = (int)(size_t)set[pos];
GArray<GList<const void*> > lists(0,max_dist);
for(pos=set;pos;++pos)
- lists[(int)(long)set[pos]].append(set.key(pos));
+ lists[(int)(size_t)set[pos]].append(set.key(pos));
for(int dist=0;dist<=max_dist;dist++)
for(pos=lists[dist];pos;++pos)
{
--- a/libdjvu/GBitmap.cpp
+++ b/libdjvu/GBitmap.cpp
@@ -469,7 +469,7 @@
{
if (!monitorptr)
{
- unsigned long x = (unsigned long)this;
+ size_t x = (size_t)this;
monitorptr = &monitors[(x^(x>>5)) % NMONITORS];
}
}
--- a/libdjvu/GContainer.h
+++ b/libdjvu/GContainer.h
@@ -178,7 +178,7 @@
static inline unsigned int
hash(const void * const & x)
{
- return (unsigned long) x;
+ return (unsigned long)((size_t) x);
}
/** Hashing function (float). */
--- a/libdjvu/IW44EncodeCodec.cpp
+++ b/libdjvu/IW44EncodeCodec.cpp
@@ -310,7 +310,7 @@
static inline void
mmx_fv_1 ( short* &q, short* e, int s, int s3 )
{
- while (q<e && (((long)q)&0x7))
+ while (q<e && (((intptr_t)q)&0x7))
{
int a = (int)q[-s] + (int)q[s];
int b = (int)q[-s3] + (int)q[s3];
@@ -353,7 +353,7 @@
static inline void
mmx_fv_2 ( short* &q, short* e, int s, int s3 )
{
- while (q<e && (((long)q)&0x7))
+ while (q<e && (((intptr_t)q)&0x7))
{
int a = (int)q[-s] + (int)q[s];
int b = (int)q[-s3] + (int)q[s3];
--- a/libdjvu/IW44Image.cpp
+++ b/libdjvu/IW44Image.cpp
@@ -167,7 +167,7 @@
static void
mmx_bv_1 ( short* &q, short* e, int s, int s3 )
{
- while (q<e && (((long)q)&0x7))
+ while (q<e && (((intptr_t)q)&0x7))
{
int a = (int)q[-s] + (int)q[s];
int b = (int)q[-s3] + (int)q[s3];
@@ -211,7 +211,7 @@
static void
mmx_bv_2 ( short* &q, short* e, int s, int s3 )
{
- while (q<e && (((long)q)&0x7))
+ while (q<e && (((intptr_t)q)&0x7))
{
int a = (int)q[-s] + (int)q[s];
int b = (int)q[-s3] + (int)q[s3];
@@ -649,7 +649,7 @@
// Allocate enough room for pointers plus alignment
short *p = alloc( (n+1) * sizeof(short*) / sizeof(short) );
// Align on pointer size
- while ( ((long)p) & (sizeof(short*)-1) )
+ while ( ((size_t)p) & (sizeof(short*)-1) )
p += 1;
// Cast and return
return (short**)p;

29
src/djvulibre.mk Normal file
View File

@ -0,0 +1,29 @@
# This file is part of MXE.
# See index.html for further information.
PKG := djvulibre
$(PKG)_IGNORE := 3.5.27
$(PKG)_VERSION_ := 3.5.25
$(PKG)_VERSION := $($(PKG)_VERSION_).3
$(PKG)_CHECKSUM := 898d7ed6dd2fa311a521baa95407a91b20a872d80c45e8245442d64f142cb1e0
$(PKG)_SUBDIR := $(PKG)-$($(PKG)_VERSION_)
$(PKG)_FILE := $(PKG)-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := https://sourceforge.net/projects/djvu/files/DjVuLibre/$($(PKG)_VERSION_)/$($(PKG)_FILE)/download
$(PKG)_DEPS := gcc jpeg tiff zlib
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://sourceforge.net/projects/djvu/files/DjVuLibre/' | \
$(SED) -n 's,.*/\([0-9][^A-Za-z"]*\)/".*,\1,p' | \
head -1
endef
define $(PKG)_BUILD
cd '$(1)' && CPPFLAGS='-DDLL_EXPORT' ./configure \
$(MXE_CONFIGURE_OPTS) \
--disable-desktopfiles
$(MAKE) -C '$(1)' -j '$(JOBS)'
$(MAKE) -C '$(1)' -j 1 install
endef
$(PKG)_BUILD_SHARED =