]>
Commit | Line | Data |
---|---|---|
63590a42 JB |
1 | # |
2 | # Conditional build: | |
3 | %bcond_without gdiplus # use libjpeg and libtiff instead of system GDIPLUS | |
4 | # | |
e1a8334a JB |
5 | Summary: An image loading and scaling library - cross MinGW32 version |
6 | Summary(pl.UTF-8): Biblioteka ładująca i skalująca obrazki - wersja skrośna MinGW32 | |
7 | Name: crossmingw32-gdk-pixbuf2 | |
f71916cb | 8 | Version: 2.42.4 |
93526fea | 9 | Release: 1 |
e1a8334a JB |
10 | License: LGPL v2+ |
11 | Group: Development/Libraries | |
b58eb3c8 | 12 | Source0: https://download.gnome.org/sources/gdk-pixbuf/2.42/gdk-pixbuf-%{version}.tar.xz |
f71916cb | 13 | # Source0-md5: 628e4767d1636a06dea5b0fa4838f723 |
644e715c | 14 | URL: https://developer.gnome.org/gdk-pixbuf/ |
e1a8334a | 15 | BuildRequires: crossmingw32-gcc |
b58eb3c8 | 16 | BuildRequires: crossmingw32-glib2 >= 2.56.0 |
7e81c801 | 17 | BuildRequires: crossmingw32-libpng >= 1.0 |
cd84fddd | 18 | BuildRequires: gettext-tools >= 0.19 |
969f93f5 | 19 | # glib-genmarshal, glib-mkenums |
b58eb3c8 | 20 | BuildRequires: glib2-devel >= 1:2.56.0 |
cb35c0b2 | 21 | BuildRequires: meson >= 0.55.3 |
b58eb3c8 | 22 | BuildRequires: ninja >= 1.5 |
e1a8334a | 23 | BuildRequires: pkgconfig >= 1:0.15 |
b58eb3c8 | 24 | BuildRequires: rpmbuild(macros) >= 1.736 |
cba6696c | 25 | BuildRequires: sed >= 4.0 |
63590a42 JB |
26 | BuildRequires: tar >= 1:1.22 |
27 | BuildRequires: xz | |
28 | %if %{without gdiplus} | |
29 | BuildRequires: crossmingw32-libjpeg | |
30 | BuildRequires: crossmingw32-libtiff | |
31 | %endif | |
b58eb3c8 | 32 | Requires: crossmingw32-glib2 >= 2.56.0 |
e1a8334a JB |
33 | Conflicts: crossmingw32-gtk+2 < 2.22.0 |
34 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
35 | ||
36 | %define abiver 2.10.0 | |
37 | ||
38 | %define no_install_post_strip 1 | |
39 | ||
40 | %define target i386-mingw32 | |
41 | %define target_platform i386-pc-mingw32 | |
42 | ||
43 | %define _sysprefix /usr | |
44 | %define _prefix %{_sysprefix}/%{target} | |
45 | %define _libdir %{_prefix}/lib | |
46 | %define _pkgconfigdir %{_prefix}/lib/pkgconfig | |
47 | %define _dlldir /usr/share/wine/windows/system | |
b0fb6ff3 | 48 | %define __pkgconfig_provides %{nil} |
6b48c5a3 | 49 | %define __pkgconfig_requires %{nil} |
f9096f40 | 50 | # for meson 0.50+, keep __cc/__cxx as host compiler and pass %{target}-* in meson-cross.txt |
e1a8334a | 51 | |
e1a8334a JB |
52 | %ifnarch %{ix86} |
53 | # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc | |
54 | %define optflags -O2 | |
55 | %endif | |
aadfbf6f | 56 | # -z options are invalid for mingw linker, most of -f options are Linux-specific |
e1a8334a | 57 | %define filterout_ld -Wl,-z,.* |
aadfbf6f | 58 | %define filterout_c -f[-a-z0-9=]* |
e1a8334a JB |
59 | |
60 | %description | |
61 | gdk-pixbuf is an image loading and scaling library that can be | |
62 | extended by loadable modules for new image formats. | |
63 | ||
64 | This package contains the cross version for Win32. | |
65 | ||
66 | %description -l pl.UTF-8 | |
67 | gdk-pixbuf to biblioteka ładująca i skalująca obrazki, której | |
68 | funkcjonalność może być rozszerzana o obsługę nowych formatów poprzez | |
69 | ładowane moduły. | |
70 | ||
71 | Ten pakiet zawiera wersję skrośną dla Win32. | |
72 | ||
41796a38 JB |
73 | %package static |
74 | Summary: Static gdk-pixbuf library (cross MinGW32 version) | |
75 | Summary(pl.UTF-8): Statyczna biblioteka gdk-pixbuf (wersja skrośna MinGW32) | |
76 | Group: Development/Libraries | |
77 | Requires: %{name} = %{version}-%{release} | |
78 | ||
79 | %description static | |
80 | Static gdk-pixbuf library (cross MinGW32 version). | |
81 | ||
82 | %description static -l pl.UTF-8 | |
83 | Statyczna biblioteka gdk-pixbuf (wersja skrośna MinGW32). | |
84 | ||
e1a8334a JB |
85 | %package dll |
86 | Summary: DLL gdk-pixbuf libraries for Windows | |
87 | Summary(pl.UTF-8): Biblioteki DLL gdk-pixbuf dla Windows | |
88 | Group: Applications/Emulators | |
b58eb3c8 | 89 | Requires: crossmingw32-glib2-dll >= 2.56.0 |
e1a8334a JB |
90 | Requires: wine |
91 | Conflicts: crossmingw32-gtk+2-dll < 2.22.0 | |
92 | ||
93 | %description dll | |
94 | DLL gdk-pixbuf libraries for Windows. | |
95 | ||
96 | %description dll -l pl.UTF-8 | |
97 | Biblioteki DLL gdk-pixbuf dla Windows. | |
98 | ||
99 | %prep | |
100 | %setup -q -n gdk-pixbuf-%{version} | |
101 | ||
41796a38 JB |
102 | # disable loaders.cache generation |
103 | %{__sed} -i -e "/^loaders_cache/,/^loaders_dep/ d" gdk-pixbuf/meson.build | |
104 | # disable tests and thumbnailer (unwanted, generates files using built library/binary) | |
105 | %{__sed} -i -e "/^subdir('tests')/d" meson.build | |
106 | %{__sed} -i -e "/^subdir('thumbnailer')/d" meson.build | |
f71916cb JB |
107 | # disable unused gi-docgen subproject |
108 | %{__sed} -i -e '/fallback:.*gi-docgen/d' docs/meson.build | |
41796a38 JB |
109 | |
110 | cat > meson-cross.txt <<'EOF' | |
111 | [host_machine] | |
112 | system = 'windows' | |
113 | cpu_family = 'x86' | |
114 | cpu = 'i386' | |
115 | endian='little' | |
116 | [binaries] | |
f9096f40 | 117 | c = '%{target}-gcc' |
41796a38 JB |
118 | ar = '%{target}-ar' |
119 | windres = '%{target}-windres' | |
120 | pkgconfig = 'pkg-config' | |
121 | [properties] | |
122 | ; force gnu99 to disable __STRICT_ANSI__ and unblock fdopen() in mingw32 | |
123 | c_args = ['%(echo %{rpmcflags} | sed -e "s/ \+/ /g;s/ /', '/g")', '-std=gnu99'] | |
124 | EOF | |
cba6696c | 125 | |
e1a8334a JB |
126 | %build |
127 | export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig | |
41796a38 JB |
128 | %meson build \ |
129 | --cross-file meson-cross.txt \ | |
f71916cb | 130 | -Ddocs=false \ |
41796a38 | 131 | -Dinstalled_tests=false \ |
b58eb3c8 | 132 | -Dintrospection=disabled \ |
41796a38 | 133 | -Dman=false \ |
b58eb3c8 | 134 | %{?with_gdiplus:-Dnative_windows_loaders=true} |
41796a38 | 135 | |
b58eb3c8 | 136 | %ninja_build -C build |
e1a8334a JB |
137 | |
138 | %install | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
b58eb3c8 | 141 | %ninja_install -j1 -C build |
e1a8334a JB |
142 | |
143 | install -d $RPM_BUILD_ROOT%{_dlldir} | |
644e715c | 144 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir} |
e1a8334a JB |
145 | |
146 | %if 0%{!?debug:1} | |
147 | %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll \ | |
148 | $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/*.dll | |
149 | %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a | |
150 | %endif | |
151 | ||
152 | # shut up check-files | |
93526fea | 153 | %{__rm} $RPM_BUILD_ROOT%{_bindir}/*.exe |
41796a38 JB |
154 | %{__rm} -r $RPM_BUILD_ROOT%{_datadir}/locale |
155 | %{__rm} -r $RPM_BUILD_ROOT%{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/*.dll.a | |
e1a8334a JB |
156 | |
157 | %clean | |
158 | rm -rf $RPM_BUILD_ROOT | |
159 | ||
160 | %files | |
161 | %defattr(644,root,root,755) | |
162 | %{_libdir}/libgdk_pixbuf-2.0.dll.a | |
e1a8334a JB |
163 | %{_includedir}/gdk-pixbuf-2.0 |
164 | %{_pkgconfigdir}/gdk-pixbuf-2.0.pc | |
165 | ||
41796a38 JB |
166 | %files static |
167 | %defattr(644,root,root,755) | |
168 | %{_libdir}/libgdk_pixbuf-2.0.a | |
169 | ||
e1a8334a JB |
170 | %files dll |
171 | %defattr(644,root,root,755) | |
172 | %{_dlldir}/libgdk_pixbuf-2.0-*.dll | |
173 | %dir %{_libdir}/gdk-pixbuf-2.0 | |
174 | %dir %{_libdir}/gdk-pixbuf-2.0/%{abiver} | |
175 | %dir %{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders | |
176 | %{_libdir}/gdk-pixbuf-2.0/%{abiver}/loaders/libpixbufloader-*.dll |