1 |
commit: 03a33031108b8245b2828cda7e8a3a231feaabec |
2 |
Author: Alexandru-Sever Horin <alex.sever.h <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Jun 9 15:59:58 2020 +0000 |
4 |
Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Aug 27 15:36:45 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03a33031 |
7 |
|
8 |
dev-python/nautilus-python: fix compilation with GCC10 |
9 |
|
10 |
Fixed compilation with GCC10. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/727514 |
13 |
Closes: https://github.com/gentoo/gentoo/pull/16137 |
14 |
Signed-off-by: Alexandru-Sever Horin <alex.sever.h <AT> gmail.com> |
15 |
Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org> |
16 |
|
17 |
.../nautilus-python-1.2.3-gcc10-fnocommon.patch | 147 +++++++++++++++++++++ |
18 |
.../nautilus-python/nautilus-python-1.2.3.ebuild | 3 + |
19 |
2 files changed, 150 insertions(+) |
20 |
|
21 |
diff --git a/dev-python/nautilus-python/files/nautilus-python-1.2.3-gcc10-fnocommon.patch b/dev-python/nautilus-python/files/nautilus-python-1.2.3-gcc10-fnocommon.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..7e0f760aca2 |
24 |
--- /dev/null |
25 |
+++ b/dev-python/nautilus-python/files/nautilus-python-1.2.3-gcc10-fnocommon.patch |
26 |
@@ -0,0 +1,147 @@ |
27 |
+From bd4820186751034c6b5acb9c71b1aeab03c56523 Mon Sep 17 00:00:00 2001 |
28 |
+From: Andreas Henriksson <andreas@×××××.se> |
29 |
+Date: Mon, 11 May 2020 14:57:45 +0200 |
30 |
+Subject: [PATCH] Fix build with gcc 10 |
31 |
+ |
32 |
+Bug-Debian: https://bugs.debian.org/957578 |
33 |
+Forwarded: https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/7 |
34 |
+Last-Update: 2020-05-11 |
35 |
+--- |
36 |
+ src/nautilus-python-object.c | 10 +++++----- |
37 |
+ src/nautilus-python.c | 13 +++++++++++++ |
38 |
+ src/nautilus-python.h | 22 +++++++++++----------- |
39 |
+ 3 files changed, 29 insertions(+), 16 deletions(-) |
40 |
+ |
41 |
+diff --git a/src/nautilus-python-object.c b/src/nautilus-python-object.c |
42 |
+index f343070..da185ad 100644 |
43 |
+--- a/src/nautilus-python-object.c |
44 |
++++ b/src/nautilus-python-object.c |
45 |
+@@ -40,7 +40,7 @@ int __PyString_Check(PyObject *obj) { |
46 |
+ #endif |
47 |
+ } |
48 |
+ |
49 |
+-char* __PyString_AsString(PyObject *obj) { |
50 |
++const char* __PyString_AsString(PyObject *obj) { |
51 |
+ #if PY_MAJOR_VERSION >= 3 |
52 |
+ return PyUnicode_AsUTF8(obj); |
53 |
+ #else |
54 |
+@@ -389,7 +389,7 @@ beach: |
55 |
+ #define METHOD_NAME "update_file_info" |
56 |
+ static NautilusOperationResult |
57 |
+ nautilus_python_object_update_file_info (NautilusInfoProvider *provider, |
58 |
+- NautilusFile *file, |
59 |
++ NautilusFileInfo *file_info, |
60 |
+ GClosure *update_complete, |
61 |
+ NautilusOperationHandle **handle) { |
62 |
+ NautilusPythonObject *object = (NautilusPythonObject*)provider; |
63 |
+@@ -408,12 +408,12 @@ nautilus_python_object_update_file_info (NautilusInfoProvider *provider, |
64 |
+ pygobject_new((GObject*)provider), |
65 |
+ py_handle, |
66 |
+ pyg_boxed_new(G_TYPE_CLOSURE, update_complete, TRUE, TRUE), |
67 |
+- pygobject_new((GObject*)file)); |
68 |
++ pygobject_new((GObject*)file_info)); |
69 |
+ } |
70 |
+ else if (PyObject_HasAttrString(object->instance, "update_file_info")) { |
71 |
+ py_ret = PyObject_CallMethod(object->instance, |
72 |
+ METHOD_PREFIX METHOD_NAME, "(N)", |
73 |
+- pygobject_new((GObject*)file)); |
74 |
++ pygobject_new((GObject*)file_info)); |
75 |
+ } |
76 |
+ else { |
77 |
+ goto beach; |
78 |
+@@ -434,7 +434,7 @@ nautilus_python_object_update_file_info (NautilusInfoProvider *provider, |
79 |
+ #endif |
80 |
+ |
81 |
+ beach: |
82 |
+- free_pygobject_data(file, NULL); |
83 |
++ free_pygobject_data(file_info, NULL); |
84 |
+ Py_XDECREF(py_ret); |
85 |
+ pyg_gil_state_release(state); |
86 |
+ return ret; |
87 |
+diff --git a/src/nautilus-python.c b/src/nautilus-python.c |
88 |
+index 843e3c6..510cdfb 100644 |
89 |
+--- a/src/nautilus-python.c |
90 |
++++ b/src/nautilus-python.c |
91 |
+@@ -22,6 +22,7 @@ |
92 |
+ #endif |
93 |
+ |
94 |
+ #include <Python.h> |
95 |
++#define NO_IMPORT_PYGOBJECT //To avoid a multiple definition, nautilus-python-object.c also includes and does the import. |
96 |
+ #include <pygobject.h> |
97 |
+ #include <gmodule.h> |
98 |
+ #include <gtk/gtk.h> |
99 |
+@@ -42,6 +43,18 @@ static gboolean nautilus_python_init_python(void); |
100 |
+ static GArray *all_types = NULL; |
101 |
+ |
102 |
+ |
103 |
++PyTypeObject *_PyGtkWidget_Type; |
104 |
++PyTypeObject *_PyNautilusColumn_Type; |
105 |
++PyTypeObject *_PyNautilusColumnProvider_Type; |
106 |
++PyTypeObject *_PyNautilusInfoProvider_Type; |
107 |
++PyTypeObject *_PyNautilusLocationWidgetProvider_Type; |
108 |
++PyTypeObject *_PyNautilusMenu_Type; |
109 |
++PyTypeObject *_PyNautilusMenuItem_Type; |
110 |
++PyTypeObject *_PyNautilusMenuProvider_Type; |
111 |
++PyTypeObject *_PyNautilusPropertyPage_Type; |
112 |
++PyTypeObject *_PyNautilusPropertyPageProvider_Type; |
113 |
++PyTypeObject *_PyNautilusOperationHandle_Type; |
114 |
++ |
115 |
+ static inline gboolean |
116 |
+ np_init_pygobject(void) { |
117 |
+ PyObject *gobject = pygobject_init (PYGOBJECT_MAJOR_VERSION, PYGOBJECT_MINOR_VERSION, PYGOBJECT_MICRO_VERSION); |
118 |
+diff --git a/src/nautilus-python.h b/src/nautilus-python.h |
119 |
+index 4c181f8..c940a06 100644 |
120 |
+--- a/src/nautilus-python.h |
121 |
++++ b/src/nautilus-python.h |
122 |
+@@ -43,37 +43,37 @@ extern NautilusPythonDebug nautilus_python_debug; |
123 |
+ #define debug_enter_args(x, y) { if (nautilus_python_debug & NAUTILUS_PYTHON_DEBUG_MISC) \ |
124 |
+ g_printf("%s: entered " x "\n", __FUNCTION__, y); } |
125 |
+ |
126 |
+-PyTypeObject *_PyGtkWidget_Type; |
127 |
++extern PyTypeObject *_PyGtkWidget_Type; |
128 |
+ #define PyGtkWidget_Type (*_PyGtkWidget_Type) |
129 |
+ |
130 |
+-PyTypeObject *_PyNautilusColumn_Type; |
131 |
++extern PyTypeObject *_PyNautilusColumn_Type; |
132 |
+ #define PyNautilusColumn_Type (*_PyNautilusColumn_Type) |
133 |
+ |
134 |
+-PyTypeObject *_PyNautilusColumnProvider_Type; |
135 |
++extern PyTypeObject *_PyNautilusColumnProvider_Type; |
136 |
+ #define PyNautilusColumnProvider_Type (*_PyNautilusColumnProvider_Type) |
137 |
+ |
138 |
+-PyTypeObject *_PyNautilusInfoProvider_Type; |
139 |
++extern PyTypeObject *_PyNautilusInfoProvider_Type; |
140 |
+ #define PyNautilusInfoProvider_Type (*_PyNautilusInfoProvider_Type) |
141 |
+ |
142 |
+-PyTypeObject *_PyNautilusLocationWidgetProvider_Type; |
143 |
++extern PyTypeObject *_PyNautilusLocationWidgetProvider_Type; |
144 |
+ #define PyNautilusLocationWidgetProvider_Type (*_PyNautilusLocationWidgetProvider_Type) |
145 |
+ |
146 |
+-PyTypeObject *_PyNautilusMenu_Type; |
147 |
++extern PyTypeObject *_PyNautilusMenu_Type; |
148 |
+ #define PyNautilusMenu_Type (*_PyNautilusMenu_Type) |
149 |
+ |
150 |
+-PyTypeObject *_PyNautilusMenuItem_Type; |
151 |
++extern PyTypeObject *_PyNautilusMenuItem_Type; |
152 |
+ #define PyNautilusMenuItem_Type (*_PyNautilusMenuItem_Type) |
153 |
+ |
154 |
+-PyTypeObject *_PyNautilusMenuProvider_Type; |
155 |
++extern PyTypeObject *_PyNautilusMenuProvider_Type; |
156 |
+ #define PyNautilusMenuProvider_Type (*_PyNautilusMenuProvider_Type) |
157 |
+ |
158 |
+-PyTypeObject *_PyNautilusPropertyPage_Type; |
159 |
++extern PyTypeObject *_PyNautilusPropertyPage_Type; |
160 |
+ #define PyNautilusPropertyPage_Type (*_PyNautilusPropertyPage_Type) |
161 |
+ |
162 |
+-PyTypeObject *_PyNautilusPropertyPageProvider_Type; |
163 |
++extern PyTypeObject *_PyNautilusPropertyPageProvider_Type; |
164 |
+ #define PyNautilusPropertyPageProvider_Type (*_PyNautilusPropertyPageProvider_Type) |
165 |
+ |
166 |
+-PyTypeObject *_PyNautilusOperationHandle_Type; |
167 |
++extern PyTypeObject *_PyNautilusOperationHandle_Type; |
168 |
+ #define PyNautilusOperationHandle_Type (*_PyNautilusOperationHandle_Type) |
169 |
+ |
170 |
+ #endif /* NAUTILUS_PYTHON_H */ |
171 |
+-- |
172 |
+2.26.2 |
173 |
+ |
174 |
|
175 |
diff --git a/dev-python/nautilus-python/nautilus-python-1.2.3.ebuild b/dev-python/nautilus-python/nautilus-python-1.2.3.ebuild |
176 |
index 8258df11b31..7e34de01bb8 100644 |
177 |
--- a/dev-python/nautilus-python/nautilus-python-1.2.3.ebuild |
178 |
+++ b/dev-python/nautilus-python/nautilus-python-1.2.3.ebuild |
179 |
@@ -31,6 +31,9 @@ DEPEND="${RDEPEND} |
180 |
virtual/pkgconfig |
181 |
" |
182 |
|
183 |
+# https://gitlab.gnome.org/GNOME/nautilus-python/-/merge_requests/7 |
184 |
+PATCHES=( "${FILESDIR}"/${P}-gcc10-fnocommon.patch ) |
185 |
+ |
186 |
src_install() { |
187 |
gnome2_src_install |
188 |
# Directory for systemwide extensions |