aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--graphics/Makefile1
-rw-r--r--graphics/libjxr/Makefile36
-rw-r--r--graphics/libjxr/distinfo5
-rw-r--r--graphics/libjxr/files/BSDmakefile.JxrDecApp15
-rw-r--r--graphics/libjxr/files/BSDmakefile.JxrEncApp15
-rw-r--r--graphics/libjxr/files/BSDmakefile.jxrgluelib21
-rw-r--r--graphics/libjxr/files/BSDmakefile.libjpegxr21
-rw-r--r--graphics/libjxr/files/patch-bug74859016
-rw-r--r--graphics/libjxr/files/patch-typos27
-rw-r--r--graphics/libjxr/files/test.sh27
-rw-r--r--graphics/libjxr/pkg-descr18
-rw-r--r--graphics/libjxr/pkg-plist20
12 files changed, 222 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile
index 99d634d7e0b9..e98c3e51b935 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -503,6 +503,7 @@
SUBDIR += libimg
SUBDIR += libiptcdata
SUBDIR += libjpeg-turbo
+ SUBDIR += libjxr
SUBDIR += libkdcraw-kde4
SUBDIR += libkexiv2-kde4
SUBDIR += libkface
diff --git a/graphics/libjxr/Makefile b/graphics/libjxr/Makefile
new file mode 100644
index 000000000000..40a1356ef78c
--- /dev/null
+++ b/graphics/libjxr/Makefile
@@ -0,0 +1,36 @@
+# $FreeBSD$
+
+PORTNAME= jxrlib
+PORTVERSION= 1.1
+CATEGORIES= graphics devel
+MASTER_SITES= ${MASTER_SITE_DEBIAN}
+MASTER_SITE_SUBDIR=pool/main/j/jxrlib
+DISTFILES= jxrlib_${PORTVERSION}.orig.tar.gz \
+ jxrlib_${PORTVERSION}-6.debian.tar.xz
+
+MAINTAINER= mi@aldan.algebra.com
+COMMENT= Library for JPEG XR, a.k.a. Windows MediaTM Photo
+
+LICENSE= BSD
+
+USES= dos2unix uidfix
+USE_LDCONFIG= yes
+MAKEFILE= BSDmakefile # created by do-configure
+MAKE_ENV= WRKDIR="${WRKDIR}"
+
+do-configure:
+ ${RM} -f ${WRKSRC}/BSDmakefile
+.for d in libjpegxr jxrgluelib JxrEncApp JxrDecApp
+ ${MKDIR} ${WRKSRC}/$d
+ ${LN} -sf ${FILESDIR}/BSDmakefile.$d ${WRKSRC}/$d/BSDmakefile
+ ${ECHO} "SUBDIR+=$d" >> ${WRKSRC}/BSDmakefile
+.endfor
+ ${ECHO} '.include <bsd.subdir.mk>' >> ${WRKSRC}/BSDmakefile
+
+post-build:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/include/jxrlib
+
+regression-test test check: build
+ ${SETENV} WRKSRC="${WRKSRC}" ${SH} -x ${FILESDIR}/test.sh
+
+.include <bsd.port.mk>
diff --git a/graphics/libjxr/distinfo b/graphics/libjxr/distinfo
new file mode 100644
index 000000000000..43d5fe51dd17
--- /dev/null
+++ b/graphics/libjxr/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1492227072
+SHA256 (jxrlib_1.1.orig.tar.gz) = c7287b86780befa0914f2eeb8be2ac83e672ebd4bd16dc5574a36a59d9708303
+SIZE (jxrlib_1.1.orig.tar.gz) = 287517
+SHA256 (jxrlib_1.1-6.debian.tar.xz) = b8263001fbe8c871dbe3557926f29dfb25aa13dd578a9b4584fe21011a526d58
+SIZE (jxrlib_1.1-6.debian.tar.xz) = 24184
diff --git a/graphics/libjxr/files/BSDmakefile.JxrDecApp b/graphics/libjxr/files/BSDmakefile.JxrDecApp
new file mode 100644
index 000000000000..93b6ccb2cfbe
--- /dev/null
+++ b/graphics/libjxr/files/BSDmakefile.JxrDecApp
@@ -0,0 +1,15 @@
+PROG= JxrDecApp
+
+BINDIR= ${PREFIX}/bin
+MANDIR= ${MANPREFIX}/man/man
+
+CFLAGS= -I${.CURDIR:H}/jxrgluelib -I${.CURDIR:H}/jxrtestlib
+CFLAGS+=-I${.CURDIR:H}/image/sys -I${.CURDIR:H}/common/include
+CFLAGS+=-Wno-extra-tokens -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+
+LDADD= -L${.CURDIR:H}/jxrgluelib -Wl,-rpath-link=${.CURDIR:H}/libjpegxr -ljxrglue
+
+.PATH: ${.CURDIR:H}/jxrencoderdecoder
+.PATH: ${WRKDIR}/debian # man-pages are there
+
+.include <bsd.prog.mk>
diff --git a/graphics/libjxr/files/BSDmakefile.JxrEncApp b/graphics/libjxr/files/BSDmakefile.JxrEncApp
new file mode 100644
index 000000000000..5b0985a0d229
--- /dev/null
+++ b/graphics/libjxr/files/BSDmakefile.JxrEncApp
@@ -0,0 +1,15 @@
+PROG= JxrEncApp
+
+BINDIR= ${PREFIX}/bin
+MANDIR= ${MANPREFIX}/man/man
+
+CFLAGS= -I${.CURDIR:H}/jxrgluelib -I${.CURDIR:H}/jxrtestlib
+CFLAGS+=-I${.CURDIR:H}/image/sys -I${.CURDIR:H}/common/include
+CFLAGS+=-Wno-extra-tokens -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+
+LDADD= -L${.CURDIR:H}/jxrgluelib -Wl,-rpath-link=${.CURDIR:H}/libjpegxr -ljxrglue
+
+.PATH: ${.CURDIR:H}/jxrencoderdecoder
+.PATH: ${WRKDIR}/debian # man-pages are there
+
+.include <bsd.prog.mk>
diff --git a/graphics/libjxr/files/BSDmakefile.jxrgluelib b/graphics/libjxr/files/BSDmakefile.jxrgluelib
new file mode 100644
index 000000000000..64071e1a411c
--- /dev/null
+++ b/graphics/libjxr/files/BSDmakefile.jxrgluelib
@@ -0,0 +1,21 @@
+LIB= jxrglue
+SHLIB_MAJOR= 1
+NO_PROFILE= nope
+LIBDIR= ${PREFIX}/lib
+INCLUDEDIR= ${PREFIX}/include/jxrlib
+INCS= JXRGlue.h JXRMeta.h JXRTest.h
+
+SRCS= JXRGlue.c JXRMeta.c JXRGluePFC.c JXRGlueJxr.c
+SRCS+= JXRTest.c JXRTestBmp.c JXRTestHdr.c JXRTestPnm.c \
+ JXRTestTif.c JXRTestYUV.c
+
+.PATH: ${.CURDIR:H}/jxrtestlib
+
+CFLAGS+= -I. -I${.CURDIR:H}/common/include -I${.CURDIR:H}/image/sys
+CFLAGS+= -I${.CURDIR:H}/jxrtestlib
+CFLAGS+= -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+CFLAGS+= -Wno-extra-tokens
+
+LDADD= -L${.CURDIR:H}/libjpegxr -ljpegxr -lm
+
+.include <bsd.lib.mk>
diff --git a/graphics/libjxr/files/BSDmakefile.libjpegxr b/graphics/libjxr/files/BSDmakefile.libjpegxr
new file mode 100644
index 000000000000..f0a1e9ea5b90
--- /dev/null
+++ b/graphics/libjxr/files/BSDmakefile.libjpegxr
@@ -0,0 +1,21 @@
+LIB= jpegxr
+SHLIB_MAJOR= 1
+NO_PROFILE= nope
+LIBDIR= ${PREFIX}/lib
+INCLUDEDIR= ${PREFIX}/include/jxrlib
+INCS= guiddef.h windowsmediaphoto.h wmsal.h wmspecstring.h \
+ wmspecstrings_adt.h wmspecstrings_strict.h wmspecstrings_undef.h
+
+SRCS= encode.c segenc.c strenc.c strFwdTransform.c strPredQuantEnc.c \
+ decode.c postprocess.c segdec.c strdec.c strInvTransform.c \
+ strPredQuantDec.c JXRTranscode.c adapthuff.c image.c \
+ strcodec.c strPredQuant.c strTransform.c perfTimerANSI.c
+
+.PATH: ${.CURDIR:H}/image/sys ${.CURDIR:H}/image/encode
+.PATH: ${.CURDIR:H}/image/decode ${.CURDIR:H}/common/include
+
+CFLAGS+= -I. -I${.CURDIR:H}/common/include -I${.CURDIR:H}/image/sys
+CFLAGS+= -D__ANSI__ -DDISABLE_PERF_MEASUREMENT
+CFLAGS+= -Wno-extra-tokens
+
+.include <bsd.lib.mk>
diff --git a/graphics/libjxr/files/patch-bug748590 b/graphics/libjxr/files/patch-bug748590
new file mode 100644
index 000000000000..cf90ebf69f6c
--- /dev/null
+++ b/graphics/libjxr/files/patch-bug748590
@@ -0,0 +1,16 @@
+Description: Fix function signature
+Author: Mathieu Malaterre <malat@debian.org>
+Origin: upstream, https://jxrlib.codeplex.com/SourceControl/changeset/04cf339385b8196f98025b43a366a0790deac994
+Bug-Debian: http://bugs.debian.org/748590
+
+--- image/decode/JXRTranscode.c
++++ image/decode/JXRTranscode.c
+@@ -47,7 +47,7 @@ EXTERN_C Void FreeCodingContextDec(CWMIm
+ EXTERN_C Int StrEncInit(CWMImageStrCodec *);
+ EXTERN_C Void StrIOEncTerm(CWMImageStrCodec *);
+ EXTERN_C Void FreeCodingContextEnc(CWMImageStrCodec *);
+-EXTERN_C Void encodeMB(CWMImageStrCodec *, Int, Int);
++EXTERN_C Int encodeMB(CWMImageStrCodec *, Int, Int);
+ EXTERN_C Int writeIndexTableNull(CWMImageStrCodec *);
+ EXTERN_C Void writePacketHeader(BitIOInfo *, U8, U8);
+
diff --git a/graphics/libjxr/files/patch-typos b/graphics/libjxr/files/patch-typos
new file mode 100644
index 000000000000..1523b2a6bf92
--- /dev/null
+++ b/graphics/libjxr/files/patch-typos
@@ -0,0 +1,27 @@
+Description: Fix typos and remove some warnings
+Author: Mathieu Malaterre <malat@debian.org>
+
+Cleaned up for FreeBSD by mi
+
+--- jxrencoderdecoder/JxrEncApp.c
++++ jxrencoderdecoder/JxrEncApp.c
+@@ -578,7 +578,7 @@ main(int argc, char* argv[])
+
+ //================================
+ Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION));
+- Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, &pEncoder));
++ Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, (void**)&pEncoder));
+
+ //----------------------------------------------------------------
+ Call(PKCreateTestFactory(&pTestFactory, WMP_SDK_VERSION));
+--- jxrgluelib/JXRMeta.h
++++ jxrgluelib/JXRMeta.h
+@@ -34,7 +34,7 @@
+
+ #ifndef UNREFERENCED_PARAMETER
+ #define UNREFERENCED_PARAMETER(P) { (P) = (P); }
+-#endif UNREFERENCED_PARAMETER
++#endif /*UNREFERENCED_PARAMETER*/
+
+ //================================================================
+ // Container
diff --git a/graphics/libjxr/files/test.sh b/graphics/libjxr/files/test.sh
new file mode 100644
index 000000000000..0dcec68bee85
--- /dev/null
+++ b/graphics/libjxr/files/test.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Quick smoke-test for the newly-built library and command-line utilities
+# Copied from Brew:
+# https://github.com/Homebrew/homebrew-core/blob/697d00453308186b31ecd22737f5b10cc105b162/Formula/jxrlib.rb
+
+b64decode -r << EOBMP > ${WRKSRC}/test.bmp
+Qk06AAAAAAAAADYAAAAoAAAAAQAAAAEAAAABABgAAAAAAAQAAADCDgAAwg4AAAAAAAAAAAAA////
+AA==
+EOBMP
+
+export LD_LIBRARY_PATH=${WRKSRC}/jxrgluelib:${WRKSRC}/libjpegxr
+
+${WRKSRC}/JxrEncApp/JxrEncApp -i ${WRKSRC}/test.bmp -o ${WRKSRC}/test.jxr
+${WRKSRC}/JxrDecApp/JxrDecApp -i ${WRKSRC}/test.jxr -o ${WRKSRC}/result.bmp
+
+ls -l ${WRKSRC}/test.bmp ${WRKSRC}/test.jxr ${WRKSRC}/result.bmp
+
+if cmp -zs ${WRKSRC}/test.bmp ${WRKSRC}/result.bmp
+then
+ echo Result matches expectations
+ exit 0
+else
+ echo Result is not the same as input, a problem
+ exit 1
+fi
+
diff --git a/graphics/libjxr/pkg-descr b/graphics/libjxr/pkg-descr
new file mode 100644
index 000000000000..9a1b77c6d08a
--- /dev/null
+++ b/graphics/libjxr/pkg-descr
@@ -0,0 +1,18 @@
+JPEG XR is an approved ISO/IEC International standard (its official
+designation is ISO/IEC 29199-2).
+
+JPEG XR started its life in Microsoft Research. It publicly first appeared
+as the HD Photo format in Windows Vista.
+
+For web developers, JPEG XR has a large number of interesting features, see
+the table below. Some of these are big advantages over other image formats
+like JPEG, PNG, OpenEXR, and TIFF.
+ - Better Compression (40% smaller than JPEG)
+ - Lossless Mode (better compression than PNG)
+ - Alpha Channel (compress color lossy and alpha losslessly)
+ - Extended Bitdepth (supports 8-, 16-, and 32-bit/channel)
+ - Progressive Decode
+ - Advanced Decoding Features (tile-based layout, for efficient
+ region-of-interest access.)
+
+WWW: https://jxrlib.codeplex.com/
diff --git a/graphics/libjxr/pkg-plist b/graphics/libjxr/pkg-plist
new file mode 100644
index 000000000000..1406fc02df63
--- /dev/null
+++ b/graphics/libjxr/pkg-plist
@@ -0,0 +1,20 @@
+bin/JxrDecApp
+bin/JxrEncApp
+include/jxrlib/JXRGlue.h
+include/jxrlib/JXRMeta.h
+include/jxrlib/JXRTest.h
+include/jxrlib/guiddef.h
+include/jxrlib/windowsmediaphoto.h
+include/jxrlib/wmsal.h
+include/jxrlib/wmspecstring.h
+include/jxrlib/wmspecstrings_adt.h
+include/jxrlib/wmspecstrings_strict.h
+include/jxrlib/wmspecstrings_undef.h
+lib/libjpegxr.a
+lib/libjpegxr.so
+lib/libjpegxr.so.1
+lib/libjxrglue.a
+lib/libjxrglue.so
+lib/libjxrglue.so.1
+man/man1/JxrDecApp.1.gz
+man/man1/JxrEncApp.1.gz