Fixing build for GCC 4.9
[platform/upstream/cairo.git] / packaging / cairo.spec
1 %bcond_without cairo_xcb_backend 
2 %bcond_without cairo_gl_backend
3 %bcond_with wayland
4 %bcond_with x
5 %bcond_with desktop
6
7
8 Name:           cairo
9 Version:        1.12.16
10 Release:        0
11 License:        LGPL-2.1+ or MPL-1.1
12 Summary:        Vector Graphics Library with Cross-Device Output Support
13 Url:            http://cairographics.org/
14 Group:          Graphics/Libraries
15 Source:         http://cairographics.org/releases/%{name}-%{version}.tar.xz
16 Source99:       baselibs.conf
17 Source1001:     cairo.manifest
18 BuildRequires:  libtool
19 BuildRequires:  pkg-config
20 BuildRequires:  xz
21 BuildRequires:  pkgconfig(fontconfig)
22 BuildRequires:  pkgconfig(freetype2)
23 BuildRequires:  pkgconfig(gobject-2.0)
24 BuildRequires:  pkgconfig(libpng)
25 BuildRequires:  pkgconfig(pixman-1)
26 BuildRequires:  which
27 %if %{with cairo_gl_backend}
28 %if %{with x} && %{with desktop}
29 BuildRequires:  pkgconfig(gl)
30 %endif
31 BuildRequires:  pkgconfig(glesv2)
32 %if %{with wayland}
33 BuildRequires:  pkgconfig(wayland-egl)
34 %endif
35 %endif
36 %if %{with x}
37 BuildRequires:  pkgconfig(xext)
38 BuildRequires:  pkgconfig(x11)
39 BuildRequires:  pkgconfig(xrender)
40 %if %{with cairo_xcb_backend}
41 BuildRequires:  pkgconfig(xcb)
42 BuildRequires:  pkgconfig(xcb-shm)
43 %endif
44 %endif
45
46
47 %description
48 Cairo is a vector graphics library with cross-device output support.
49 Currently supported output targets include the X Window System,
50 in-memory image buffers, and PostScript. Cairo is designed to produce
51 identical output on all output media while taking advantage of display
52 hardware acceleration when available.
53
54 %package -n libcairo
55 License:        LGPL-2.1+ or MPL-1.1
56 Summary:        Vector Graphics Library with Cross-Device Output Support
57 Group:          Graphics/Libraries
58 Provides:       cairo = %{version}
59 Obsoletes:      cairo < %{version}
60
61 %description -n libcairo
62 Cairo is a vector graphics library with cross-device output support.
63 Currently supported output targets include the X Window System,
64 in-memory image buffers, and PostScript. Cairo is designed to produce
65 identical output on all output media while taking advantage of display
66 hardware acceleration when available.
67
68 %package -n libcairo-gobject
69 License:        LGPL-2.1+ or MPL-1.1
70 Summary:        Vector Graphics Library with Cross-Device Output Support
71 Group:          Graphics/Libraries
72
73 %description -n libcairo-gobject
74 Cairo is a vector graphics library with cross-device output support.
75 Currently supported output targets include the X Window System,
76 in-memory image buffers, and PostScript. Cairo is designed to produce
77 identical output on all output media while taking advantage of display
78 hardware acceleration when available.
79
80 This library contains GType declarations for Cairo types. It is also
81 meant to support gobject-introspection binding creation.
82
83 %package -n libcairo-script-interpreter
84 License:        LGPL-2.1+ or MPL-1.1
85 Summary:        Vector Graphics Library with Cross-Device Output Support
86 Group:          Graphics/Libraries
87
88 %description -n libcairo-script-interpreter
89 Cairo is a vector graphics library with cross-device output support.
90 Currently supported output targets include the X Window System,
91 in-memory image buffers, and PostScript. Cairo is designed to produce
92 identical output on all output media while taking advantage of display
93 hardware acceleration when available.
94
95 %package tools
96 License:        GPL-3.0+
97 Summary:        Vector Graphics Library with Cross-Device Output Support -- Utilities
98 Group:          Development/Libraries
99 # We need an explicit requires since nothing links to the cairo library
100 Requires:       libcairo = %{version}
101
102 %description tools
103 Cairo is a vector graphics library with cross-device output support.
104 Currently supported output targets include the X Window System,
105 in-memory image buffers, and PostScript. Cairo is designed to produce
106 identical output on all output media while taking advantage of display
107 hardware acceleration when available.
108
109 This package contains various cairo utilities.
110
111 %package devel
112 License:        LGPL-2.1+ or MPL-1.1
113 Summary:        Development environment for cairo
114 Group:          Development/Libraries
115 Requires:       libcairo = %{version}
116 Requires:       libcairo-gobject = %{version}
117 Requires:       libcairo-script-interpreter = %{version}
118
119 %description devel
120 This package contains all files necessary to build binaries using
121 cairo.
122
123 %prep
124 %setup -q
125 cp %{SOURCE1001} .
126
127 %build
128 # Disable Atom optimizations in order to make binaries executable in buildroot
129 export RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed s'/atom/i686/g'`
130 export CFLAGS=`echo $CFLAGS | sed s'/atom/i686/g'`
131 export CXXFLAGS=`echo $CXXFLAGS | sed s'/atom/i686/g'`
132
133 export CFLAGS+=" -ffat-lto-objects"
134 export CXXFLAGS+=" -ffat-lto-objects"
135
136 %ifarch aarch64
137 export CFLAGS="$CFLAGS -fno-lto"
138 export CXXFLAGS="$CXXFLAGS -fno-lto"
139 %endif
140
141 # Needed by patch0
142 NOCONFIGURE=1 ./autogen.sh
143 %configure \
144     --with-pic \
145     --enable-fc \
146     --enable-ft \
147 %if %{with cairo_gl_backend}
148     --enable-egl \
149     --enable-glesv2=yes \
150 %endif
151     --enable-ps \
152     --enable-pdf \
153     --enable-script \
154     --enable-svg \
155     --enable-tee \
156 %if %{with wayland} && !%{with x}
157    --disable-xlib \
158    --disable-xcb  \
159 %else
160     --enable-xlib \
161 %if %{with cairo_xcb_backend}
162     --enable-xcb \
163 %endif
164 %endif
165     --disable-gtk-doc \
166     --disable-static
167 make %{?_smp_mflags} V=1
168
169 %install
170 %make_install
171
172 %post -n libcairo -p /sbin/ldconfig
173
174 %postun -n libcairo -p /sbin/ldconfig
175
176 %post -n libcairo-gobject -p /sbin/ldconfig
177
178 %postun -n libcairo-gobject -p /sbin/ldconfig
179
180 %post -n libcairo-script-interpreter -p /sbin/ldconfig
181
182 %postun -n libcairo-script-interpreter -p /sbin/ldconfig
183
184 %files -n libcairo
185 %manifest %{name}.manifest
186 %defattr(-, root, root)
187 %license COPYING COPYING-LGPL-2.1 COPYING-MPL-1.1
188 %{_libdir}/libcairo.so.*
189
190 %files -n libcairo-gobject
191 %manifest %{name}.manifest
192 %defattr(-, root, root)
193 %{_libdir}/libcairo-gobject.so.2*
194
195 %files -n libcairo-script-interpreter
196 %manifest %{name}.manifest
197 %defattr(-, root, root)
198 %license util/cairo-script/COPYING
199 %{_libdir}/libcairo-script-interpreter.so.*
200
201 %files tools
202 %manifest %{name}.manifest
203 %defattr(-, root, root)
204 %license util/cairo-trace/COPYING util/cairo-trace/COPYING-GPL-3
205 %{_bindir}/cairo-sphinx
206 %{_bindir}/cairo-trace
207 %dir %{_libdir}/cairo
208 %{_libdir}/cairo/cairo-fdr.so
209 %{_libdir}/cairo/cairo-sphinx.so
210 %{_libdir}/cairo/libcairo-trace.so
211
212 %files devel
213 %manifest %{name}.manifest
214 %defattr(-, root, root)
215 %doc PORTING_GUIDE
216 %{_includedir}/cairo/
217 %doc %{_datadir}/gtk-doc/html/cairo
218 %{_libdir}/*.so
219 %{_libdir}/pkgconfig/*.pc
220
221 %changelog