pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/graphics/jxrlib Fix libjxr on big endian systems and f...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a52f93781701
branches:  trunk
changeset: 405269:a52f93781701
user:      nros <nros%pkgsrc.org@localhost>
date:      Mon Nov 25 21:07:18 2019 +0000

description:
Fix libjxr on big endian systems and fix warnings

Add patches from FreeBSD ports that fix build warnings.
For the patches to apply correctly, add conversion to unix style linebreaks.
Define _BIG__ENDIAN_ on big endian systems to make the package behave
correctly when running on them. As pointed out in jxrlibs makefile.
Bump pkgrevision and abi depends due to the big endian change.

diffstat:

 graphics/jxrlib/Makefile                                    |  15 +++-
 graphics/jxrlib/buildlink3.mk                               |   3 +-
 graphics/jxrlib/distinfo                                    |  13 +++-
 graphics/jxrlib/patches/patch-Makefile                      |  13 +++
 graphics/jxrlib/patches/patch-image_sys_strcodec.c          |  15 +++
 graphics/jxrlib/patches/patch-image_sys_strcodec.h          |  30 +++++++
 graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrDecApp.c |  13 +++
 graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrEncApp.c |  13 +++
 graphics/jxrlib/patches/patch-jxrgluelib_JXRGlueJxr.c       |  12 +++
 graphics/jxrlib/patches/patch-jxrgluelib_JXRMeta.h          |  13 +++
 graphics/jxrlib/patches/patch-jxrtestlib_JXRTest.c          |  49 +++++++++++++
 graphics/jxrlib/patches/patch-jxrtestlib_JXRTestHdr.c       |  13 +++
 graphics/jxrlib/patches/patch-jxrtestlib_JXRTestPnm.c       |  13 +++
 graphics/jxrlib/patches/patch-jxrtestlib_JXRTestTif.c       |  15 +++
 14 files changed, 227 insertions(+), 3 deletions(-)

diffs (truncated from 323 to 300 lines):

diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/Makefile
--- a/graphics/jxrlib/Makefile  Mon Nov 25 18:28:09 2019 +0000
+++ b/graphics/jxrlib/Makefile  Mon Nov 25 21:07:18 2019 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.2 2017/09/03 09:22:57 wiz Exp $
+# $NetBSD: Makefile,v 1.3 2019/11/25 21:07:18 nros Exp $
 
 DISTNAME=      jxrlib_1_1
 PKGNAME=       jxrlib-1.1
+PKGREVISION=   1
 CATEGORIES=    graphics
 MASTER_SITES=  # javascript link
 
@@ -10,8 +11,15 @@
 COMMENT=       JPEG XR library
 LICENSE=       2-clause-bsd
 
+TOOL_DEPENDS+= dos2unix-[0-9]*:../../converters/dos2unix
+
 WRKSRC=                ${WRKDIR}/jxrlib
 
+.include "../../mk/endian.mk"
+.if ${MACHINE_ENDIAN} == "big"
+CFLAGS+=-D_BIG__ENDIAN_
+.endif
+
 INSTALLATION_DIRS=     bin lib
 INSTALLATION_DIRS+=    include/jxrlib/common/include
 INSTALLATION_DIRS+=    include/jxrlib/image/sys
@@ -21,6 +29,11 @@
 INSTALLATION_DIRS+=    include/jxrgluelib
 INSTALLATION_DIRS+=    share/doc/jxrlib
 
+pre-patch:
+       dos2unix ${WRKSRC}/Makefile
+       find ${WRKSRC} -name '*.c' -print0 | xargs -0 dos2unix
+       find ${WRKSRC} -name '*.h' -print0 | xargs -0 dos2unix
+
 do-install:
        ${INSTALL_PROGRAM} ${WRKSRC}/JxrEncApp ${DESTDIR}${PREFIX}/bin
        ${INSTALL_PROGRAM} ${WRKSRC}/JxrDecApp ${DESTDIR}${PREFIX}/bin
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/buildlink3.mk
--- a/graphics/jxrlib/buildlink3.mk     Mon Nov 25 18:28:09 2019 +0000
+++ b/graphics/jxrlib/buildlink3.mk     Mon Nov 25 21:07:18 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.1 2017/04/04 13:07:07 wiz Exp $
+# $NetBSD: buildlink3.mk,v 1.2 2019/11/25 21:07:18 nros Exp $
 
 BUILDLINK_TREE+=       jxrlib
 
@@ -6,6 +6,7 @@
 JXRLIB_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.jxrlib+= jxrlib>=1.1
+BUILDLINK_ABI_DEPENDS.jxrlib+= jxrlib>=1.1nb1
 BUILDLINK_PKGSRCDIR.jxrlib?=   ../../graphics/jxrlib
 BUILDLINK_DEPMETHOD.jxrlib?=   build
 .endif # JXRLIB_BUILDLINK3_MK
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/distinfo
--- a/graphics/jxrlib/distinfo  Mon Nov 25 18:28:09 2019 +0000
+++ b/graphics/jxrlib/distinfo  Mon Nov 25 21:07:18 2019 +0000
@@ -1,6 +1,17 @@
-$NetBSD: distinfo,v 1.1 2017/04/04 13:07:07 wiz Exp $
+$NetBSD: distinfo,v 1.2 2019/11/25 21:07:18 nros Exp $
 
 SHA1 (jxrlib_1_1.tar.gz) = bf6cfa00087a67491a6ba55d6d96d74e94560430
 RMD160 (jxrlib_1_1.tar.gz) = 31b378cd0de3ce2c1d19fae3927c67046471d07b
 SHA512 (jxrlib_1_1.tar.gz) = c7d87647601e08b2dc18bda26faea80ad5b09c6e8412769cd203ce9e221b2b58425e9d59a506ae8bf61030195bccb51a9d1e893bf2d18e596b0687918b39e2df
 Size (jxrlib_1_1.tar.gz) = 338240 bytes
+SHA1 (patch-Makefile) = 581bdfdfee20fd1f6d0a2a3d1cf8ce877eb0629b
+SHA1 (patch-image_sys_strcodec.c) = 3cf7e93704c5849dcbb3ff435743f87fe8ebf042
+SHA1 (patch-image_sys_strcodec.h) = ef060597735fbc9529bd25cb3431eafaf3284ddc
+SHA1 (patch-jxrencoderdecoder_JxrDecApp.c) = ae71490d95c3f15cd65115872d2463468cda3a97
+SHA1 (patch-jxrencoderdecoder_JxrEncApp.c) = ff66c068348260291d51d21f8caf6059a63fac65
+SHA1 (patch-jxrgluelib_JXRGlueJxr.c) = adce3e44d470c62817ef83a3b0723818d8ecb810
+SHA1 (patch-jxrgluelib_JXRMeta.h) = b14f26ab80b1050879eac404283a11a795326444
+SHA1 (patch-jxrtestlib_JXRTest.c) = 2dcb7f4f953c129db1e7db4741439f1c5eb19e27
+SHA1 (patch-jxrtestlib_JXRTestHdr.c) = 8f5562dfe3d0dd1ddfb6b591facd51c45cd3d068
+SHA1 (patch-jxrtestlib_JXRTestPnm.c) = ea94a288d76d9e9c316716f07226640570136460
+SHA1 (patch-jxrtestlib_JXRTestTif.c) = f4c36e487a808e80ff75cd99fd693c555902d758
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-Makefile    Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-Makefile,v 1.1 2019/11/25 21:07:19 nros Exp $
+* take in CFLAGS from the environment so that _BIG__ENDIAN_ can be added
+--- Makefile.orig      2019-11-25 19:14:40.081612047 +0000
++++ Makefile
+@@ -39,7 +39,7 @@ DIR_GLUE=jxrgluelib
+ DIR_TEST=jxrtestlib
+ DIR_EXEC=jxrencoderdecoder
+ 
+-CFLAGS=-I. -Icommon/include -I$(DIR_SYS) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O
++CFLAGS+=-I. -Icommon/include -I$(DIR_SYS) -D__ANSI__ -DDISABLE_PERF_MEASUREMENT -w -O
+ ##
+ ## Add following flag to CFLAGS above if target is a big endian machine
+ ## -D_BIG__ENDIAN_
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-image_sys_strcodec.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-image_sys_strcodec.c        Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,15 @@
+$NetBSD: patch-image_sys_strcodec.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* defines in .h file, fromm FreeBSD ports  
+--- image/sys/strcodec.c.orig  2013-03-20 18:16:21.000000000 +0000
++++ image/sys/strcodec.c
+@@ -668,9 +668,7 @@ ERR detach_SB(SimpleBitIO* pSB)
+ // WinCE ARM and Desktop x86
+ #else
+ // other platform
+-#ifdef _BIG__ENDIAN_
+-#define _byteswap_ulong(x)  (x)
+-#else // _BIG__ENDIAN_
++#ifndef _BIG__ENDIAN_
+ U32 _byteswap_ulong(U32 bits)
+ {
+     U32 r = (bits & 0xffu) << 24;
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-image_sys_strcodec.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-image_sys_strcodec.h        Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,30 @@
+$NetBSD: patch-image_sys_strcodec.h,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix warning
+* define and declaration of byteswap in .h file
+* from FreeBSD ports
+--- image/sys/strcodec.h.orig  2013-03-21 18:22:34.000000000 +0000
++++ image/sys/strcodec.h
+@@ -64,7 +64,7 @@
+ 
+ #ifndef UNREFERENCED_PARAMETER
+ #define UNREFERENCED_PARAMETER(P) { (P) = (P); }
+-#endif UNREFERENCED_PARAMETER
++#endif
+ 
+ #ifdef UNDER_CE
+ #define PLATFORM_WCE
+@@ -676,3 +676,14 @@ void flushToByte(BitIOInfo* pIO);
+ //    pIO->uiAccumulator = LOAD16(pIO->pbCurrent) & ((U32)(-1) >> pIO->cBitsUsed);\
+ 
+ void OutputPerfTimerReport(CWMImageStrCodec *pState);
++
++#if (defined(WIN32) && !defined(UNDER_CE)) || (defined(UNDER_CE) && defined(_ARM_))
++// WinCE ARM and Desktop x86
++#else
++// other platform
++#ifdef _BIG__ENDIAN_
++#define _byteswap_ulong(x)  (x)
++#else // _BIG__ENDIAN_
++U32 _byteswap_ulong(U32 bits);
++#endif // _BIG__ENDIAN_
++#endif
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrDecApp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrDecApp.c       Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-jxrencoderdecoder_JxrDecApp.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix warnings, from FreeBSD ports  
+--- jxrencoderdecoder/JxrDecApp.c.orig 2019-11-25 19:14:26.881820454 +0000
++++ jxrencoderdecoder/JxrDecApp.c
+@@ -423,7 +423,7 @@ ERR WmpDecAppCreateEncoderFromExt(
+     Call(GetTestEncodeIID(szExt, &pIID));
+ 
+     // Create encoder
+-    Call(PKTestFactory_CreateCodec(pIID, ppIE));
++    Call(PKTestFactory_CreateCodec(pIID, (void**)ppIE));
+ 
+ Cleanup:
+     return err;
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrEncApp.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrencoderdecoder_JxrEncApp.c       Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-jxrencoderdecoder_JxrEncApp.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* Fix warnings, from FreeBSD ports
+--- jxrencoderdecoder/JxrEncApp.c.orig 2019-11-16 13:13:44.454384643 +0000
++++ 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));
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrgluelib_JXRGlueJxr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrgluelib_JXRGlueJxr.c     Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,12 @@
+$NetBSD: patch-jxrgluelib_JXRGlueJxr.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix missing declaration of wcslen
+--- jxrgluelib/JXRGlueJxr.c.orig       2013-03-20 19:01:13.000000000 +0000
++++ jxrgluelib/JXRGlueJxr.c
+@@ -27,6 +27,7 @@
+ //
+ //*@@@---@@@@******************************************************************
+ #include <limits.h>
++#include <wchar.h>
+ #include <JXRGlue.h>
+ 
+ 
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrgluelib_JXRMeta.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrgluelib_JXRMeta.h        Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-jxrgluelib_JXRMeta.h,v 1.1 2019/11/25 21:07:19 nros Exp $
+* Fix warning
+--- jxrgluelib/JXRMeta.h.orig  2019-11-16 11:24:33.138807563 +0000
++++ jxrgluelib/JXRMeta.h
+@@ -34,7 +34,7 @@
+ 
+ #ifndef UNREFERENCED_PARAMETER
+ #define UNREFERENCED_PARAMETER(P) { (P) = (P); }
+-#endif UNREFERENCED_PARAMETER
++#endif
+ 
+ //================================================================
+ // Container
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrtestlib_JXRTest.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrtestlib_JXRTest.c        Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,49 @@
+$NetBSD: patch-jxrtestlib_JXRTest.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix warnings, from FreeBSD ports
+--- jxrtestlib/JXRTest.c.orig  2013-03-19 19:06:18.000000000 +0000
++++ jxrtestlib/JXRTest.c
+@@ -198,7 +198,7 @@ ERR PKTestFactory_CreateDecoderFromFile(
+     ERR err = WMP_errSuccess;
+ 
+     char *pExt = NULL;
+-    PKIID* pIID = NULL;
++    const PKIID* pIID = NULL;
+ 
+     struct WMPStream* pStream = NULL;
+     PKImageDecode* pDecoder = NULL;
+@@ -214,7 +214,7 @@ ERR PKTestFactory_CreateDecoderFromFile(
+     Call(CreateWS_File(&pStream, szFilename, "rb"));
+ 
+     // Create decoder
+-    Call(PKTestFactory_CreateCodec(pIID, ppDecoder));
++    Call(PKTestFactory_CreateCodec(pIID,(void**)ppDecoder));
+     pDecoder = *ppDecoder;
+ 
+     // attach stream to decoder
+@@ -232,7 +232,7 @@ ERR PKCreateTestFactory(PKCodecFactory**
+ 
+     UNREFERENCED_PARAMETER( uVersion );
+ 
+-    Call(PKAlloc(ppCFactory, sizeof(**ppCFactory)));
++    Call(PKAlloc((void**)ppCFactory, sizeof(**ppCFactory)));
+     pCFactory = *ppCFactory;
+ 
+     pCFactory->CreateCodec = PKTestFactory_CreateCodec;
+@@ -287,7 +287,7 @@ ERR PKTestDecode_Release(
+ 
+     pID->fStreamOwner && pID->pStream->Close(&pID->pStream);
+ 
+-    return PKFree(ppID);
++    return PKFree((void**)ppID);
+ }
+ 
+ ERR PKTestDecode_Create(
+@@ -296,7 +296,7 @@ ERR PKTestDecode_Create(
+     ERR err = WMP_errSuccess;
+     PKTestDecode* pID = NULL;
+ 
+-    Call(PKAlloc(ppID, sizeof(**ppID)));
++    Call(PKAlloc((void**)ppID, sizeof(**ppID)));
+ 
+     pID = *ppID;
+     pID->Initialize = PKTestDecode_Initialize;
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrtestlib_JXRTestHdr.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrtestlib_JXRTestHdr.c     Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-jxrtestlib_JXRTestHdr.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix warning
+--- jxrtestlib/JXRTestHdr.c.orig       2013-03-20 16:40:08.000000000 +0000
++++ jxrtestlib/JXRTestHdr.c
+@@ -27,7 +27,7 @@
+ //*@@@---@@@@******************************************************************
+ #ifndef ANSI
+ #define _CRT_SECURE_NO_WARNINGS
+-#endif ANSI
++#endif
+ 
+ #include <stdlib.h>
+ #include <string.h>
diff -r 0f5299138be0 -r a52f93781701 graphics/jxrlib/patches/patch-jxrtestlib_JXRTestPnm.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/graphics/jxrlib/patches/patch-jxrtestlib_JXRTestPnm.c     Mon Nov 25 21:07:18 2019 +0000
@@ -0,0 +1,13 @@
+$NetBSD: patch-jxrtestlib_JXRTestPnm.c,v 1.1 2019/11/25 21:07:19 nros Exp $
+* fix warning
+--- jxrtestlib/JXRTestPnm.c.orig       2019-11-16 13:10:49.180538241 +0000
++++ jxrtestlib/JXRTestPnm.c
+@@ -27,7 +27,7 @@
+ //*@@@---@@@@******************************************************************
+ #ifndef ANSI
+ #define _CRT_SECURE_NO_WARNINGS
+-#endif ANSI



Home | Main Index | Thread Index | Old Index