1 |
# This package depends on automagic byte compilation |
2 |
# https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation_phase_2 |
3 |
%global _python_bytecompile_extra 1 |
4 |
|
5 |
%?mingw_package_header |
6 |
|
7 |
# See https://fedoraproject.org/wiki/Packaging:Python_Appendix#Manual_byte_compilation |
8 |
%global __python %{__python3} |
9 |
|
10 |
Name: mingw-glib2 |
11 |
Version: 2.62.3 |
12 |
Release: %mkrel 1 |
13 |
Summary: MinGW Windows GLib2 library |
14 |
|
15 |
License: LGPLv2+ |
16 |
Group: Development/Other |
17 |
URL: http://www.gtk.org |
18 |
# first two digits of version |
19 |
%global release_version %(echo %{version} | awk -F. '{print $1"."$2}') |
20 |
Source0: http://download.gnome.org/sources/glib/%{release_version}/glib-%{version}.tar.xz |
21 |
|
22 |
BuildArch: noarch |
23 |
|
24 |
BuildRequires: meson |
25 |
BuildRequires: gcc |
26 |
BuildRequires: gcc-c++ |
27 |
|
28 |
BuildRequires: mingw32-filesystem >= 107 |
29 |
BuildRequires: mingw32-gcc |
30 |
BuildRequires: mingw32-binutils |
31 |
BuildRequires: mingw32-win-iconv |
32 |
BuildRequires: mingw32-gettext |
33 |
BuildRequires: mingw32-libffi |
34 |
BuildRequires: mingw32-pcre |
35 |
BuildRequires: mingw32-zlib |
36 |
|
37 |
BuildRequires: mingw64-filesystem >= 107 |
38 |
BuildRequires: mingw64-gcc |
39 |
BuildRequires: mingw64-binutils |
40 |
BuildRequires: mingw64-win-iconv |
41 |
BuildRequires: mingw64-gettext |
42 |
BuildRequires: mingw64-libffi |
43 |
BuildRequires: mingw64-pcre |
44 |
BuildRequires: mingw64-zlib |
45 |
|
46 |
# Native version required for msgfmt use in build |
47 |
BuildRequires: gettext |
48 |
# Native version required for glib-genmarshal |
49 |
BuildRequires: glib2-devel >= 2.45.3 |
50 |
BuildRequires: pkgconfig(libpcre) |
51 |
BuildRequires: pkgconfig(python3) |
52 |
|
53 |
# https://bugzilla.gnome.org/show_bug.cgi?id=674214 |
54 |
Patch1: 0001-Use-CreateFile-on-Win32-to-make-sure-g_unlink-always.patch |
55 |
|
56 |
# Prefer the use of GCC constructors over DllMain |
57 |
# This prevents having to depend on DllMain in static libraries |
58 |
# http://lists.fedoraproject.org/pipermail/mingw/2013-March/006429.html |
59 |
# http://lists.fedoraproject.org/pipermail/mingw/2013-March/006469.html |
60 |
# https://bugzilla.gnome.org/show_bug.cgi?id=698118 |
61 |
Patch5: glib-prefer-constructors-over-DllMain.patch |
62 |
|
63 |
%description |
64 |
MinGW Windows Glib2 library. |
65 |
|
66 |
# Win32 |
67 |
%package -n mingw32-glib2 |
68 |
Summary: MinGW Windows Glib2 library for the win32 target |
69 |
Group: Development/Other |
70 |
# glib-genmarshal and glib-mkenums are written in Python |
71 |
Requires: python3 |
72 |
|
73 |
%description -n mingw32-glib2 |
74 |
MinGW Windows Glib2 library. |
75 |
|
76 |
%package -n mingw32-glib2-static |
77 |
Summary: Static version of the MinGW Windows GLib2 library |
78 |
Group: Development/Other |
79 |
Requires: mingw32-glib2 = %{version}-%{release} |
80 |
Requires: mingw32-gettext-static |
81 |
|
82 |
%description -n mingw32-glib2-static |
83 |
Static version of the MinGW Windows GLib2 library. |
84 |
|
85 |
# Win64 |
86 |
%package -n mingw64-glib2 |
87 |
Summary: MinGW Windows Glib2 library for the win64 target |
88 |
Group: Development/Other |
89 |
# glib-genmarshal and glib-mkenums are written in Python |
90 |
Requires: python3 |
91 |
|
92 |
%description -n mingw64-glib2 |
93 |
MinGW Windows Glib2 library. |
94 |
|
95 |
%package -n mingw64-glib2-static |
96 |
Summary: Static version of the MinGW Windows GLib2 library |
97 |
Group: Development/Other |
98 |
Requires: mingw64-glib2 = %{version}-%{release} |
99 |
Requires: mingw64-gettext-static |
100 |
|
101 |
%description -n mingw64-glib2-static |
102 |
Static version of the MinGW Windows GLib2 library. |
103 |
|
104 |
|
105 |
%?mingw_debug_package |
106 |
|
107 |
|
108 |
%prep |
109 |
%setup -q -n glib-%{version} |
110 |
%patch1 -p1 |
111 |
|
112 |
%build |
113 |
%mingw_meson --default-library=both |
114 |
%mingw_ninja |
115 |
|
116 |
%install |
117 |
%mingw_ninja_install |
118 |
|
119 |
# There's a small difference in the file glibconfig.h between the |
120 |
# shared and the static build: |
121 |
# |
122 |
#diff -ur shared/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include/glibconfig.h static/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include/glibconfig.h |
123 |
#--- shared/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include/glibconfig.h 2009-02-20 17:34:35.735677022 +0100 |
124 |
#+++ static/usr/i686-pc-mingw32/sys-root/mingw/lib/glib-2.0/include/glibconfig.h 2009-02-20 17:33:35.498932269 +0100 |
125 |
#@@ -92,7 +92,8 @@ |
126 |
# |
127 |
# #define G_OS_WIN32 |
128 |
# #define G_PLATFORM_WIN32 |
129 |
#- |
130 |
#+#define GLIB_STATIC_COMPILATION 1 |
131 |
#+#define GOBJECT_STATIC_COMPILATION 1 |
132 |
# |
133 |
# #define G_VA_COPY va_copy |
134 |
# |
135 |
# However, we can't merge this change as it is situation-dependent... |
136 |
# |
137 |
# Developers using the static build of GLib need to add -DGLIB_STATIC_COMPILATION |
138 |
# and -DGOBJECT_STATIC_COMPILATION to their CFLAGS to avoid compile failures |
139 |
|
140 |
# Drop the folder which was temporary used for installing the static bits |
141 |
rm -f $RPM_BUILD_ROOT/%{mingw32_libdir}/charset.alias |
142 |
rm -f $RPM_BUILD_ROOT/%{mingw64_libdir}/charset.alias |
143 |
|
144 |
# Drop the GDB helper files as we can't use the native Fedora GDB to debug Win32 programs |
145 |
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gdb |
146 |
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gdb |
147 |
|
148 |
# Remove the gtk-doc documentation and manpages which duplicate Fedora native |
149 |
rm -rf $RPM_BUILD_ROOT%{mingw32_mandir} |
150 |
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/gtk-doc |
151 |
|
152 |
rm -rf $RPM_BUILD_ROOT%{mingw64_mandir} |
153 |
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/gtk-doc |
154 |
|
155 |
# Bash-completion files aren't interesting for mingw |
156 |
rm -rf $RPM_BUILD_ROOT%{mingw32_datadir}/bash-completion |
157 |
rm -rf $RPM_BUILD_ROOT%{mingw64_datadir}/bash-completion |
158 |
|
159 |
# The .def files are also of no use to other binaries |
160 |
rm -f $RPM_BUILD_ROOT%{mingw32_libdir}/*.def |
161 |
rm -f $RPM_BUILD_ROOT%{mingw64_libdir}/*.def |
162 |
|
163 |
# The gdbus-codegen pieces are already in the native glib2 package |
164 |
rm -f $RPM_BUILD_ROOT%{mingw32_bindir}/gdbus-codegen |
165 |
rm -rf $RPM_BUILD_ROOT%{mingw32_libdir}/gdbus-2.0 |
166 |
|
167 |
rm -f $RPM_BUILD_ROOT%{mingw64_bindir}/gdbus-codegen |
168 |
rm -rf $RPM_BUILD_ROOT%{mingw64_libdir}/gdbus-2.0 |
169 |
|
170 |
# Drop all .la files |
171 |
find $RPM_BUILD_ROOT -name "*.la" -delete |
172 |
|
173 |
%mingw_find_lang glib20 |
174 |
|
175 |
|
176 |
# Win32 |
177 |
%files -n mingw32-glib2 -f mingw32-glib20.lang |
178 |
%license COPYING |
179 |
%{mingw32_bindir}/gdbus.exe |
180 |
%{mingw32_bindir}/gio.exe |
181 |
%{mingw32_bindir}/gio-querymodules.exe |
182 |
%{mingw32_bindir}/glib-compile-resources.exe |
183 |
%{mingw32_bindir}/glib-compile-schemas.exe |
184 |
%{mingw32_bindir}/glib-genmarshal |
185 |
%{mingw32_bindir}/glib-gettextize |
186 |
%{mingw32_bindir}/glib-mkenums |
187 |
%{mingw32_bindir}/gobject-query.exe |
188 |
%{mingw32_bindir}/gresource.exe |
189 |
%{mingw32_bindir}/gsettings.exe |
190 |
%{mingw32_bindir}/gspawn-win32-helper-console.exe |
191 |
%{mingw32_bindir}/gspawn-win32-helper.exe |
192 |
%{mingw32_bindir}/gtester-report |
193 |
%{mingw32_bindir}/libgio-2.0-0.dll |
194 |
%{mingw32_bindir}/libglib-2.0-0.dll |
195 |
%{mingw32_bindir}/libgmodule-2.0-0.dll |
196 |
%{mingw32_bindir}/libgobject-2.0-0.dll |
197 |
%{mingw32_bindir}/libgthread-2.0-0.dll |
198 |
%{mingw32_includedir}/glib-2.0/ |
199 |
%{mingw32_includedir}/gio-win32-2.0/ |
200 |
%{mingw32_libdir}/glib-2.0/ |
201 |
%{mingw32_libdir}/libgio-2.0.dll.a |
202 |
%{mingw32_libdir}/libglib-2.0.dll.a |
203 |
%{mingw32_libdir}/libgmodule-2.0.dll.a |
204 |
%{mingw32_libdir}/libgobject-2.0.dll.a |
205 |
%{mingw32_libdir}/libgthread-2.0.dll.a |
206 |
%{mingw32_libdir}/pkgconfig/gio-2.0.pc |
207 |
%{mingw32_libdir}/pkgconfig/gio-windows-2.0.pc |
208 |
%{mingw32_libdir}/pkgconfig/glib-2.0.pc |
209 |
%{mingw32_libdir}/pkgconfig/gmodule-2.0.pc |
210 |
%{mingw32_libdir}/pkgconfig/gmodule-export-2.0.pc |
211 |
%{mingw32_libdir}/pkgconfig/gmodule-no-export-2.0.pc |
212 |
%{mingw32_libdir}/pkgconfig/gobject-2.0.pc |
213 |
%{mingw32_libdir}/pkgconfig/gthread-2.0.pc |
214 |
%{mingw32_datadir}/aclocal/glib-2.0.m4 |
215 |
%{mingw32_datadir}/aclocal/glib-gettext.m4 |
216 |
%{mingw32_datadir}/aclocal/gsettings.m4 |
217 |
%{mingw32_datadir}/gettext/its/ |
218 |
%{mingw32_datadir}/glib-2.0/ |
219 |
|
220 |
%files -n mingw32-glib2-static |
221 |
%{mingw32_libdir}/libgio-2.0.a |
222 |
%{mingw32_libdir}/libglib-2.0.a |
223 |
%{mingw32_libdir}/libgmodule-2.0.a |
224 |
%{mingw32_libdir}/libgobject-2.0.a |
225 |
%{mingw32_libdir}/libgthread-2.0.a |
226 |
|
227 |
# Win64 |
228 |
%files -n mingw64-glib2 -f mingw64-glib20.lang |
229 |
%license COPYING |
230 |
%{mingw64_bindir}/gdbus.exe |
231 |
%{mingw64_bindir}/gio.exe |
232 |
%{mingw64_bindir}/gio-querymodules.exe |
233 |
%{mingw64_bindir}/glib-compile-resources.exe |
234 |
%{mingw64_bindir}/glib-compile-schemas.exe |
235 |
%{mingw64_bindir}/glib-genmarshal |
236 |
%{mingw64_bindir}/glib-gettextize |
237 |
%{mingw64_bindir}/glib-mkenums |
238 |
%{mingw64_bindir}/gobject-query.exe |
239 |
%{mingw64_bindir}/gresource.exe |
240 |
%{mingw64_bindir}/gsettings.exe |
241 |
%{mingw64_bindir}/gspawn-win64-helper-console.exe |
242 |
%{mingw64_bindir}/gspawn-win64-helper.exe |
243 |
%{mingw64_bindir}/gtester-report |
244 |
%{mingw64_bindir}/libgio-2.0-0.dll |
245 |
%{mingw64_bindir}/libglib-2.0-0.dll |
246 |
%{mingw64_bindir}/libgmodule-2.0-0.dll |
247 |
%{mingw64_bindir}/libgobject-2.0-0.dll |
248 |
%{mingw64_bindir}/libgthread-2.0-0.dll |
249 |
%{mingw64_includedir}/glib-2.0/ |
250 |
%{mingw64_includedir}/gio-win32-2.0/ |
251 |
%{mingw64_libdir}/glib-2.0/ |
252 |
%{mingw64_libdir}/libgio-2.0.dll.a |
253 |
%{mingw64_libdir}/libglib-2.0.dll.a |
254 |
%{mingw64_libdir}/libgmodule-2.0.dll.a |
255 |
%{mingw64_libdir}/libgobject-2.0.dll.a |
256 |
%{mingw64_libdir}/libgthread-2.0.dll.a |
257 |
%{mingw64_libdir}/pkgconfig/gio-2.0.pc |
258 |
%{mingw64_libdir}/pkgconfig/gio-windows-2.0.pc |
259 |
%{mingw64_libdir}/pkgconfig/glib-2.0.pc |
260 |
%{mingw64_libdir}/pkgconfig/gmodule-2.0.pc |
261 |
%{mingw64_libdir}/pkgconfig/gmodule-export-2.0.pc |
262 |
%{mingw64_libdir}/pkgconfig/gmodule-no-export-2.0.pc |
263 |
%{mingw64_libdir}/pkgconfig/gobject-2.0.pc |
264 |
%{mingw64_libdir}/pkgconfig/gthread-2.0.pc |
265 |
%{mingw64_datadir}/aclocal/glib-2.0.m4 |
266 |
%{mingw64_datadir}/aclocal/glib-gettext.m4 |
267 |
%{mingw64_datadir}/aclocal/gsettings.m4 |
268 |
%{mingw64_datadir}/gettext/its/ |
269 |
%{mingw64_datadir}/glib-2.0/ |
270 |
|
271 |
%files -n mingw64-glib2-static |
272 |
%{mingw64_libdir}/libgio-2.0.a |
273 |
%{mingw64_libdir}/libglib-2.0.a |
274 |
%{mingw64_libdir}/libgmodule-2.0.a |
275 |
%{mingw64_libdir}/libgobject-2.0.a |
276 |
%{mingw64_libdir}/libgthread-2.0.a |
277 |
|
278 |
|