git: 9b6337dcf5c6 - main - graphics/py-ming: Fix build with Clang 15 and remove the workaround
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 30 Jun 2023 07:20:28 UTC
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=9b6337dcf5c6d77c50cef7972d180cff06c2cac6 commit 9b6337dcf5c6d77c50cef7972d180cff06c2cac6 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2023-06-30 07:04:07 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2023-06-30 07:04:07 +0000 graphics/py-ming: Fix build with Clang 15 and remove the workaround - Update WWW ./ming_wrap.c:2427:18: error: incompatible integer to pointer conversion assigning to 'void *' from 'int' [-Wint-conversion] type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:2497:13: error: incompatible integer to pointer conversion initializing 'PyObject *' (aka 'struct _object *') with an expression of type 'int' [-Wint-conversion] PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:2525:11: error: incompatible integer to pointer conversion assigning to 'PyObject *' (aka 'struct _object *') from 'int' [-Wint-conversion] obj = PyCObject_FromVoidPtr(descriptor, NULL); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:3886:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:3908:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:4302:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:4352:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:4404:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:4411:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg2 = PyFile_AsFile(obj1); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:7255:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:7398:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ ./ming_wrap.c:8855:10: error: incompatible integer to pointer conversion assigning to 'FILE *' (aka 'struct __sFILE *') from 'int' [-Wint-conversion] arg1 = PyFile_AsFile(obj0); ^ ~~~~~~~~~~~~~~~~~~~ 23 warnings and 12 errors generated. --- graphics/py-ming/Makefile | 10 +--- graphics/py-ming/files/patch-clang15 | 109 +++++++++++++++++++++++++++++++++++ 2 files changed, 111 insertions(+), 8 deletions(-) diff --git a/graphics/py-ming/Makefile b/graphics/py-ming/Makefile index d5886de2e6e0..fd7a209a908a 100644 --- a/graphics/py-ming/Makefile +++ b/graphics/py-ming/Makefile @@ -6,7 +6,7 @@ PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= sunpoet@FreeBSD.org COMMENT= Python module for Ming which allows you to create Flash 4/5 movies -WWW= http://www.libming.org/ +WWW= https://github.com/libming/libming LICENSE= GPLv2 LGPL21 LICENSE_COMB= multi @@ -35,12 +35,6 @@ GH_PROJECT= libming PORTSCOUT= limit:^ming- -.include <bsd.port.pre.mk> - -.if ${OPSYS} == FreeBSD && ((${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000) || ${OSVERSION} >= 1400079) -CFLAGS+= -Wno-error=int-conversion -.endif - post-patch: @${REINPLACE_CMD} -e 's|/usr/local/|${LOCALBASE}/|g' ${WRKSRC}/py_ext/setup.py.in @${LN} -fs ${LOCALBASE}/include/ming ${WRKSRC}/src @@ -48,4 +42,4 @@ post-patch: post-install: ${FIND} ${STAGEDIR}${PYTHON_SITELIBDIR} -name '*.so' -exec ${STRIP_CMD} {} + -.include <bsd.port.post.mk> +.include <bsd.port.mk> diff --git a/graphics/py-ming/files/patch-clang15 b/graphics/py-ming/files/patch-clang15 new file mode 100644 index 000000000000..36af33d03ab3 --- /dev/null +++ b/graphics/py-ming/files/patch-clang15 @@ -0,0 +1,109 @@ +--- py_ext/ming_wrap.c.orig 2017-04-07 08:12:56 UTC ++++ py_ext/ming_wrap.c +@@ -2424,7 +2424,7 @@ SWIG_Python_GetModule(void) { + #ifdef SWIG_LINK_RUNTIME + type_pointer = SWIG_ReturnGlobalTypeList((void *)0); + #else +- type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, ++ type_pointer = (void *) PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); + if (PyErr_Occurred()) { + PyErr_Clear(); +@@ -2494,7 +2494,7 @@ SWIG_Python_SetModule(swig_module_info *swig_module) { + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + swig_empty_runtime_method_table); + #endif +- PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); ++ PyObject *pointer = (PyObject *) PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { +@@ -2522,7 +2522,7 @@ SWIG_Python_TypeQuery(const char *type) + swig_module_info *swig_module = SWIG_Python_GetModule(); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { +- obj = PyCObject_FromVoidPtr(descriptor, NULL); ++ obj = (PyObject *) PyCObject_FromVoidPtr(descriptor, NULL); + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } +@@ -3883,7 +3883,7 @@ SWIGINTERN PyObject *_wrap_newSWFInput_file(PyObject * + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = newSWFInput_file(arg1); + resultobj = SWIG_NewPointerObj((SWFInput *)memcpy((SWFInput *)malloc(sizeof(SWFInput)),&result,sizeof(SWFInput)), SWIGTYPE_p_SWFInput, SWIG_POINTER_OWN | 0 ); +@@ -3905,7 +3905,7 @@ SWIGINTERN PyObject *_wrap_newSWFInput_stream(PyObject + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = newSWFInput_stream(arg1); + resultobj = SWIG_NewPointerObj((SWFInput *)memcpy((SWFInput *)malloc(sizeof(SWFInput)),&result,sizeof(SWFInput)), SWIGTYPE_p_SWFInput, SWIG_POINTER_OWN | 0 ); +@@ -4299,7 +4299,7 @@ SWIGINTERN PyObject *_wrap_newSWFDBLBitmap(PyObject *S + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = newSWFDBLBitmap(arg1); + resultobj = SWIG_NewPointerObj((SWFDBLBitmap *)memcpy((SWFDBLBitmap *)malloc(sizeof(SWFDBLBitmap)),&result,sizeof(SWFDBLBitmap)), SWIGTYPE_p_SWFDBLBitmap, SWIG_POINTER_OWN | 0 ); +@@ -4349,7 +4349,7 @@ SWIGINTERN PyObject *_wrap_newSWFJpegBitmap(PyObject * + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = newSWFJpegBitmap(arg1); + resultobj = SWIG_NewPointerObj((SWFJpegBitmap *)memcpy((SWFJpegBitmap *)malloc(sizeof(SWFJpegBitmap)),&result,sizeof(SWFJpegBitmap)), SWIGTYPE_p_SWFJpegBitmap, SWIG_POINTER_OWN | 0 ); +@@ -4401,14 +4401,14 @@ SWIGINTERN PyObject *_wrap_newSWFJpegWithAlpha(PyObjec + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + { + if (!PyFile_Check(obj1)) { + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg2 = PyFile_AsFile(obj1); ++ arg2 = (FILE *) PyFile_AsFile(obj1); + } + result = newSWFJpegWithAlpha(arg1,arg2); + resultobj = SWIG_NewPointerObj((SWFJpegWithAlpha *)memcpy((SWFJpegWithAlpha *)malloc(sizeof(SWFJpegWithAlpha)),&result,sizeof(SWFJpegWithAlpha)), SWIGTYPE_p_SWFJpegWithAlpha, SWIG_POINTER_OWN | 0 ); +@@ -7252,7 +7252,7 @@ SWIGINTERN PyObject *_wrap_newSWFSoundStream(PyObject + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = (SWFSoundStream)newSWFSoundStream(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); +@@ -7395,7 +7395,7 @@ SWIGINTERN PyObject *_wrap_newSWFSound(PyObject *SWIGU + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + ecode2 = SWIG_AsVal_unsigned_SS_char(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { +@@ -8852,7 +8852,7 @@ SWIGINTERN PyObject *_wrap_newSWFVideoStream_fromFile( + PyErr_SetString(PyExc_TypeError, "Need a file!"); + return NULL; + } +- arg1 = PyFile_AsFile(obj0); ++ arg1 = (FILE *) PyFile_AsFile(obj0); + } + result = (SWFVideoStream)newSWFVideoStream_fromFile(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 );