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