git: 97deaa15fc17 - main - x11-toolkits/py-fltk: update the port to version 1.3.8

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Tue, 08 Aug 2023 07:31:36 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=97deaa15fc17517445f6a7c8da3cbea796beda9a

commit 97deaa15fc17517445f6a7c8da3cbea796beda9a
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2023-08-08 07:30:22 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2023-08-08 07:30:22 +0000

    x11-toolkits/py-fltk: update the port to version 1.3.8
    
    It has better compatibility with modern compilers and matches
    our current FLTK version (adjust port description accordingly).
---
 x11-toolkits/py-fltk/Makefile             | 28 ++++++++++++----------------
 x11-toolkits/py-fltk/distinfo             |  6 +++---
 x11-toolkits/py-fltk/files/patch-setup.py | 21 +++++++++++----------
 x11-toolkits/py-fltk/pkg-descr            |  7 +++----
 4 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/x11-toolkits/py-fltk/Makefile b/x11-toolkits/py-fltk/Makefile
index ba34a91d2f0c..3e69ed3084eb 100644
--- a/x11-toolkits/py-fltk/Makefile
+++ b/x11-toolkits/py-fltk/Makefile
@@ -1,24 +1,27 @@
 PORTNAME=	fltk
-PORTVERSION=	1.3.4.1
+PORTVERSION=	1.3.8
 CATEGORIES=	x11-toolkits python
 MASTER_SITES=	SF/py${PORTNAME}/py${PORTNAME}/pyFltk-${PORTVERSION}
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
-DISTNAME=	pyFltk-${PORTVERSION}_py3
+DISTNAME=	pyFltk-${PORTVERSION}
 
 MAINTAINER=	python@FreeBSD.org
 COMMENT=	Python interface to FLTK window toolkit
-WWW=		http://pyfltk.sourceforge.net/
+WWW=		https://pyfltk.sourceforge.io/
 
 LICENSE=	LGPL20
 LICENSE_FILE=	${WRKSRC}/COPYING
 
+BUILD_DEPENDS=	swig:devel/swig
 LIB_DEPENDS=	libfltk.so:x11-toolkits/fltk
 
 CFLAGS+=	-DFL_LIBRARY
-MAKE_ENV=	FLTK_HOME=${LOCALBASE}/bin
-USES=		python xorg
-USE_CXXSTD=	c++14
+USES=		python shebangfix xorg
 USE_PYTHON=	autoplist distutils
+PYDISTUTILS_CONFIGUREARGS=	swig
+SHEBANG_FILES=	fltk/test/tree.py \
+		fltk/test/tree_demo.py \
+		fltk/test/fltk_threads.py
 USE_XORG=	x11
 
 DOCSDIR=	${PREFIX}/share/doc/py-${PORTNAME}
@@ -29,16 +32,9 @@ WRKSRC=		${WRKDIR}/pyFltk-${PORTVERSION}
 
 OPTIONS_DEFINE=	DOCS EXAMPLES
 
-.include <bsd.port.options.mk>
-
-.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400091 || ( ${OSVERSION} >= 1302507 && ${OSVERSION} < 1400000 ))
-CFLAGS+=	-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS
-.endif
-
 post-patch:
-	@${REINPLACE_CMD} -e 's|/usr/X11R6|${LOCALBASE}|g' ${WRKSRC}/setup.py
-	@${REINPLACE_CMD} -e '/#pragma GCC diagnostic/d' \
-		${WRKSRC}/python/fltk_wrap.cpp
+	@${REINPLACE_CMD} -e '/^%include fl_types/,+1 \
+		s|Enumerations|Fl_Export|' ${WRKSRC}/swig/fltk.i
 
 post-build:
 	${REINPLACE_CMD} -e "s|\.\./docs|${DOCSDIR}/html|g" ${WRKSRC}/fltk/test/help.py
@@ -48,7 +44,7 @@ post-install:
 
 post-install-DOCS-on:
 	${MKDIR} ${STAGEDIR}${DOCSDIR}/html/
-	cd ${WRKSRC}/ && ${INSTALL_DATA} CHANGES README TODO ${STAGEDIR}${DOCSDIR}/
+	cd ${WRKSRC}/ && ${INSTALL_DATA} CHANGES README.md ${STAGEDIR}${DOCSDIR}/
 	cd ${WRKSRC}/fltk/docs/ && ${INSTALL_DATA} *.html *.jpg ${STAGEDIR}${DOCSDIR}/html/
 
 post-install-EXAMPLES-on:
diff --git a/x11-toolkits/py-fltk/distinfo b/x11-toolkits/py-fltk/distinfo
index 76d7fbb73a18..4bdf9133a0e5 100644
--- a/x11-toolkits/py-fltk/distinfo
+++ b/x11-toolkits/py-fltk/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1499054805
-SHA256 (pyFltk-1.3.4.1_py3.tar.gz) = 9cbac496f124cd99a1eb0d329dbfdac0d1e160d25f9fd82a3dfb10abc86e069c
-SIZE (pyFltk-1.3.4.1_py3.tar.gz) = 955717
+TIMESTAMP = 1661553643
+SHA256 (pyFltk-1.3.8.tar.gz) = f7c5012810022dce011f3ed9f3f004c56e08090823739bfe670881fce9611f80
+SIZE (pyFltk-1.3.8.tar.gz) = 587221
diff --git a/x11-toolkits/py-fltk/files/patch-setup.py b/x11-toolkits/py-fltk/files/patch-setup.py
index 8e0d02c386b7..ef29b4f616d3 100644
--- a/x11-toolkits/py-fltk/files/patch-setup.py
+++ b/x11-toolkits/py-fltk/files/patch-setup.py
@@ -1,19 +1,20 @@
---- setup.py.orig	2016-12-29 09:36:33 UTC
+--- setup.py.orig	2022-08-26 05:16:56 UTC
 +++ setup.py
-@@ -106,7 +106,7 @@ elif sys.platform.startswith('linux'):
+@@ -80,7 +80,7 @@ elif sys.platform.startswith('linux')  or sys.platform
      compile_arg_list.append('-Werror=format-security')
      lib_dir_list = [fltk_lib_dir, '/usr/lib']
      lib_list = ["fltk"]
 -elif sys.platform in ['freebsd4','freebsd5','freebsd6','freebsd7', 'sunos5']:
 +elif sys.platform[0:7] == 'freebsd':
-     print("Building for: %s"%sys.platform)
+     print(f"Building for: {sys.platform}")
      def_list = [('UNIX', '1')]
      lib_dir_list = [fltk_lib_dir,'/usr/X11R6/lib','/usr/lib']
-@@ -323,7 +323,6 @@ setup (name = 'pyFltk',
-        description = 'This is a Python wrapper for the FLTK',
-        ext_modules = [module1],
-        packages = ['fltk'],
--       package_data={'fltk': ['test/*.*', 'docs/*.*']},
-        )
- 
+@@ -297,7 +297,7 @@ class PySwigCommand(distutils.cmd.Command):
  
+   def run(self):
+     """Run command."""
+-    command = ['swig', '-w302', '-w312', '-w325', '-w362', '-w389', '-w401', '-w473', '-w509', '-I./swig', '-DFL_EXPORT', '-DPYTHON', '-DPYTHON3', '-py3', '-c++', '-python', '-shadow', '-fastdispatch', '-outdir', 'fltk', '-o', 'fltk/fltk_wrap.cpp', './swig/fltk.i']
++    command = ['swig', '-w302', '-w312', '-w325', '-w362', '-w389', '-w401', '-w473', '-w509', '-I./swig', '-DPYTHON', '-DPYTHON3', '-c++', '-python', '-shadow', '-fastdispatch', '-outdir', 'fltk', '-o', 'fltk/fltk_wrap.cpp', './swig/fltk.i']
+     pos = command.index('-I./swig')+1
+     command[pos:pos] = self.include
+     self.announce(
diff --git a/x11-toolkits/py-fltk/pkg-descr b/x11-toolkits/py-fltk/pkg-descr
index 3cc7ce10c713..bad899549b65 100644
--- a/x11-toolkits/py-fltk/pkg-descr
+++ b/x11-toolkits/py-fltk/pkg-descr
@@ -1,4 +1,3 @@
-pyFLTK is Python wrapper for the Fast Light Tool Kit cross-platform graphical
-user-interface library.
-
-This package wraps FLTK version 1.1 and is quite stable.
+pyFLTK is Python wrapper for the Fast Light Tool Kit cross-platform
+graphical user-interface library.  It wraps FLTK version 1.3 and is
+quite stable.