Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Mar 2014 18:52:00 GMT
From:      Horia Racoviceanu <horia@racoviceanu.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/187398: [New Port] graphics/mozjpeg A fork of libjpeg-turbo with 'jpgcrush' functionality
Message-ID:  <201403091852.s29Iq0rC066021@cgiserv.freebsd.org>
Resent-Message-ID: <201403091900.s29J001G017769@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         187398
>Category:       ports
>Synopsis:       [New Port] graphics/mozjpeg A fork of libjpeg-turbo with 'jpgcrush' functionality
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 09 19:00:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Horia Racoviceanu
>Release:        9.2-RELEASE
>Organization:
>Environment:
FreeBSD aitch 9.2-RELEASE FreeBSD 9.2-RELEASE #0 r255898: Fri Sep 27 03:52:52 UTC 2013 root@bake.isc.freebsd.org:/usr/obj/usr/src/sys/GENERIC i386
>Description:
MozJPEG is a fork of libjpeg-turbo with 'jpgcrush' functionality built in.

The goal is to provide a production-quality JPEG encoder that improves
compression while maintaining compatibility with the vast majority of deployed
decoders.

The 'jpgcrush' feature finds the progressive coding configuration which uses the
fewest bits. This most frequently reduces file size by 2-10%, but those are not
hard limits. Significantly greater reductions have been observed.

Library configuration defaults are the same as for libjpeg-turbo, in order to
make transitions as painless as possible. There are new configuration options
for new features, but they are not enabled by default.

The 'cjpeg' program defaults are not the same as for the equivalent program in
libjpeg-turbo. The 'cjpeg' defaults for mozjpeg are set to aggressively optimize
for smaller file sizes.

WWW: https://github.com/mozilla/mozjpeg/
>How-To-Repeat:

>Fix:
Build log:
https://redports.org/buildarchive/20140309182142-89203/

Patch attached with submission follows:

# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	mozjpeg
#	mozjpeg/Makefile
#	mozjpeg/pkg-descr
#	mozjpeg/distinfo
#	mozjpeg/pkg-plist
#
echo c - mozjpeg
mkdir -p mozjpeg > /dev/null 2>&1
echo x - mozjpeg/Makefile
sed 's/^X//' >mozjpeg/Makefile << 'dd80bda4542c2e97066bcdb9a4c1d4eb'
X# Created by: Horia Racoviceanu <horia@racoviceanu.com>
X# $FreeBSD$
X
XPORTNAME=	mozjpeg
XPORTVERSION=	1.0
XCATEGORIES=	graphics
X
XMAINTAINER=	horia@racoviceanu.com
XCOMMENT=	A fork of libjpeg-turbo with 'jpgcrush' functionality
X
XLICENSE=	BSD3CLAUSE
X
XBUILD_DEPENDS=	nasm:${PORTSDIR}/devel/nasm
X
XUSE_GITHUB=	yes
XGH_ACCOUNT=	mozilla
XGH_TAGNAME=	${GH_COMMIT}
XGH_COMMIT=	febf346
X
XUSE_AUTOTOOLS=	aclocal:env autoconf automake libtool
XUSE_LDCONFIG=	${PREFIX}/include/${PORTNAME} ${PREFIX}/lib/${PORTNAME}
XGNU_CONFIGURE=	yes
XCONFIGURE_ARGS=	--docdir=${PREFIX}/share/doc/${PORTNAME} \
X		--includedir=${PREFIX}/include/${PORTNAME} \
X		--libdir=${PREFIX}/lib/${PORTNAME}
XLIBTOOL_ARGS+=	--finish ${PREFIX}/lib/${PORTNAME}
XLDFLAGS+=	-L${PREFIX}/lib/${PORTNAME}
X
XPLIST_SUB=	PORTNAME=${PORTNAME} \
X		SOMAJORVERSION=${SOMAJORVERSION}
X
XPORTDOCS=	*
X
XDOCSRCDIR1=	${WRKSRC}/doc/html
XDOCSDIR1=	${DOCSDIR}/html
X
XDOCSRCDIR2=	${DOCSRCDIR1}/search
XDOCSDIR2=	${DOCSDIR1}/search
X
XDOC_FILES=	*.css *.html *.js *.png
X
XPORTEXAMPLES=	*
X
XOPTIONS_DEFINE=	DOCS EXAMPLES GCC SIMD TURBOJPEG
X
XOPTIONS_GROUP=	ARITHMETIC_CODING
XOPTIONS_GROUP_ARITHMETIC_CODING=	DECODING ENCODING
X
XOPTIONS_MULTI=	LIBRARIES
XOPTIONS_MULTI_LIBRARIES=	SHARED STATIC
X
XOPTIONS_SINGLE=	API_ABI_EMULATION
XOPTIONS_SINGLE_API_ABI_EMULATION=	JPEG6B JPEG7 JPEG8
X
XOPTIONS_DEFAULT=	DECODING ENCODING GCC JPEG6B SHARED SIMD STATIC TURBOJPEG
X
XOPTIONS_SUB=	yes
X
XGCC_DESC=	Use the GNU Compiler Collection (GCC) for best performance
XSIMD_DESC=	Include SIMD extensions (MMX, SSE2, NEON)
XTURBOJPEG_DESC=	Include the TurboJPEG wrapper library and associated tests
X
XENCODING_DESC=	Enable arithmetic encoding
XDECODING_DESC=	Enable arithmetic decoding
X
XSTATIC_DESC=	Build static libraries
XSHARED_DESC=	Build shared libraries
X
XJPEG6B_DESC=	API/ABI-compatible with libjpeg v6b
XJPEG7_DESC=	API/ABI-compatible with libjpeg v7 (implies arith-coding)
XJPEG8_DESC=	API/ABI-compatible with libjpeg v8 (implies arith-coding)
X
XGCC_USE=	GCC=any
XSIMD_CONFIGURE_WITH=	simd
XTURBOJPEG_CONFIGURE_WITH=	turbojpeg
X
XJPEG7_CONFIGURE_WITH=	jpeg7
XJPEG8_CONFIGURE_WITH=	jpeg8
X
XSTATIC_CONFIGURE_ENABLE=	static
XSHARED_CONFIGURE_ENABLE=	shared
X
X.include <bsd.port.options.mk>
X
X.if ${PORT_OPTIONS:MJPEG6B}
X. if ! ${PORT_OPTIONS:MENCODING}
XCONFIGURE_ARGS+=	--without-arith-enc
X. endif
X. if ! ${PORT_OPTIONS:MDECODING}
XCONFIGURE_ARGS+=	--without-arith-dec
X. endif
XSOMAJORVERSION=	63
X.else
XSOMAJORVERSION=	8
X.endif
X
Xpost-patch:
X	@${REINPLACE_CMD} -e "s|docdir = \$$(datadir)/doc|&/mozjpeg|; \
X		s|exampledir = \$$(datadir)/doc|exampledir = ${EXAMPLESDIR}|" \
X 			${WRKSRC}/Makefile.am
X
Xrun-autotools:	run-autotools-autoreconf
X
Xrun-autotools-autoreconf:
X	cd ${CONFIGURE_WRKSRC} && ${SETENV} ${AUTOTOOLS_ENV} ${AUTORECONF} -fiv
X
Xpost-install:
X	@${MKDIR} ${STAGEDIR}${DOCSDIR2}
X	${INSTALL_DATA} ${DOC_FILES:S|^|${DOCSRCDIR1}/|} ${STAGEDIR}${DOCSDIR1}
X	${INSTALL_DATA} ${DOC_FILES:S|^|${DOCSRCDIR2}/|} ${STAGEDIR}${DOCSDIR2}
X
X.if ${PORT_OPTIONS:MSHARED}
X	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/libjpeg.so.${SOMAJORVERSION}
X.endif
X
X.if ${PORT_OPTIONS:MSHARED} && ${PORT_OPTIONS:MTURBOJPEG}
X	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/libturbojpeg.so.1
X.endif
X
X.include <bsd.port.mk>
dd80bda4542c2e97066bcdb9a4c1d4eb
echo x - mozjpeg/pkg-descr
sed 's/^X//' >mozjpeg/pkg-descr << 'a886b36ace510903ff7124d1f24ec150'
XMozJPEG is a fork of libjpeg-turbo with 'jpgcrush' functionality built in.
X
XThe goal is to provide a production-quality JPEG encoder that improves
Xcompression while maintaining compatibility with the vast majority of deployed
Xdecoders.
X
XThe 'jpgcrush' feature finds the progressive coding configuration which uses the
Xfewest bits. This most frequently reduces file size by 2-10%, but those are not
Xhard limits. Significantly greater reductions have been observed.
X
XLibrary configuration defaults are the same as for libjpeg-turbo, in order to
Xmake transitions as painless as possible. There are new configuration options
Xfor new features, but they are not enabled by default.
X
XThe 'cjpeg' program defaults are not the same as for the equivalent program in
Xlibjpeg-turbo. The 'cjpeg' defaults for mozjpeg are set to aggressively optimize
Xfor smaller file sizes.
X
XWWW: https://github.com/mozilla/mozjpeg/
a886b36ace510903ff7124d1f24ec150
echo x - mozjpeg/distinfo
sed 's/^X//' >mozjpeg/distinfo << 'fa9d7ca34cdca9ab084ee34cefb154fb'
XSHA256 (mozjpeg-1.0.tar.gz) = 6c4845d7fa0bddd77e4a209e8e81bde11af8524dcd2cb0bb10bfd9519548ec95
XSIZE (mozjpeg-1.0.tar.gz) = 1032706
fa9d7ca34cdca9ab084ee34cefb154fb
echo x - mozjpeg/pkg-plist
sed 's/^X//' >mozjpeg/pkg-plist << 'b133a85dca9df5b8f94db7eee5d922b8'
Xbin/cjpeg
Xbin/djpeg
Xbin/jpegtran
Xbin/rdjpgcom
X%%TURBOJPEG%%bin/tjbench
Xbin/wrjpgcom
Xinclude/%%PORTNAME%%/jconfig.h
Xinclude/%%PORTNAME%%/jerror.h
Xinclude/%%PORTNAME%%/jmorecfg.h
Xinclude/%%PORTNAME%%/jpeglib.h
X%%TURBOJPEG%%include/%%PORTNAME%%/turbojpeg.h
X%%STATIC%%lib/%%PORTNAME%%/libjpeg.a
Xlib/%%PORTNAME%%/libjpeg.la
X%%SHARED%%lib/%%PORTNAME%%/libjpeg.so
X%%SHARED%%lib/%%PORTNAME%%/libjpeg.so.%%SOMAJORVERSION%%
X%%STATIC%%%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.a
X%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.la
X%%SHARED%%%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.so
X%%SHARED%%%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.so.1
Xman/man1/cjpeg.1.gz
Xman/man1/djpeg.1.gz
Xman/man1/jpegtran.1.gz
Xman/man1/rdjpgcom.1.gz
Xman/man1/wrjpgcom.1.gz
X@dirrm lib/%%PORTNAME%%
X@dirrm include/%%PORTNAME%%
b133a85dca9df5b8f94db7eee5d922b8
exit



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403091852.s29Iq0rC066021>