summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO29
-rw-r--r--PKGBUILD70
-rw-r--r--libecwj2-3.3-2593.patch26
-rw-r--r--libecwj2-3.3-3245a.patch15
-rw-r--r--libecwj2-3.3-3245b.patch11
-rw-r--r--libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch16
-rw-r--r--libecwj2-3.3-nolcms.patch85
-rw-r--r--libecwj2-3.3-wcharfix.patch14
8 files changed, 266 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..66dc1e51e049
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,29 @@
+# Generated by makepkg 4.2.1
+# Sun Sep 13 09:27:19 UTC 2015
+pkgbase = libecwj2
+ pkgdesc = Library for both the ECW and the ISO JPEG 2000 image file formats
+ pkgver = 3.3
+ pkgrel = 3
+ url = http://trac.osgeo.org/gdal/wiki/ECW
+ arch = i686
+ arch = x86_64
+ license = ECWPL
+ makedepends = autoconf
+ makedepends = libtool
+ source = http://meuk.technokrat.nl/libecwj2-3.3-2006-09-06.zip
+ source = libecwj2-3.3-nolcms.patch
+ source = libecwj2-3.3-3245a.patch
+ source = libecwj2-3.3-3245b.patch
+ source = libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
+ source = libecwj2-3.3-2593.patch
+ source = libecwj2-3.3-wcharfix.patch
+ md5sums = acc04e07153c2a2a6595b3e2ebf34432
+ md5sums = e4c4cde42a8910650fe665bf7c9bbde3
+ md5sums = 7871632c8d52ceb0ac02589deaa3c347
+ md5sums = cf23c8fbb0009905185886708d1c6de4
+ md5sums = 3018aa1e84ca64e0026c4f3d3481cac1
+ md5sums = 3ebdc31fa456f47aba6e1a3295f690d3
+ md5sums = d0bf5fa7e6ba62ef5a138b5b22364b4e
+
+pkgname = libecwj2
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..20354fcb58e1
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,70 @@
+# Contributor: Homme Zwaagstra, danitool
+pkgname=libecwj2
+pkgver=3.3
+pkgrel=3
+pkgdesc="Library for both the ECW and the ISO JPEG 2000 image file formats"
+arch=('i686' 'x86_64')
+url="http://trac.osgeo.org/gdal/wiki/ECW"
+license=('ECWPL')
+depends=()
+makedepends=('autoconf' 'libtool')
+source=("http://meuk.technokrat.nl/${pkgname}-${pkgver}-2006-09-06.zip"
+ 'libecwj2-3.3-nolcms.patch'
+ 'libecwj2-3.3-3245a.patch'
+ 'libecwj2-3.3-3245b.patch'
+ 'libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch'
+ 'libecwj2-3.3-2593.patch'
+ 'libecwj2-3.3-wcharfix.patch')
+md5sums=('acc04e07153c2a2a6595b3e2ebf34432'
+ 'e4c4cde42a8910650fe665bf7c9bbde3'
+ '7871632c8d52ceb0ac02589deaa3c347'
+ 'cf23c8fbb0009905185886708d1c6de4'
+ '3018aa1e84ca64e0026c4f3d3481cac1'
+ '3ebdc31fa456f47aba6e1a3295f690d3'
+ 'd0bf5fa7e6ba62ef5a138b5b22364b4e')
+
+build() {
+ cd $srcdir/$pkgname-$pkgver
+
+ # Memory leak patches from http://trac.osgeo.org/mapserver/ticket/3245
+ patch -p0 -i ${srcdir}/libecwj2-3.3-3245a.patch
+ patch -p0 -i ${srcdir}/libecwj2-3.3-3245b.patch
+
+ # Memory overflow patch from http://trac.osgeo.org/gdal/ticket/3366
+ patch -p0 -i ${srcdir}/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
+
+ # Fix crash creating 16bit JP images on x86_64 from http://trac.osgeo.org/gdal/ticket/2593
+ patch -p0 -i ${srcdir}/libecwj2-3.3-2593.patch
+
+ # Gentoo patch
+ patch -Np 0 -i "$srcdir/${pkgname}-${pkgver}-nolcms.patch" || return 1
+ rm -rf Source/C/libjpeg Source/C/NCSEcw/lcms
+
+ # Gentoo bug 328075
+ sed -i -e "s:includeHEADERS_INSTALL:INSTALL_HEADER:" \
+ Source/NCSBuildGnu/Makefile.am || return 1
+
+ # std::length_error bug
+ patch -p0 -i ${srcdir}/libecwj2-3.3-wcharfix.patch
+
+ # rid of subdirectory warnings
+ sed -i -e "s:AM_INIT_AUTOMAKE:AM_INIT_AUTOMAKE([subdir-objects]):" \
+ configure.in || return 1
+ #libtoolize suggestions
+ sed -i -e '7aAC_CONFIG_MACRO_DIRS([m4])' configure.in
+ sed -i -e '8aACLOCAL_AMFLAGS= -I m4' Makefile.am
+ mkdir m4
+
+ autoreconf -i
+
+ ./configure --prefix=/usr || return 1
+ make || return 1
+ }
+
+package() {
+ cd $srcdir/$pkgname-$pkgver
+ install -d "${pkgdir}/usr/include" || return 1
+ make prefix="${pkgdir}/usr" install || return 1
+
+ install -D -m644 SDK.pdf ${pkgdir}/usr/share/doc/${pkgname}-${pkgver}/SDK.pdf || return 1
+ }
diff --git a/libecwj2-3.3-2593.patch b/libecwj2-3.3-2593.patch
new file mode 100644
index 000000000000..fbb66adca78c
--- /dev/null
+++ b/libecwj2-3.3-2593.patch
@@ -0,0 +1,26 @@
+--- Source/C/NCSEcw/NCSJP2/NCSJPCResolution.cpp 2006-07-03 10:15:12.000000000 -0500
++++ Source/C/NCSEcw/NCSJP2/NCSJPCResolution.cpp 2008-12-10 08:58:47.000000000 -0600
+@@ -1773,11 +1773,11 @@
+ //Step0-1 == 2State.
+ //
+
+- UINT32 n = 0;
++ INT32 n = 0;
+ nWidth = NCSCeilDiv(nWidth, 2);
+
+- UINT32 n2n = n * 2 - 2;
+-
++ INT32 n2n = n * 2 - 2;
++
+ INT32 nPrevVert01 = pSrc1Down[n2n] - NCSFloorDiv(pSrc0[n2n] + pSrc2Down[n2n], 2);
+ INT32 nPrevVert11 = pSrc1Down[n2n+1] - NCSFloorDiv(pSrc0[n2n+1] + pSrc2Down[n2n+1], 2);
+ INT32 nPrevVert00 = pSrc0[n2n] + NCSFloorDiv(pSrc1Up[n2n] - NCSFloorDiv(pSrc2Up[n2n] + pSrc0[n2n], 2) + nPrevVert01 + 2, 4);
+@@ -1788,7 +1788,7 @@
+ INT32 nVert01 = pSrc1Down[n2n] - NCSFloorDiv(pSrc0[n2n] + pSrc2Down[n2n], 2);
+ INT32 nVert00 = pSrc0[n2n] + NCSFloorDiv(pSrc1Up[n2n] - NCSFloorDiv(pSrc2Up[n2n] + pSrc0[n2n], 2) + nVert01 + 2, 4);
+
+- for(; n < nWidth; n++) {
++ for(; n < (INT32)nWidth; n++) {
+ n2n = 2 * n;
+
+ INT32 nVert11 = pSrc1Down[n2n+1] - NCSFloorDiv(pSrc0[n2n+1] + pSrc2Down[n2n+1], 2);
diff --git a/libecwj2-3.3-3245a.patch b/libecwj2-3.3-3245a.patch
new file mode 100644
index 000000000000..c5272629ffc3
--- /dev/null
+++ b/libecwj2-3.3-3245a.patch
@@ -0,0 +1,15 @@
+--- ./Source/C/NCSUtil/NCSThread.cpp.orig 2010-10-29 16:17:21.000000000 +0100
++++ ./Source/C/NCSUtil/NCSThread.cpp 2010-10-29 16:20:15.000000000 +0100
+@@ -47,6 +47,12 @@
+ //void **pStartData = (void **)NCSMalloc(2 * sizeof(void*), TRUE);
+ //pStartData[0] = (void*)this;
+ //pStartData[1] = pData;
++ if( m_Thread != NCS_NULL_THREAD_ID )
++ {
++ //fprintf( stderr, "Cleanup old threadinfo in spawn()\n" );
++ FreeInfo();
++ m_Thread = NCS_NULL_THREAD_ID;
++ }
+ m_pData = pData;
+ m_bRun = true;
+ return(NCSThreadSpawn(&m_Thread, CNCSThread::ThreadFunc, (void*)this, bCreateSuspended)==TRUE);
diff --git a/libecwj2-3.3-3245b.patch b/libecwj2-3.3-3245b.patch
new file mode 100644
index 000000000000..7f01dc31779c
--- /dev/null
+++ b/libecwj2-3.3-3245b.patch
@@ -0,0 +1,11 @@
+--- Source/C/tinyxml/tinyxml.cpp 2010-10-29 16:12:42.000000000 +0100
++++ Source/C/tinyxml/tinyxml.cpp 2010-10-29 16:13:54.000000000 +0100
+@@ -1020,6 +1020,8 @@
+
+ if ( fread( buf, length, 1, file ) != 1 ) {
+ //if ( fread( buf, 1, length, file ) != (size_t)length ) {
++ delete [] buf;
++ buf = 0;
+ SetError( TIXML_ERROR_OPENING_FILE, 0, 0, TIXML_ENCODING_UNKNOWN );
+ fclose( file );
+ return false;
diff --git a/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch b/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
new file mode 100644
index 000000000000..548903083933
--- /dev/null
+++ b/libecwj2-3.3-NCSPhysicalMemorySize-Linux.patch
@@ -0,0 +1,16 @@
+--- Source/C/NCSUtil/malloc.c.ori 2010-02-02 00:09:24.000000000 +0100
++++ Source/C/NCSUtil/malloc.c 2010-02-02 00:17:13.000000000 +0100
+@@ -390,7 +390,12 @@
+ #else /* SOLARIS */
+
+ #ifdef LINUX
+- return(sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE));
++ long nPages = sysconf(_SC_PHYS_PAGES);
++ long nPageSize = sysconf(_SC_PAGESIZE);
++ if (nPages > INT_MAX / nPageSize)
++ return INT_MAX;
++ else
++ return (INT32)(nPages * nPageSize);
+ #elif defined MACOSX
+ return(128*1024*1024);
+
diff --git a/libecwj2-3.3-nolcms.patch b/libecwj2-3.3-nolcms.patch
new file mode 100644
index 000000000000..9e92eec63f82
--- /dev/null
+++ b/libecwj2-3.3-nolcms.patch
@@ -0,0 +1,85 @@
+diff -Naur ../libecwj2-3.3/Makefile.am ./Makefile.am
+--- ../libecwj2-3.3/Makefile.am 2006-07-02 20:14:18.000000000 -0500
++++ ./Makefile.am 2009-03-16 14:04:13.000000000 -0500
+@@ -1,3 +1,5 @@
++AUTOMAKE_OPTIONS = foreign
++
+ SUBDIRS = \
+ Source
+
+@@ -127,7 +129,5 @@
+ Source/include/gdt_pub.h \
+ Source/include/gdt_stat.h \
+ Source/include/pcs_erm.h \
+- Source/C/NCSEcw/lcms/include/lcms.h \
+- Source/C/NCSEcw/lcms/include/icc34.h \
+ Source/NCSBuildGnu/NCSGnuConfig.h
+
+diff -Naur ../libecwj2-3.3/Source/NCSBuildGnu/Makefile.am ./Source/NCSBuildGnu/Makefile.am
+--- ../libecwj2-3.3/Source/NCSBuildGnu/Makefile.am 2006-07-02 20:14:18.000000000 -0500
++++ ./Source/NCSBuildGnu/Makefile.am 2009-03-16 14:00:50.000000000 -0500
+@@ -113,22 +113,6 @@
+ ../C/NCSEcw/shared_src/qmf_util.c \
+ ../C/NCSEcw/shared_src/quantize.c \
+ ../C/NCSEcw/shared_src/unpack.c \
+- ../C/NCSEcw/lcms/src/cmscnvrt.c \
+- ../C/NCSEcw/lcms/src/cmserr.c \
+- ../C/NCSEcw/lcms/src/cmsgamma.c \
+- ../C/NCSEcw/lcms/src/cmsgmt.c \
+- ../C/NCSEcw/lcms/src/cmsintrp.c \
+- ../C/NCSEcw/lcms/src/cmsio1.c \
+- ../C/NCSEcw/lcms/src/cmslut.c \
+- ../C/NCSEcw/lcms/src/cmsmatsh.c \
+- ../C/NCSEcw/lcms/src/cmsmtrx.c \
+- ../C/NCSEcw/lcms/src/cmsnamed.c \
+- ../C/NCSEcw/lcms/src/cmspack.c \
+- ../C/NCSEcw/lcms/src/cmspcs.c \
+- ../C/NCSEcw/lcms/src/cmssamp.c \
+- ../C/NCSEcw/lcms/src/cmsvirt.c \
+- ../C/NCSEcw/lcms/src/cmswtpnt.c \
+- ../C/NCSEcw/lcms/src/cmsxform.c \
+ ../C/NCSGDT2/NCSGDTEpsg.cpp \
+ ../C/NCSGDT2/NCSGDTEPSGKey.cpp \
+ ../C/NCSGDT2/NCSGDTLocation.cpp
+diff -Naur ../libecwj2-3.3/Source/include/NCSJPCDefs.h ./Source/include/NCSJPCDefs.h
+--- ../libecwj2-3.3/Source/include/NCSJPCDefs.h 2006-07-02 20:15:24.000000000 -0500
++++ ./Source/include/NCSJPCDefs.h 2009-03-16 14:00:27.000000000 -0500
+@@ -59,7 +59,7 @@
+ // Use LCMS for ICC->RGB conversions, supports both
+ // restricted and full ICC profiles.
+ //
+-#define NCSJPC_USE_LCMS
++//#define NCSJPC_USE_LCMS
+
+ //
+ // Use TinyXML for XML DOM Parsing
+diff -Naur ../libecwj2-3.3/configure.in ./configure.in
+--- ../libecwj2-3.3/configure.in 2006-07-02 20:13:30.000000000 -0500
++++ ./configure.in 2009-03-16 14:00:14.000000000 -0500
+@@ -32,17 +32,6 @@
+ # Build some standard absolute include paths for the build
+
+ MAIN_INCLUDE_DIR="$PWD/Source/include"
+-LCMS_INCLUDE_DIR="$PWD/Source/C/NCSEcw/lcms/include"
+-
+-# Run configure in the LCMS directory (using LCMS's own configure script)
+-# to initialise any platform dependent settings that it uses
+-# (e.g. typedefs for int types)
+-
+-THISDIR=$PWD
+-cd Source/C/NCSEcw/lcms
+-chmod +x configure
+-./configure
+-cd $THISDIR
+
+ # Build LIBECWJ2_DEFS with all defines, and NCSGnuSystemDefs.h with defines
+ # needed by apps building against libecwj2.
+@@ -89,7 +78,7 @@
+ LIBECWJ2_CFLAGS="$PLATFORM_CFLAGS"
+ LIBECWJ2_STATIC_LDFLAGS="$PLATFORM_STATIC_LDFLAGS"
+ LIBECWJ2_SHARED_LDFLAGS="$PLATFORM_SHARED_LDFLAGS"
+-LIBECWJ2_INCLUDES="-I$MAIN_INCLUDE_DIR -I$LCMS_INCLUDE_DIR"
++LIBECWJ2_INCLUDES="-I$MAIN_INCLUDE_DIR"
+
+ rm -f Source/NCSBuildGnu/NCSGnuSystemDefs.h
+ echo "#ifndef LIBECWJ2" > Source/NCSBuildGnu/NCSGnuSystemDefs.h \ No newline at end of file
diff --git a/libecwj2-3.3-wcharfix.patch b/libecwj2-3.3-wcharfix.patch
new file mode 100644
index 000000000000..695bc4a50135
--- /dev/null
+++ b/libecwj2-3.3-wcharfix.patch
@@ -0,0 +1,14 @@
+--- Source/C/NCSUtil/NCSPrefsXML.cpp.ori 2012-10-17 12:40:01.000000000 +0200
++++ Source/C/NCSUtil/NCSPrefsXML.cpp 2012-10-17 12:40:30.854812252 +0200
+@@ -32,7 +32,11 @@
+ } else {
+ char *pHomeDir = getenv("HOME");
+ if( pHomeDir ) {
++#ifdef NCS_BUILD_UNICODE
++ sUserPrefsFile.Format( NCS_T("%s%ls"), pHomeDir, NCS_T("/.erm/ncsuserprefs.xml") );
++#else
+ sUserPrefsFile.Format( NCS_T("%s%s"), pHomeDir, NCS_T("/.erm/ncsuserprefs.xml") );
++#endif
+ } else {
+ sUserPrefsFile = NCS_T("/etc/erm/ncsuserprefs.xml");
+ }