pkgsrc-WIP-changes archive

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

py-sip4: Import py-sip-4.19.25 as wip/py-sip4



Module Name:	pkgsrc-wip
Committed By:	Atsushi Toyokura <asteria.at%gmail.com@localhost>
Pushed By:	steleto
Date:		Mon Feb 19 22:15:46 2024 +0900
Changeset:	563545b72baf68c4a40a007092deaa98dc174f8b

Modified Files:
	Makefile
Added Files:
	py-sip4/DESCR
	py-sip4/Makefile
	py-sip4/PLIST
	py-sip4/buildlink3.mk
	py-sip4/distinfo
	py-sip4/patches/patch-configure.py
	py-sip4/patches/patch-sipgen_sipgen.sbf
	py-sip4/patches/patch-siplib_siplib.c
	py-sip4/patches/patch-siputils.py

Log Message:
py-sip4: Import py-sip-4.19.25 as wip/py-sip4

depended by:
- wip/libArcus
- wip/libSavitar
- wip/py-pynest2d

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=563545b72baf68c4a40a007092deaa98dc174f8b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                |  1 +
 py-sip4/DESCR                           |  8 +++++
 py-sip4/Makefile                        | 64 +++++++++++++++++++++++++++++++++
 py-sip4/PLIST                           | 10 ++++++
 py-sip4/buildlink3.mk                   | 14 ++++++++
 py-sip4/distinfo                        |  9 +++++
 py-sip4/patches/patch-configure.py      | 24 +++++++++++++
 py-sip4/patches/patch-sipgen_sipgen.sbf | 14 ++++++++
 py-sip4/patches/patch-siplib_siplib.c   | 16 +++++++++
 py-sip4/patches/patch-siputils.py       | 40 +++++++++++++++++++++
 10 files changed, 200 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 876f9e08a7..ea3d8090ba 100644
--- a/Makefile
+++ b/Makefile
@@ -4466,6 +4466,7 @@ SUBDIR+=	py-sima
 SUBDIR+=	py-simpleparse-mxtexttools
 SUBDIR+=	py-simulators
 SUBDIR+=	py-singletonify
+SUBDIR+=	py-sip4
 SUBDIR+=	py-sipvicious
 SUBDIR+=	py-slixmpp
 SUBDIR+=	py-smart-open
diff --git a/py-sip4/DESCR b/py-sip4/DESCR
new file mode 100644
index 0000000000..917cd7c769
--- /dev/null
+++ b/py-sip4/DESCR
@@ -0,0 +1,8 @@
+SIP is a tool that makes it very easy to create Python bindings for
+C++ libraries. It was originally developed to create PyQt, the Python
+bindings for the Qt toolkit, but can be used to create bindings for any
+C++ library.
+
+This package is the final release of SIP v4, which is no longer
+supported upstream.  See also x11/py-sip5, for SIP v5, which has an
+incompatible API.
diff --git a/py-sip4/Makefile b/py-sip4/Makefile
new file mode 100644
index 0000000000..7c3ae12bbc
--- /dev/null
+++ b/py-sip4/Makefile
@@ -0,0 +1,64 @@
+# $NetBSD$
+
+PKGNAME=	${PYPKGPREFIX}-${DISTNAME:S/sip/sip4/}
+COMMENT=	Tool to create Python bindings for C++ libraries
+
+DISTNAME=	sip-4.19.25
+CATEGORIES=	x11 devel python
+MASTER_SITES=	https://www.riverbankcomputing.com/static/Downloads/sip/${PKGVERSION_NOREV}/
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://riverbankcomputing.com/software/sip/
+
+USE_LANGUAGES=		c c++
+USE_LIBTOOL=		yes
+USE_TOOLS+=		gmake
+
+CONFIGURE_ARGS+=	-b ${PREFIX}/bin
+CONFIGURE_ARGS+=	-d ${PREFIX}/${PYSITELIB}
+CONFIGURE_ARGS+=	-e ${PREFIX}/${PYINC}
+CONFIGURE_ARGS+=	-v ${PREFIX}/share/sip${PYVERSSUFFIX}
+CONFIGURE_ARGS+=	CFLAGS=${CFLAGS:Q}
+CONFIGURE_ARGS+=	CXXFLAGS=${CXXFLAGS:Q}
+CONFIGURE_ARGS+=	INCDIR=${PREFIX}/include
+CONFIGURE_ARGS+=	LIBDIR=${PREFIX}/lib
+
+CONFIGURE_ARGS.DragonFly+=	-p freebsd-g++
+
+PY_PATCHPLIST=		yes
+#PYTHON_VERSIONS_INCOMPATIBLE+= 311 # as of 4.19.25
+
+.include "../../mk/compiler.mk"
+
+.if ${OPSYS} == "Darwin"
+CONFIGURE_ARGS+=	CFLAGS_SHLIB=-fno-common
+CONFIGURE_ARGS+=	LFLAGS_PLUGIN="-bundle -flat_namespace -undefined suppress"
+.else
+CONFIGURE_ARGS+=	CFLAGS_SHLIB=-fPIC
+CONFIGURE_ARGS+=	CXXFLAGS_SHLIB=-fPIC
+.  if ${OPSYS} == "SunOS" && \
+      (${CC_VERSION:Mgcc*} || !empty(PKGSRC_COMPILER:Mclang))
+CONFIGURE_ARGS+=	-p solaris-g++
+# gcc3 uses -mimpure-text to not pass -assert pure-text to the linker
+CONFIGURE_ARGS+=	LFLAGS_SHLIB="-shared -mimpure-text"
+.  else
+CONFIGURE_ARGS+=	LFLAGS_SHLIB="-shared"
+.  endif
+.endif
+CONFIGURE_ARGS+=	LFLAGS=${LDFLAGS:Q}
+
+# Hack: gcc on sparc64 miscompiles sipgen/parser.c at -O2
+.if ${MACHINE_ARCH} == "sparc64" && ${CC_VERSION:Mgcc*}
+BUILDLINK_TRANSFORM+=	rm:-O2
+.endif
+
+SUBST_CLASSES+=		pyversfx
+SUBST_STAGE.pyversfx=	pre-configure
+SUBST_FILES.pyversfx=	sipgen/sipgen.sbf
+SUBST_VARS.pyversfx=	PYVERSSUFFIX
+
+do-configure:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+		${PYTHONBIN} configure.py ${CONFIGURE_ARGS}
+
+.include "../../lang/python/extension.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/py-sip4/PLIST b/py-sip4/PLIST
new file mode 100644
index 0000000000..fdb4e08d3a
--- /dev/null
+++ b/py-sip4/PLIST
@@ -0,0 +1,10 @@
+@comment $NetBSD$
+bin/sip${PYVERSSUFFIX}
+${PYINC}/sip.h
+${PYSITELIB}/sip-${PKGVERSION}.dist-info/INSTALLER
+${PYSITELIB}/sip-${PKGVERSION}.dist-info/METADATA
+${PYSITELIB}/sip-${PKGVERSION}.dist-info/RECORD
+${PYSITELIB}/sip.pyi
+${PYSITELIB}/sip.so
+${PYSITELIB}/sipconfig.py
+${PYSITELIB}/sipdistutils.py
diff --git a/py-sip4/buildlink3.mk b/py-sip4/buildlink3.mk
new file mode 100644
index 0000000000..b6098db8ab
--- /dev/null
+++ b/py-sip4/buildlink3.mk
@@ -0,0 +1,14 @@
+# $NetBSD$
+
+BUILDLINK_TREE+=	py-sip4
+
+.if !defined(PY_SIP_BUILDLINK3_MK)
+PY_SIP_BUILDLINK3_MK:=
+
+.include "../../lang/python/pyversion.mk"
+
+BUILDLINK_API_DEPENDS.py-sip4+=	${PYPKGPREFIX}-sip4>=4.14.7<5
+BUILDLINK_PKGSRCDIR.py-sip4?=	../../wip/py-sip4
+.endif # PY_SIP_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-py-sip4
diff --git a/py-sip4/distinfo b/py-sip4/distinfo
new file mode 100644
index 0000000000..3193dcecf2
--- /dev/null
+++ b/py-sip4/distinfo
@@ -0,0 +1,9 @@
+$NetBSD$
+
+BLAKE2s (sip-4.19.25.tar.gz) = fb9290de418db91c8597c0210dea5738eba23950ba469766ee427cb813c6d05b
+SHA512 (sip-4.19.25.tar.gz) = 60fb4133c68869bf0993144978b4847d94a0f9c7b477f64a346ea133cfe35bc11820204ab327dcf9a929b6f65a26d16cc7efbce65e49967c3347b39376e57001
+Size (sip-4.19.25.tar.gz) = 1056384 bytes
+SHA1 (patch-configure.py) = b200e5dc1b33e21d866136efa3809fc7a2ce4d82
+SHA1 (patch-sipgen_sipgen.sbf) = f90554d3d0e4cdcf33e69f492281a028ed6975fb
+SHA1 (patch-siplib_siplib.c) = 683d7384db93b3ee8738ab33b62db619fc0b4a5d
+SHA1 (patch-siputils.py) = 39436983efbf6719b376084a14b8c71b708ed329
diff --git a/py-sip4/patches/patch-configure.py b/py-sip4/patches/patch-configure.py
new file mode 100644
index 0000000000..c29129d9f0
--- /dev/null
+++ b/py-sip4/patches/patch-configure.py
@@ -0,0 +1,24 @@
+$NetBSD$
+
+Add PYVERSSUFFIX.
+
+--- configure.py.orig	2018-10-01 13:22:40.000000000 +0000
++++ configure.py
+@@ -250,7 +250,7 @@ def set_platform_directories():
+ 
+         plat_py_lib_dir = lib_dir + "/config"
+         plat_bin_dir = sys.exec_prefix + "/bin"
+-        plat_sip_dir = sys.prefix + "/share/sip"
++        plat_sip_dir = sys.prefix + "/share/sip{}.{}".format(sys.version_info.major, sys.version_info.minor)
+ 
+ 
+ def create_config(module, template, macros):
+@@ -268,7 +268,7 @@ def create_config(module, template, macr
+         "sip_version":      sip_version,
+         "sip_version_str":  sip_version_str,
+         "platform":         build_platform,
+-        "sip_bin":          os.path.join(sip_bin_dir, "sip"),
++        "sip_bin":          os.path.join(sip_bin_dir, "sip{}.{}".format(sys.version_info.major, sys.version_info.minor)),
+         "sip_inc_dir":      sip_inc_dir,
+         "sip_root_dir":     sip_root_dir,
+         "sip_module_dir":   sip_module_dir,
diff --git a/py-sip4/patches/patch-sipgen_sipgen.sbf b/py-sip4/patches/patch-sipgen_sipgen.sbf
new file mode 100644
index 0000000000..347f730d77
--- /dev/null
+++ b/py-sip4/patches/patch-sipgen_sipgen.sbf
@@ -0,0 +1,14 @@
+$NetBSD$
+
+Use PYVERSSUFFIX.
+
+--- sipgen/sipgen.sbf.orig	2017-02-15 12:37:11.000000000 +0000
++++ sipgen/sipgen.sbf
+@@ -14,6 +14,6 @@
+ # SIP is supplied WITHOUT ANY WARRANTY; without even the implied warranty of
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ 
+-target = sip
++target = sip@PYVERSSUFFIX@
+ sources = main.c transform.c gencode.c extracts.c export.c type_hints.c heap.c parser.c lexer.c 
+ headers = sip.h parser.h
diff --git a/py-sip4/patches/patch-siplib_siplib.c b/py-sip4/patches/patch-siplib_siplib.c
new file mode 100644
index 0000000000..847dec79d6
--- /dev/null
+++ b/py-sip4/patches/patch-siplib_siplib.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+--- siplib/siplib.c.orig	2023-04-09 02:03:57.802590100 +0000
++++ siplib/siplib.c
+@@ -13747,7 +13747,11 @@ static struct _frame *sip_api_get_frame(
+ 
+     while (frame != NULL && depth > 0)
+     {
++#if (PY_VERSION_HEX >= 0x3b0f0) // 3.11.0
++        frame = PyFrame_GetBack(frame);
++#else
+         frame = frame->f_back;
++#endif
+         --depth;
+     }
+ 
diff --git a/py-sip4/patches/patch-siputils.py b/py-sip4/patches/patch-siputils.py
new file mode 100644
index 0000000000..6cd0526769
--- /dev/null
+++ b/py-sip4/patches/patch-siputils.py
@@ -0,0 +1,40 @@
+$NetBSD$
+
+Fix build on Darwin with pkgsrc python.
+Fix SunOS/clang.
+
+--- siputils.py.orig	2015-03-25 11:00:24.000000000 +0000
++++ siputils.py
+@@ -258,6 +258,9 @@ class Makefile:
+         self._installs = installs
+         self._infix = ""
+ 
++        if sys.platform == "darwin":
++            self.config.qt_framework = 0
++
+         # Make sure the destination directory is an absolute path.
+         if dir:
+             self.dir = os.path.abspath(dir)
+@@ -880,7 +883,7 @@
+                     qt5_rename = True
+                 else:
+                     lib = lib + "4"
+-        elif sys.platform.startswith("linux") and qt_version >= 0x050000:
++        elif qt_version >= 0x050000:
+             qt5_rename = True
+ 
+         if qt5_rename:
+@@ -1596,10 +1599,10 @@ class ModuleMakefile(Makefile):
+                     if sys.platform[:5] == 'linux':
+                         self.LFLAGS.extend(['-Wl,--version-script=%s.exp' % self._target])
+                     elif sys.platform[:5] == 'sunos':
+-                        if self.required_string('LINK') == 'g++':
+-                            self.LFLAGS.extend(['-Wl,-z,noversion', '-Wl,-M,%s.exp' % self._target])
+-                        else:
++                        if self.required_string('LINK') == 'CC':
+                             self.LFLAGS.extend(['-z' 'noversion', '-M', '%s.exp' % self._target])
++                        else:
++                            self.LFLAGS.extend(['-Wl,-z,noversion', '-Wl,-M,%s.exp' % self._target])
+                     elif sys.platform[:5] == 'hp-ux':
+                         self.LFLAGS.extend(['-Wl,+e,%s' % self._entry_point])
+                     elif sys.platform[:5] == 'irix' and self.required_string('LINK') != 'g++':


Home | Main Index | Thread Index | Old Index