git: daa103d82653 - main - graphics/libmng: upgrade from 1.0.10 to 2.0.3
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 12 Jan 2024 21:53:28 UTC
The branch main has been updated by mi: URL: https://cgit.FreeBSD.org/ports/commit/?id=daa103d82653fc8d825f921f25d423181764c31b commit daa103d82653fc8d825f921f25d423181764c31b Author: Mikhail Teterin <mi@FreeBSD.org> AuthorDate: 2024-01-12 21:50:37 +0000 Commit: Mikhail Teterin <mi@FreeBSD.org> CommitDate: 2024-01-12 21:53:24 +0000 graphics/libmng: upgrade from 1.0.10 to 2.0.3 Despite the seemingly large version jump, the sole change is the compatibility with lcms-2.x. I'm now also adding fixes for some compiler-warnings raised by the modern clang. These suggest, certain parts of the code aren't even really excercised. Neither API nor ABI are changing, so no shared library version-bump. --- graphics/libmng/Makefile | 15 ++-- graphics/libmng/distinfo | 5 +- graphics/libmng/files/Makefile.bsd | 4 +- graphics/libmng/files/patch-chunk_descr.c | 9 +++ graphics/libmng/files/patch-conf | 19 ----- graphics/libmng/files/patch-filter.c | 13 +++ graphics/libmng/files/patch-pixels.c | 128 ++++++++++++++++++++++++++++++ graphics/libmng/pkg-descr | 3 - 8 files changed, 160 insertions(+), 36 deletions(-) diff --git a/graphics/libmng/Makefile b/graphics/libmng/Makefile index e31753cd5708..8f8d7634fa39 100644 --- a/graphics/libmng/Makefile +++ b/graphics/libmng/Makefile @@ -1,26 +1,21 @@ PORTNAME= libmng -PORTVERSION= 1.0.10 -PORTREVISION= 5 +PORTVERSION= 2.0.3 CATEGORIES= graphics MASTER_SITES= SF/${PORTNAME}/${PORTNAME}-devel/${PORTVERSION} \ http://www.libmng.com/download/ MAINTAINER= mi@aldan.algebra.com COMMENT= Multiple-image Network Graphics (MNG) reference library -WWW= https://www.libmng.com/ +WWW= https://sourceforge.net/projects/libmng/ -LIB_DEPENDS= liblcms.so:graphics/lcms - -OPTIONS_DEFINE= MNG_OPTIMIZE -MNG_OPTIMIZE_DESC= Use vendor's new optimization flags +LIB_DEPENDS= liblcms2.so:graphics/lcms2 MAKEFILE= ${FILESDIR}/Makefile.bsd -USES= jpeg uidfix +USES= jpeg uidfix tar:xz USE_LDCONFIG= yes -MNG_OPTIMIZE_MAKE_ARGS= WITH_MNG_OPTIMIZE=true -MNG_OPTIMIZE_MAKE_ARGS_OFF= WITH_MNG_OPTIMIZE=off +MAKE_ARGS+= WITH_MNG_OPTIMIZE=true post-install: cd ${WRKSRC}/doc/man && ${INSTALL_MAN} libmng.3 ${STAGEDIR}${PREFIX}/man/man3 \ diff --git a/graphics/libmng/distinfo b/graphics/libmng/distinfo index 7a8befb1f5db..5aad546e300b 100644 --- a/graphics/libmng/distinfo +++ b/graphics/libmng/distinfo @@ -1,2 +1,3 @@ -SHA256 (libmng-1.0.10.tar.gz) = 03a79dac9b9316d37227057614a248a946f997c4d1a3437fb569e9a63897f911 -SIZE (libmng-1.0.10.tar.gz) = 1093337 +TIMESTAMP = 1704254831 +SHA256 (libmng-2.0.3.tar.xz) = 4a462fdd48d4bc82c1d7a21106c8a18b62f8cc0042454323058e6da0dbb57dd3 +SIZE (libmng-2.0.3.tar.xz) = 951808 diff --git a/graphics/libmng/files/Makefile.bsd b/graphics/libmng/files/Makefile.bsd index 865b974c0bd2..1988d43ea452 100644 --- a/graphics/libmng/files/Makefile.bsd +++ b/graphics/libmng/files/Makefile.bsd @@ -1,5 +1,5 @@ LIB= mng -LDADD= -lm -L${LIBDIR} -lz -llcms -ljpeg +LDADD= -lm -L${LIBDIR} -lz -llcms2 -ljpeg MK_PROFILE= no SHLIB_MAJOR?= 1 @@ -8,7 +8,7 @@ SHLIB_MINOR?= 0 SRCS!= ${MAKE} -f ${.CURDIR}/makefiles/makefile.unix -V SOURCES CFLAGS+= -I${INCDIR} -.if ${WITH_MNG_OPTIMIZE} == "true" +.if ${WITH_MNG_OPTIMIZE} == "truex" .for f in CHUNKINITFREE OBJCLEANUP CHUNKASSIGN CHUNKREADER CFLAGS+= -DMNG_OPTIMIZE_$f .endfor diff --git a/graphics/libmng/files/patch-chunk_descr.c b/graphics/libmng/files/patch-chunk_descr.c new file mode 100644 index 000000000000..c4d6f9871f82 --- /dev/null +++ b/graphics/libmng/files/patch-chunk_descr.c @@ -0,0 +1,9 @@ +--- libmng_chunk_descr.c 2012-07-29 15:26:34.000000000 -0400 ++++ libmng_chunk_descr.c 2024-01-08 14:32:15.916979000 -0500 +@@ -2751,5 +2751,5 @@ + mng_get_chunkheader (MNG_UINT_sRGB, &chunk_srgb); + /* pretend it's an sRGB chunk then ! */ +- iRetcode = mng_read_general (pData, &chunk_srgb, 1, (mng_ptr)"0", &pDummy); ++ iRetcode = mng_read_general (pData, &chunk_srgb, 1, (mng_ptr)"0", (void **)&pDummy); + if (iRetcode) /* on error bail out */ + return iRetcode; diff --git a/graphics/libmng/files/patch-conf b/graphics/libmng/files/patch-conf deleted file mode 100644 index 2413a8b8bbfd..000000000000 --- a/graphics/libmng/files/patch-conf +++ /dev/null @@ -1,19 +0,0 @@ -+++ libmng_conf.h Tue Oct 18 00:23:11 2005 -@@ -100,4 +100,8 @@ - #endif - -+#ifdef PIC -+# define MNG_BUILD_SO -+#endif -+ - #ifndef MNG_SUPPORT_IJG6B - #if defined(MNG_BUILD_SO) || defined(MNG_USE_SO) || defined(MNG_BUILD_DLL) || defined(MNG_USE_DLL) -@@ -161,6 +165,6 @@ - select MNG_APP_CMS */ - --#define MNG_GAMMA_ONLY --/* #define MNG_FULL_CMS */ -+/* #define MNG_GAMMA_ONLY */ -+#define MNG_FULL_CMS - /* #define MNG_APP_CMS */ - diff --git a/graphics/libmng/files/patch-filter.c b/graphics/libmng/files/patch-filter.c new file mode 100644 index 000000000000..75eaf815b53b --- /dev/null +++ b/graphics/libmng/files/patch-filter.c @@ -0,0 +1,13 @@ +--- libmng_filter.c 2012-07-29 15:26:34.000000000 -0400 ++++ libmng_filter.c 2024-01-08 14:25:01.379756000 -0500 +@@ -207,7 +207,7 @@ + iC = (mng_uint32)*pPriorx_prev; + iP = iA + iB - iC; +- iPa = abs (iP - iA); +- iPb = abs (iP - iB); +- iPc = abs (iP - iC); ++ iPa = iP > iA ? iP - iA : iA - iP; ++ iPb = iP > iB ? iP - iB : iB - iP; ++ iPc = iP > iC ? iP - iC : iC - iP; + + if ((iPa <= iPb) && (iPa <= iPc)) diff --git a/graphics/libmng/files/patch-pixels.c b/graphics/libmng/files/patch-pixels.c new file mode 100644 index 000000000000..a74b3653ba22 --- /dev/null +++ b/graphics/libmng/files/patch-pixels.c @@ -0,0 +1,128 @@ +This changes the behaviour to what appears to be the original intent... + + -mi + +--- libmng_pixels.c 2012-07-29 15:26:34.000000000 -0400 ++++ libmng_pixels.c 2024-01-08 14:21:18.664893000 -0500 +@@ -14669,5 +14669,5 @@ + + *pDstline = (mng_uint8)(iW >> 8); +- *(pDstline+1) = (mng_uint8)(iW && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iW & 0xFF); + + pSrcline++; +@@ -14787,5 +14787,5 @@ + + *pDstline = (mng_uint8)(iW >> 8); +- *(pDstline+1) = (mng_uint8)(iW && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iW & 0xFF); + + pSrcline++; +@@ -14908,5 +14908,5 @@ + *(pDstline+2) = iB; + *(pDstline+4) = iB; +- iB = (mng_uint8)(iW && 0xFF); ++ iB = (mng_uint8)(iW & 0xFF); + *(pDstline+1) = iB; + *(pDstline+3) = iB; +@@ -15042,5 +15042,5 @@ + *(pDstline+2) = iB; + *(pDstline+4) = iB; +- iB = (mng_uint8)(iW && 0xFF); ++ iB = (mng_uint8)(iW & 0xFF); + *(pDstline+1) = iB; + *(pDstline+3) = iB; +@@ -15126,7 +15126,7 @@ + + *pDstline = (mng_uint8)(iW >> 8); +- *(pDstline+1) = (mng_uint8)(iW && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iW & 0xFF); + *(pDstline+2) = (mng_uint8)(iA >> 8); +- *(pDstline+3) = (mng_uint8)(iA && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iA & 0xFF); + + pSrcline += 2; +@@ -15210,10 +15210,10 @@ + *(pDstline+2) = iB; + *(pDstline+4) = iB; +- iB = (mng_uint8)(iW && 0xFF); ++ iB = (mng_uint8)(iW & 0xFF); + *(pDstline+1) = iB; + *(pDstline+3) = iB; + *(pDstline+5) = iB; + *(pDstline+6) = (mng_uint8)(iA >> 8); +- *(pDstline+7) = (mng_uint8)(iA && 0xFF); ++ *(pDstline+7) = (mng_uint8)(iA & 0xFF); + + pSrcline += 2; +@@ -15297,9 +15297,9 @@ + + *pDstline = (mng_uint8)(iR >> 8); +- *(pDstline+1) = (mng_uint8)(iR && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iR & 0xFF); + *(pDstline+2) = (mng_uint8)(iG >> 8); +- *(pDstline+3) = (mng_uint8)(iG && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iG & 0xFF); + *(pDstline+4) = (mng_uint8)(iB >> 8); +- *(pDstline+5) = (mng_uint8)(iB && 0xFF); ++ *(pDstline+5) = (mng_uint8)(iB & 0xFF); + + pSrcline += 3; +@@ -15402,9 +15402,9 @@ + + *pDstline = (mng_uint8)(iRw >> 8); +- *(pDstline+1) = (mng_uint8)(iRw && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iRw & 0xFF); + *(pDstline+2) = (mng_uint8)(iGw >> 8); +- *(pDstline+3) = (mng_uint8)(iGw && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iGw & 0xFF); + *(pDstline+4) = (mng_uint8)(iBw >> 8); +- *(pDstline+5) = (mng_uint8)(iBw && 0xFF); ++ *(pDstline+5) = (mng_uint8)(iBw & 0xFF); + + pSrcline += 3; +@@ -15539,9 +15539,9 @@ + iB = ((mng_bitdepth_16)pData->fPromBitdepth) (pBuf->aPLTEentries [iN].iBlue); + *pDstline = (mng_uint8)(iR >> 8); +- *(pDstline+1) = (mng_uint8)(iR && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iR & 0xFF); + *(pDstline+2) = (mng_uint8)(iG >> 8); +- *(pDstline+3) = (mng_uint8)(iG && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iG & 0xFF); + *(pDstline+4) = (mng_uint8)(iB >> 8); +- *(pDstline+5) = (mng_uint8)(iB && 0xFF); ++ *(pDstline+5) = (mng_uint8)(iB & 0xFF); + } + +@@ -15642,11 +15642,11 @@ + + *pDstline = (mng_uint8)(iR >> 8); +- *(pDstline+1) = (mng_uint8)(iR && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iR & 0xFF); + *(pDstline+2) = (mng_uint8)(iG >> 8); +- *(pDstline+3) = (mng_uint8)(iG && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iG & 0xFF); + *(pDstline+4) = (mng_uint8)(iB >> 8); +- *(pDstline+5) = (mng_uint8)(iB && 0xFF); ++ *(pDstline+5) = (mng_uint8)(iB & 0xFF); + *(pDstline+6) = (mng_uint8)(iA >> 8); +- *(pDstline+7) = (mng_uint8)(iA && 0xFF); ++ *(pDstline+7) = (mng_uint8)(iA & 0xFF); + } + +@@ -15690,11 +15690,11 @@ + + *pDstline = (mng_uint8)(iR >> 8); +- *(pDstline+1) = (mng_uint8)(iR && 0xFF); ++ *(pDstline+1) = (mng_uint8)(iR & 0xFF); + *(pDstline+2) = (mng_uint8)(iG >> 8); +- *(pDstline+3) = (mng_uint8)(iG && 0xFF); ++ *(pDstline+3) = (mng_uint8)(iG & 0xFF); + *(pDstline+4) = (mng_uint8)(iB >> 8); +- *(pDstline+5) = (mng_uint8)(iB && 0xFF); ++ *(pDstline+5) = (mng_uint8)(iB & 0xFF); + *(pDstline+6) = (mng_uint8)(iA >> 8); +- *(pDstline+7) = (mng_uint8)(iA && 0xFF); ++ *(pDstline+7) = (mng_uint8)(iA & 0xFF); + + pSrcline += 4; diff --git a/graphics/libmng/pkg-descr b/graphics/libmng/pkg-descr index dc6233b9e8e6..db6068d870c6 100644 --- a/graphics/libmng/pkg-descr +++ b/graphics/libmng/pkg-descr @@ -3,6 +3,3 @@ manipulations of Multiple-image Network Graphics (MNG) format image files. It uses the zlib(3) compression library, and optionally the JPEG library by the Independant JPEG Group (IJG) and/or lcms (little CMS), a color-management library by Marti Maria Saguar. - -Mikhail Teterin -mi@aldan.algebra.com