Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-irc/kvirc/files/, net-irc/kvirc/
Date: Fri, 16 Aug 2019 17:03:18
Message-Id: 1565974949.1538263608179c516b9f6f1347538dedaf181a16.floppym@gentoo
1 commit: 1538263608179c516b9f6f1347538dedaf181a16
2 Author: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
3 AuthorDate: Thu Aug 15 19:19:58 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 16 17:02:29 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=15382636
7
8 net-irc/kvirc: Support Python 3.
9
10 Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache.Org>
11 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
12
13 .../kvirc-5.2_pre20190628041642-python-3.patch | 53 ++++++++++++++++++++++
14 net-irc/kvirc/kvirc-5.2_pre20190628041642.ebuild | 6 ++-
15 net-irc/kvirc/kvirc-9999.ebuild | 6 ++-
16 3 files changed, 63 insertions(+), 2 deletions(-)
17
18 diff --git a/net-irc/kvirc/files/kvirc-5.2_pre20190628041642-python-3.patch b/net-irc/kvirc/files/kvirc-5.2_pre20190628041642-python-3.patch
19 new file mode 100644
20 index 00000000000..14e9e6f795c
21 --- /dev/null
22 +++ b/net-irc/kvirc/files/kvirc-5.2_pre20190628041642-python-3.patch
23 @@ -0,0 +1,53 @@
24 +https://github.com/kvirc/KVIrc/pull/2269
25 +
26 +--- /CMakeLists.txt
27 ++++ /CMakeLists.txt
28 +@@ -67,9 +67,6 @@
29 + set(CMAKE_KVIRC_BUILD_COMPILER ${CMAKE_CXX_COMPILER})
30 + set(CMAKE_KVIRC_BUILD_COMPILER_FLAGS ${CMAKE_CXX_FLAGS})
31 +
32 +-# Prefer Python 2.7 over 3.x (which is currently incompatible) - GitHub issue #2020
33 +-set(Python_ADDITIONAL_VERSIONS "2.7")
34 +-
35 + # Suffix for GNU/Linux
36 + set(LIB_SUFFIX
37 + CACHE STRING "Define suffix of directory name (32/64)"
38 +@@ -751,10 +748,10 @@
39 + # Check for Python support
40 + option(WANT_PYTHON "Compile Python support" ON)
41 + if(WANT_PYTHON)
42 +- find_package(PythonLibs 2.7)
43 ++ find_package(PythonLibs)
44 + if(PYTHONLIBS_FOUND)
45 + set(COMPILE_PYTHON_SUPPORT 1)
46 +- set(CMAKE_STATUS_PYTHON_SUPPORT "Yes")
47 ++ set(CMAKE_STATUS_PYTHON_SUPPORT "Yes, Python ${PYTHONLIBS_VERSION_STRING}")
48 + list(APPEND LIBS ${PYTHON_LIBRARIES})
49 + include_directories(${PYTHON_INCLUDE_DIRS})
50 + else()
51 +--- /src/modules/pythoncore/kvircmodule.cpp
52 ++++ /src/modules/pythoncore/kvircmodule.cpp
53 +@@ -413,7 +413,7 @@
54 + else
55 + {
56 + // Create a CObject containing the API pointer array's address
57 +- PyObject * pC_API_Object = PyCObject_FromVoidPtr(PyKVIrc_API, nullptr);
58 ++ PyObject * pC_API_Object = PyCapsule_New((void *)PyKVIrc_API, "kvirc._C_API", nullptr);
59 + if(pC_API_Object)
60 + PyModule_AddObject(pModule, "_C_API", pC_API_Object);
61 + }
62 +--- /src/modules/pythoncore/pythonheaderwrapper.h
63 ++++ /src/modules/pythoncore/pythonheaderwrapper.h
64 +@@ -1,6 +1,12 @@
65 + #ifndef _PYTHONHEADERWRAPPER_H_
66 + #define _PYTHONHEADERWRAPPER_H_
67 +
68 ++// As of Python 3, something inside <Python.h> defines a struct with a member
69 ++// called "slots" which conflicts with the builtin Qt keyword. But since we
70 ++// include stuff from KVIrc itself back into the python module, we can't just
71 ++// use QT_NO_KEYWORDS.
72 ++#undef slots
73 ++
74 + // See http://stackoverflow.com/questions/16200997/why-doesnt-include-python-h-work and http://stackoverflow.com/questions/19716859/puzzling-dependency-of-boost-python-1-54-debug-build-to-python27-lib-on-window
75 +
76 + #if defined(_DEBUG) && defined(_MSC_VER)
77
78 diff --git a/net-irc/kvirc/kvirc-5.2_pre20190628041642.ebuild b/net-irc/kvirc/kvirc-5.2_pre20190628041642.ebuild
79 index 9b9efe89389..7e84f4e5ca9 100644
80 --- a/net-irc/kvirc/kvirc-5.2_pre20190628041642.ebuild
81 +++ b/net-irc/kvirc/kvirc-5.2_pre20190628041642.ebuild
82 @@ -3,7 +3,7 @@
83
84 EAPI="7"
85 CMAKE_MAKEFILE_GENERATOR="emake"
86 -PYTHON_COMPAT=(python2_7)
87 +PYTHON_COMPAT=(python{2_7,3_6,3_7})
88
89 inherit cmake-utils flag-o-matic python-single-r1 xdg-utils
90
91 @@ -79,6 +79,10 @@ if [[ "${PV}" != "9999" ]]; then
92 S="${WORKDIR}/KVIrc-${KVIRC_GIT_REVISION}"
93 fi
94
95 +PATCHES=(
96 + "${FILESDIR}/${PN}-5.2_pre20190628041642-python-3.patch"
97 +)
98 +
99 DOCS=()
100
101 pkg_setup() {
102
103 diff --git a/net-irc/kvirc/kvirc-9999.ebuild b/net-irc/kvirc/kvirc-9999.ebuild
104 index 3e4e206a18d..46a0772c275 100644
105 --- a/net-irc/kvirc/kvirc-9999.ebuild
106 +++ b/net-irc/kvirc/kvirc-9999.ebuild
107 @@ -3,7 +3,7 @@
108
109 EAPI="7"
110 CMAKE_MAKEFILE_GENERATOR="emake"
111 -PYTHON_COMPAT=(python2_7)
112 +PYTHON_COMPAT=(python{2_7,3_6,3_7})
113
114 inherit cmake-utils flag-o-matic python-single-r1 xdg-utils
115
116 @@ -79,6 +79,10 @@ if [[ "${PV}" != "9999" ]]; then
117 S="${WORKDIR}/KVIrc-${KVIRC_GIT_REVISION}"
118 fi
119
120 +PATCHES=(
121 + "${FILESDIR}/${PN}-5.2_pre20190628041642-python-3.patch"
122 +)
123 +
124 DOCS=()
125
126 pkg_setup() {