]>
Commit | Line | Data |
---|---|---|
a2982962 | 1 | # TODO: dwrite=enabled (BR: libd2d1, libdwrite, d2d1.h, dwrite.h |
75ae79e7 JB |
2 | Summary: Cairo - multi-platform 2D graphics library - cross MinGW32 version |
3 | Summary(pl.UTF-8): Cairo - wieloplatformowa biblioteka graficzna 2D - skrośna wersja MinGW32 | |
8401d423 JB |
4 | %define realname cairo |
5 | Name: crossmingw32-%{realname} | |
a2982962 JB |
6 | Version: 1.18.0 |
7 | Release: 1 | |
87d9b0f9 | 8 | License: LGPL v2.1 or MPL v1.1 |
ed706dfc | 9 | Group: Development/Libraries |
23041acc | 10 | Source0: https://www.cairographics.org/releases/%{realname}-%{version}.tar.xz |
a2982962 JB |
11 | # Source0-md5: 3f0685fbadc530606f965b9645bb51d9 |
12 | Patch0: cairo-mingw32.patch | |
23041acc | 13 | URL: https://www.cairographics.org/ |
75ae79e7 | 14 | BuildRequires: crossmingw32-fontconfig >= 2.2.95 |
a2982962 | 15 | BuildRequires: crossmingw32-freetype >= 2.13.0 |
2414ec55 | 16 | BuildRequires: crossmingw32-glib2 >= 2.14 |
a2982962 JB |
17 | BuildRequires: crossmingw32-libpng >= 1.4.0 |
18 | BuildRequires: crossmingw32-pixman >= 0.36.0 | |
c00b5b7c | 19 | BuildRequires: crossmingw32-zlib |
a2982962 JB |
20 | BuildRequires: meson >= 0.59.0 |
21 | BuildRequires: ninja >= 1.5 | |
2414ec55 | 22 | BuildRequires: pkgconfig >= 1:0.18 |
75ae79e7 | 23 | Requires: crossmingw32-fontconfig >= 2.2.95 |
a2982962 JB |
24 | Requires: crossmingw32-freetype >= 2.13.0 |
25 | Requires: crossmingw32-libpng >= 1.4.0 | |
26 | Requires: crossmingw32-pixman >= 0.36.0 | |
c00b5b7c | 27 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) |
28 | ||
29 | %define no_install_post_strip 1 | |
61f6da5c | 30 | %define _enable_debug_packages 0 |
c00b5b7c | 31 | |
32 | %define target i386-mingw32 | |
33 | %define target_platform i386-pc-mingw32 | |
c00b5b7c | 34 | |
35 | %define _sysprefix /usr | |
36 | %define _prefix %{_sysprefix}/%{target} | |
ab6df3fd | 37 | %define _libdir %{_prefix}/lib |
c00b5b7c | 38 | %define _pkgconfigdir %{_prefix}/lib/pkgconfig |
ed706dfc | 39 | %define _dlldir /usr/share/wine/windows/system |
c00b5b7c | 40 | %define __cc %{target}-gcc |
41 | %define __cxx %{target}-g++ | |
1e3558d6 | 42 | %define __pkgconfig_provides %{nil} |
d932e68c | 43 | %define __pkgconfig_requires %{nil} |
c00b5b7c | 44 | |
87d9b0f9 JB |
45 | %ifnarch %{ix86} |
46 | # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc | |
47 | %define optflags -O2 | |
48 | %endif | |
45f76160 | 49 | # -z options are invalid for mingw linker, most of -f options are Linux-specific |
c38236d6 | 50 | # note: although C++ code is not used, failing configure check disables DLL building |
87d9b0f9 | 51 | %define filterout_ld -Wl,-z,.* |
45f76160 | 52 | %define filterout_c -f[-a-z0-9=]* |
681bdb00 | 53 | %define filterout_cxx -f[-a-z0-9=]* |
87d9b0f9 | 54 | |
c00b5b7c | 55 | %description |
56 | Cairo provides anti-aliased vector-based rendering for X. Paths | |
57 | consist of line segments and cubic splines and can be rendered at any | |
58 | width with various join and cap styles. All colors may be specified | |
59 | with optional translucence (opacity/alpha) and combined using the | |
60 | extended Porter/Duff compositing algebra as found in the X Render | |
61 | Extension. | |
62 | ||
63 | Cairo exports a stateful rendering API similar in spirit to the path | |
64 | construction, text, and painting operators of PostScript, (with the | |
65 | significant addition of translucence in the imaging model). When | |
66 | complete, the API is intended to support the complete imaging model of | |
67 | PDF 1.4. | |
68 | ||
ed706dfc JB |
69 | This package contains the cross version for Win32. |
70 | ||
71 | %description -l pl.UTF-8 | |
72 | Cairo obsługuje oparty na wektorach rendering z antyaliasingiem dla X. | |
73 | Ścieżki składają się z odcinków i splajnów kubicznych, a renderowane | |
74 | mogą być z dowolną grubością i różnymi stylami połączeń i zakończeń. | |
75 | Wszystkie kolory mogą być podane z opcjonalną półprzezroczystością | |
76 | (podaną przez współczynnik nieprzezroczystości lub alpha) i łączone | |
53e09db9 | 77 | przy użyciu rozszerzonego algorytmu składania Portera-Duffa, który |
ed706dfc JB |
78 | można znaleźć w rozszerzeniu X Render. |
79 | ||
80 | Cairo eksportuje stanowe API renderujące w duchu podobne do operatorów | |
81 | konstruowania ścieżek, tekstu i rysowania z PostScriptu (ze znacznym | |
82 | dodatkiem półprzezroczystości w modelu obrazu). Kiedy API zostanie | |
83 | ukończone, ma obsługiwać pełny model obrazu z PDF w wersji 1.4. | |
84 | ||
85 | Ten pakiet zawiera wersję skrośną dla Win32. | |
86 | ||
87 | %package static | |
75ae79e7 JB |
88 | Summary: Static Cairo library (cross MinGW32 version) |
89 | Summary(pl.UTF-8): Statyczna biblioteka Cairo (wersja skrośna MinGW32) | |
ed706dfc JB |
90 | Group: Development/Libraries |
91 | Requires: %{name} = %{version}-%{release} | |
92 | ||
93 | %description static | |
75ae79e7 | 94 | Static Cairo library (cross MinGW32 version). |
ed706dfc JB |
95 | |
96 | %description static -l pl.UTF-8 | |
75ae79e7 | 97 | Statyczna biblioteka Cairo (wersja skrośna MinGW32). |
ed706dfc JB |
98 | |
99 | %package dll | |
53e09db9 JB |
100 | Summary: DLL Cairo library for Windows |
101 | Summary(pl.UTF-8): Biblioteka DLL Cairo dla Windows | |
ed706dfc | 102 | Group: Applications/Emulators |
75ae79e7 | 103 | Requires: crossmingw32-fontconfig-dll >= 2.2.95 |
a2982962 JB |
104 | Requires: crossmingw32-freetype-dll >= 2.13.0 |
105 | Requires: crossmingw32-libpng-dll >= 1.4.0 | |
106 | Requires: crossmingw32-pixman-dll >= 0.36.0 | |
ed706dfc JB |
107 | |
108 | %description dll | |
53e09db9 | 109 | DLL Cairo library for Windows. |
ed706dfc JB |
110 | |
111 | %description dll -l pl.UTF-8 | |
53e09db9 | 112 | Biblioteka DLL Cairo dla Windows. |
c00b5b7c | 113 | |
75ae79e7 JB |
114 | %package gobject |
115 | Summary: Cairo GObject functions library - cross MinGW32 version | |
116 | Summary(pl.UTF-8): Biblioteka funkcji Cairo GObject - wersja skrośna MinGW32 | |
117 | Group: Development/Libraries | |
118 | Requires: %{name} = %{version}-%{release} | |
2414ec55 | 119 | Requires: crossmingw32-glib2 >= 2.14 |
75ae79e7 JB |
120 | |
121 | %description gobject | |
122 | Cairo GObject functions library - cross MinGW32 version. | |
123 | ||
124 | %description gobject -l pl.UTF-8 | |
125 | Biblioteka funkcji Cairo GObject - wersja skrośna MinGW32. | |
126 | ||
127 | %package gobject-static | |
128 | Summary: Static Cairo GObject library (cross MinGW32 version) | |
129 | Summary(pl.UTF-8): Statyczna biblioteka Cairo GObject (wersja skrośna MinGW32) | |
130 | Group: Development/Libraries | |
131 | Requires: %{name}-gobject = %{version}-%{release} | |
132 | ||
133 | %description gobject-static | |
134 | Static Cairo GObject library (cross MinGW32 version). | |
135 | ||
136 | %description gobject-static -l pl.UTF-8 | |
137 | Statyczna biblioteka Cairo GObject (wersja skrośna MinGW32). | |
138 | ||
139 | %package gobject-dll | |
140 | Summary: DLL Cairo GObject library for Windows | |
141 | Summary(pl.UTF-8): Biblioteka DLL Cairo GObject dla Windows | |
142 | Group: Applications/Emulators | |
143 | Requires: %{name}-dll = %{version}-%{release} | |
2414ec55 | 144 | Requires: crossmingw32-glib2-dll >= 2.14 |
75ae79e7 JB |
145 | |
146 | %description gobject-dll | |
147 | DLL Cairo GObject library for Windows. | |
148 | ||
149 | %description gobject-dll -l pl.UTF-8 | |
150 | Biblioteka DLL Cairo GObject dla Windows. | |
151 | ||
c00b5b7c | 152 | %prep |
8401d423 | 153 | %setup -q -n %{realname}-%{version} |
53e09db9 | 154 | %patch0 -p1 |
a2982962 JB |
155 | |
156 | cat > meson-cross.txt <<'EOF' | |
157 | [host_machine] | |
158 | system = 'windows' | |
159 | cpu_family = 'x86' | |
160 | cpu = 'i386' | |
161 | endian='little' | |
162 | [binaries] | |
163 | c = '%{target}-gcc' | |
164 | cpp = '%{target}-g++' | |
165 | ar = '%{target}-ar' | |
166 | windres = '%{target}-windres' | |
167 | pkgconfig = 'pkg-config' | |
168 | [built-in options] | |
169 | %ifarch %{ix86} | |
170 | c_args = ['%(echo %{rpmcflags} | sed -e "s/ \+/ /g;s/ /', '/g")'] | |
171 | %else | |
172 | # arch-specific flags (like alpha's -mieee) are not valid for i386 gcc. | |
173 | c_args = ['-O2'] | |
174 | %endif | |
175 | EOF | |
c00b5b7c | 176 | |
177 | %build | |
36f07f62 | 178 | export PKG_CONFIG_LIBDIR=%{_prefix}/lib/pkgconfig |
a2982962 JB |
179 | %meson build \ |
180 | --cross-file meson-cross.txt \ | |
181 | -Ddwrite=disabled \ | |
182 | -Dfontconfig=enabled \ | |
183 | -Dfreetype=enabled \ | |
184 | -Dpng=enabled \ | |
185 | -Dspectre=disabled \ | |
186 | -Dtee=enabled \ | |
187 | -Dtests=disabled \ | |
188 | -Dxcb=disabled \ | |
189 | -Dxlib=disabled \ | |
190 | -Dzlib=enabled | |
191 | ||
192 | %ninja_build -C build | |
c00b5b7c | 193 | |
194 | %install | |
195 | rm -rf $RPM_BUILD_ROOT | |
196 | ||
a2982962 | 197 | %ninja_install -C build |
c00b5b7c | 198 | |
ed706dfc | 199 | install -d $RPM_BUILD_ROOT%{_dlldir} |
29c37ddb JB |
200 | %{__mv} $RPM_BUILD_ROOT%{_prefix}/bin/*.dll $RPM_BUILD_ROOT%{_dlldir} |
201 | ||
ed706dfc JB |
202 | %if 0%{!?debug:1} |
203 | %{target}-strip --strip-unneeded -R.comment -R.note $RPM_BUILD_ROOT%{_dlldir}/*.dll | |
204 | %{target}-strip -g -R.comment -R.note $RPM_BUILD_ROOT%{_libdir}/*.a | |
205 | %endif | |
206 | ||
207 | rm -rf $RPM_BUILD_ROOT%{_datadir}/gtk-doc | |
208 | ||
c00b5b7c | 209 | %clean |
210 | rm -rf $RPM_BUILD_ROOT | |
211 | ||
212 | %files | |
213 | %defattr(644,root,root,755) | |
214 | # COPYING contains only notes, not LGPL/MPL texts | |
a2982962 | 215 | %doc AUTHORS COPYING NEWS README.md |
ed706dfc | 216 | %{_libdir}/libcairo.dll.a |
75ae79e7 | 217 | %{_libdir}/libcairo-script-interpreter.dll.a |
ed706dfc | 218 | %{_includedir}/cairo |
75ae79e7 | 219 | %exclude %{_includedir}/cairo/cairo-gobject.h |
6da4c596 | 220 | %{_pkgconfigdir}/cairo.pc |
75ae79e7 | 221 | %{_pkgconfigdir}/cairo-fc.pc |
6da4c596 JB |
222 | %{_pkgconfigdir}/cairo-ft.pc |
223 | %{_pkgconfigdir}/cairo-pdf.pc | |
224 | %{_pkgconfigdir}/cairo-png.pc | |
225 | %{_pkgconfigdir}/cairo-ps.pc | |
ead09fb0 | 226 | %{_pkgconfigdir}/cairo-script.pc |
a2982962 | 227 | %{_pkgconfigdir}/cairo-script-interpreter.pc |
6da4c596 | 228 | %{_pkgconfigdir}/cairo-svg.pc |
d8d1430b | 229 | %{_pkgconfigdir}/cairo-tee.pc |
6da4c596 | 230 | %{_pkgconfigdir}/cairo-win32.pc |
53e09db9 | 231 | %{_pkgconfigdir}/cairo-win32-font.pc |
ed706dfc JB |
232 | |
233 | %files static | |
234 | %defattr(644,root,root,755) | |
235 | %{_libdir}/libcairo.a | |
75ae79e7 | 236 | %{_libdir}/libcairo-script-interpreter.a |
ed706dfc JB |
237 | |
238 | %files dll | |
239 | %defattr(644,root,root,755) | |
75ae79e7 JB |
240 | %{_dlldir}/libcairo-2.dll |
241 | %{_dlldir}/libcairo-script-interpreter-2.dll | |
242 | ||
243 | %files gobject | |
244 | %defattr(644,root,root,755) | |
245 | %{_libdir}/libcairo-gobject.dll.a | |
75ae79e7 JB |
246 | %{_includedir}/cairo/cairo-gobject.h |
247 | %{_pkgconfigdir}/cairo-gobject.pc | |
248 | ||
249 | %files gobject-static | |
250 | %defattr(644,root,root,755) | |
251 | %{_libdir}/libcairo-gobject.a | |
252 | ||
253 | %files gobject-dll | |
254 | %defattr(644,root,root,755) | |
255 | %{_dlldir}/libcairo-gobject-2.dll |