Update to 3.2

- Build and install static libraries
- Update BROKEN: use lowercase for leading character
- Remove PLIST_SUB
- Convert to options target helper
- Cosmetic change
- Update pkg-descr
- Update WWW
- Take maintainership

Changes:	https://github.com/mozilla/mozjpeg/releases
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2017-05-07 21:26:23 +00:00
parent 9397d765c7
commit e1b82c4f16
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=440370
5 changed files with 56 additions and 99 deletions

View file

@ -2,57 +2,51 @@
# $FreeBSD$ # $FreeBSD$
PORTNAME= mozjpeg PORTNAME= mozjpeg
PORTVERSION= 3.1 PORTVERSION= 3.2
DISTVERSIONPREFIX= v DISTVERSIONPREFIX= v
PORTREVISION= 1
CATEGORIES= graphics CATEGORIES= graphics
MAINTAINER= ports@FreeBSD.org MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Advanced JPEG encoder for the Web COMMENT= Improved JPEG encoder by Mozilla
LICENSE= BSD3CLAUSE LICENSE= BSD3CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
USE_GITHUB= yes LIB_DEPENDS= libpng.so:graphics/png
GH_ACCOUNT= mozilla
USES= autoreconf libtool pkgconfig BROKEN_aarch64= does not configure: error: SIMD support cannot be enabled
USE_LDCONFIG= ${PREFIX}/lib/${PORTNAME} BROKEN_mips64= does not configure: error: SIMD support cannot be enabled
GNU_CONFIGURE= yes BROKEN_powerpc64= does not build: undefined reference to htole32
CONFIGURE_ARGS= --docdir=${PREFIX}/share/doc/${PORTNAME} \ BROKEN_sparc64= does not configure: error: SIMD support cannot be enabled
--includedir=${PREFIX}/include/${PORTNAME} \
--libdir=${PREFIX}/lib/${PORTNAME} \
--with-jpeg8 \
--disable-static
INSTALL_TARGET= install-strip
PLIST_SUB= PORTNAME=${PORTNAME}
PORTDOCS= *
PORTEXAMPLES= *
OPTIONS_DEFINE= DOCS EXAMPLES SIMD TURBOJPEG OPTIONS_DEFINE= DOCS EXAMPLES SIMD TURBOJPEG
OPTIONS_DEFAULT=SIMD TURBOJPEG OPTIONS_DEFAULT=SIMD TURBOJPEG
OPTIONS_SUB= yes OPTIONS_SUB= yes
SIMD_DESC= Include SIMD extensions SIMD_DESC= Include SIMD extensions
TURBOJPEG_DESC= Include the TurboJPEG wrapper library and associated tests TURBOJPEG_DESC= Include the TurboJPEG wrapper library and associated tests
SIMD_CONFIGURE_WITH= simd CONFIGURE_ARGS= --docdir=${DOCSDIR} \
SIMD_BUILD_DEPENDS= yasm:devel/yasm --includedir=${PREFIX}/include/${PORTNAME} \
--libdir=${PREFIX}/lib/${PORTNAME} \
--with-jpeg8
GNU_CONFIGURE= yes
INSTALL_TARGET= install-strip
USE_LDCONFIG= ${PREFIX}/lib/${PORTNAME}
USES= autoreconf libtool pkgconfig
PORTDOCS= *
PORTEXAMPLES= *
GH_ACCOUNT= mozilla
USE_GITHUB= yes
SIMD_BUILD_DEPENDS= yasm:devel/yasm
SIMD_CONFIGURE_WITH= simd
TURBOJPEG_CONFIGURE_WITH= turbojpeg TURBOJPEG_CONFIGURE_WITH= turbojpeg
BROKEN_aarch64= Does not configure: error: SIMD support cannot be enabled
BROKEN_mips64= Does not configure: error: SIMD support cannot be enabled
BROKEN_powerpc64= Does not build: undefined reference to htole32
BROKEN_sparc64= Does not configure: error: SIMD support cannot be enabled
post-patch: post-patch:
@${REINPLACE_CMD} -e '/^docdir/s|=.*|= ${DOCSDIR}|; \ @${REINPLACE_CMD} -e '/pkgconfig/d; /^exampledir = / s| =.*| = ${EXAMPLESDIR}|' ${WRKSRC}/Makefile.am
/^exampledir/s|=.*|= ${EXAMPLESDIR}|' \
${WRKSRC}/Makefile.am
post-install: post-install-DOCS-on:
(cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}) cd ${WRKSRC}/doc/ && ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR}/
.include <bsd.port.mk> .include <bsd.port.mk>

View file

@ -1,2 +1,3 @@
SHA256 (mozilla-mozjpeg-v3.1_GH0.tar.gz) = 11823198f3c677b1832fa2dcf702e458f70c959661c4bec9c8922b7c36e94739 TIMESTAMP = 1494045680
SIZE (mozilla-mozjpeg-v3.1_GH0.tar.gz) = 1180063 SHA256 (mozilla-mozjpeg-v3.2_GH0.tar.gz) = 21fa401adfb9052bc65563bc51ce8a1f18f4adc2dc68e5611f042bb3b24e48be
SIZE (mozilla-mozjpeg-v3.2_GH0.tar.gz) = 1243935

View file

@ -1,41 +0,0 @@
--- jcdctmgr.c.orig 2015-05-18 14:28:09 UTC
+++ jcdctmgr.c
@@ -6,7 +6,7 @@
* libjpeg-turbo Modifications:
* Copyright (C) 1999-2006, MIYASAKA Masaru.
* Copyright 2009 Pierre Ossman <ossman@cendio.se> for Cendio AB
- * Copyright (C) 2011, 2014 D. R. Commander
+ * Copyright (C) 2011, 2014-2015 D. R. Commander
* mozjpeg Modifications:
* Copyright (C) 2014, Mozilla Corporation.
* For conditions of distribution and use, see the accompanying README file.
@@ -185,6 +185,19 @@ compute_reciprocal (UINT16 divisor, DCTE
UDCTELEM c;
int b, r;
+ if (divisor == 1) {
+ /* divisor == 1 means unquantized, so these reciprocal/correction/shift
+ * values will cause the C quantization algorithm to act like the
+ * identity function. Since only the C quantization algorithm is used in
+ * these cases, the scale value is irrelevant.
+ */
+ dtbl[DCTSIZE2 * 0] = (DCTELEM) 1; /* reciprocal */
+ dtbl[DCTSIZE2 * 1] = (DCTELEM) 0; /* correction */
+ dtbl[DCTSIZE2 * 2] = (DCTELEM) 1; /* scale */
+ dtbl[DCTSIZE2 * 3] = (DCTELEM) (-sizeof(DCTELEM) * 8); /* shift */
+ return 0;
+ }
+
b = flss(divisor) - 1;
r = sizeof(DCTELEM) * 8 + b;
@@ -589,7 +602,8 @@ quantize (JCOEFPTR coef_block, DCTELEM *
#if BITS_IN_JSAMPLE == 8
- UDCTELEM recip, corr, shift;
+ UDCTELEM recip, corr;
+ int shift;
UDCTELEM2 product;
for (i = 0; i < DCTSIZE2; i++) {

View file

@ -1,15 +1,16 @@
MozJPEG is a fork of libjpeg-turbo with 'jpgcrush' functionality built in. Mozilla JPEG Encoder Project
This project's goal is to reduce the size of JPEG files without reducing quality MozJPEG reduces file sizes of JPEG images while retaining quality and
or compatibility with the vast majority of the world's deployed decoders. compatibility with the vast majority of the world's deployed decoders.
The idea is to reduce transfer times for JPEGs on the Web, thus reducing page MozJPEG is based on libjpeg-turbo. It's compatible with libjpeg API and ABI, and
load times. can be used as a drop-in replacement for libjpeg. MozJPEG makes tradeoffs that
are intended to benefit Web use cases and focuses solely on improving encoding,
so it's best used as part of a Web encoding workflow.
'mozjpeg' is not intended to be a general JPEG library replacement. It makes MozJPEG is meant to be used as a library in graphics programs and image
tradeoffs that are intended to benefit Web use cases and focuses solely on processing tools. We include a demo cjpeg tool, but it's not intended for
improving encoding. It is best used as part of a Web encoding workflow. For a serious use. We encourage authors of graphics programs to use MozJPEG's C API
general JPEG library (e.g. your system libjpeg), especially if you care about instead.
decoding, we recommend graphics/libjpeg-turbo port.
WWW: https://github.com/mozilla/mozjpeg/ WWW: https://github.com/mozilla/mozjpeg

View file

@ -4,17 +4,19 @@ bin/jpegtran
bin/rdjpgcom bin/rdjpgcom
%%TURBOJPEG%%bin/tjbench %%TURBOJPEG%%bin/tjbench
bin/wrjpgcom bin/wrjpgcom
include/%%PORTNAME%%/jconfig.h include/mozjpeg/jconfig.h
include/%%PORTNAME%%/jerror.h include/mozjpeg/jerror.h
include/%%PORTNAME%%/jmorecfg.h include/mozjpeg/jmorecfg.h
include/%%PORTNAME%%/jpeglib.h include/mozjpeg/jpeglib.h
%%TURBOJPEG%%include/%%PORTNAME%%/turbojpeg.h %%TURBOJPEG%%include/mozjpeg/turbojpeg.h
lib/%%PORTNAME%%/libjpeg.so lib/mozjpeg/libjpeg.a
lib/%%PORTNAME%%/libjpeg.so.8 lib/mozjpeg/libjpeg.so
lib/%%PORTNAME%%/libjpeg.so.8.1.2 lib/mozjpeg/libjpeg.so.8
%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.so lib/mozjpeg/libjpeg.so.8.1.2
%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.so.0 %%TURBOJPEG%%lib/mozjpeg/libturbojpeg.a
%%TURBOJPEG%%lib/%%PORTNAME%%/libturbojpeg.so.0.1.0 %%TURBOJPEG%%lib/mozjpeg/libturbojpeg.so
%%TURBOJPEG%%lib/mozjpeg/libturbojpeg.so.0
%%TURBOJPEG%%lib/mozjpeg/libturbojpeg.so.0.1.0
man/man1/cjpeg.1.gz man/man1/cjpeg.1.gz
man/man1/djpeg.1.gz man/man1/djpeg.1.gz
man/man1/jpegtran.1.gz man/man1/jpegtran.1.gz