summaryrefslogtreecommitdiff
path: root/packaging/mesa.spec
blob: f1c3484e9b65df7e5efb3cf62d7cb2d676dff3d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
%define glamor 1
%bcond_with wayland

Name:           mesa
Version:        10.1.3
Release:        0
License:        MIT
Summary:        System for rendering interactive 3-D graphics
Url:            http://www.mesa3d.org
Group:          Graphics & UI Framework/Hardware Adaptation
Source:         MesaLib-%{version}.tar.bz2
Source2:        baselibs.conf
Source3:        README.updates
Source5:        drirc
Source6:        %{name}-rpmlintrc
Source1001:     mesa.manifest
BuildRequires:  autoconf >= 2.59
BuildRequires:  automake
BuildRequires:  bison
BuildRequires:  fdupes
BuildRequires:  flex
BuildRequires:  gcc-c++
BuildRequires:  gettext-tools
BuildRequires:  libtool
BuildRequires:  libxml2-python
BuildRequires:  llvm-devel
BuildRequires:  pkgconfig
BuildRequires:  python
BuildRequires:  pkgconfig(expat)
BuildRequires:  pkgconfig(libdrm) >= 2.4.24
%ifarch x86_64 %ix86
BuildRequires:  pkgconfig(libdrm_intel) >= 2.4.24
%endif
BuildRequires:  pkgconfig(libudev) > 150
%if %{with wayland}
BuildRequires:  pkgconfig(wayland-client)
BuildRequires:  pkgconfig(wayland-server)
%endif
Provides:       Mesa = %{version}

%description
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL.* To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc.(SGI). However, the author does not possess an
OpenGL license from SGI, and makes no claim that Mesa is in any way a
compatible replacement for OpenGL or associated with SGI. Those who
want a licensed implementation of OpenGL should contact a licensed
vendor.

Please do not refer to the library as MesaGL (for legal reasons). It's
just Mesa or The Mesa 3-D graphics library.

* OpenGL is a trademark of Silicon Graphics Incorporated.

%package devel
Summary:        Libraries, includes and more to develop Mesa applications
Requires:       mesa = %{version}
Requires:       mesa-libEGL-devel = %{version}
Requires:       mesa-libGLESv1_CM-devel = %{version}
Requires:       mesa-libGLESv2-devel = %{version}
Requires:       mesa-libglapi = %{version}
Requires:       libgbm-devel
%if %{with wayland}
Requires:       libwayland-egl
%endif

%description devel
Mesa is a 3-D graphics library with an API which is very similar to
that of OpenGL.* To the extent that Mesa utilizes the OpenGL command
syntax or state machine, it is being used with authorization from
Silicon Graphics, Inc.(SGI). However, the author does not possess an
OpenGL license from SGI, and makes no claim that Mesa is in any way a
compatible replacement for OpenGL or associated with SGI. Those who
want a licensed implementation of OpenGL should contact a licensed
vendor.

Please do not refer to the library as MesaGL (for legal reasons). It's
just Mesa or The Mesa 3-D graphics library.

* OpenGL is a trademark of Silicon Graphics Incorporated.

%package -n libwayland-egl
Summary:        Wayland EGL backend for Mesa

%description -n libwayland-egl
Wayland EGL backend for Mesa.

%package -n mesa-libEGL
# Kudos to Debian for the descriptions
Summary:        Free implementation of the EGL API

%description -n mesa-libEGL
This package contains the EGL native platform graphics interface
library. EGL provides a platform-agnostic mechanism for creating
rendering surfaces for use with other graphics libraries, such as
OpenGL|ES and OpenVG.

This package contains modules to interface with the existing system
GLX or DRI2 drivers to provide OpenGL via EGL. The Mesa main package
provides drivers to provide hardware-accelerated OpenGL|ES and OpenVG
support.

%package -n mesa-libEGL-devel
Summary:        Development files for the EGL API
Requires:       mesa-libEGL = %{version}
# Other requires taken care of by pkgconfig already

%description -n mesa-libEGL-devel
This package contains the development environment required for
compiling programs against EGL native platform graphics interface
library. EGL provides a platform-agnostic mechanism for creating
rendering surfaces for use with other graphics libraries, such as
OpenGL|ES and OpenVG.

This package provides the development environment for compiling
programs against the EGL library.

%package -n mesa-gallium-pipe
# Kudos to Debian for the descriptions
Summary:        Free implementation of Gallium-pipe API

%description -n mesa-gallium-pipe
Gallium

%package -n mesa-libGLESv1_CM
Summary:        Free implementation of the OpenGL|ES 1.x API

%description -n mesa-libGLESv1_CM
OpenGL|ES is a cross-platform API for full-function 2D and 3D
graphics on embedded systems - including consoles, phones, appliances
and vehicles. It contains a subset of OpenGL plus a number of
extensions for the special needs of embedded systems.

OpenGL|ES 1.x provides an API for fixed-function hardware.

%package -n mesa-libGLESv1_CM-devel
Summary:        Development files for the EGL API
Requires:       mesa-libGLESv1_CM = %{version}
Requires:       pkgconfig(egl)

%description -n mesa-libGLESv1_CM-devel
OpenGL|ES is a cross-platform API for full-function 2D and 3D
graphics on embedded systems - including consoles, phones, appliances
and vehicles. It contains a subset of OpenGL plus a number of
extensions for the special needs of embedded systems.

OpenGL|ES 1.x provides an API for fixed-function hardware.

This package provides a development environment for building programs
using the OpenGL|ES 1.x APIs.

%package -n mesa-libGLESv2
Summary:        Free implementation of the OpenGL|ES 2.x API

%description -n mesa-libGLESv2
OpenGL|ES is a cross-platform API for full-function 2D and 3D
graphics on embedded systems - including consoles, phones, appliances
and vehicles. It contains a subset of OpenGL plus a number of
extensions for the special needs of embedded systems.

OpenGL|ES 2.x provides an API for programmable hardware including
vertex and fragment shaders.

%package -n mesa-libGLESv2-devel
Summary:        Development files for the EGL API
Requires:       mesa-libGLESv2 = %{version}
Requires:       pkgconfig(egl)

%description -n mesa-libGLESv2-devel
OpenGL|ES is a cross-platform API for full-function 2D and 3D
graphics on embedded systems - including consoles, phones, appliances
and vehicles. It contains a subset of OpenGL plus a number of
extensions for the special needs of embedded systems.

OpenGL|ES 2.x provides an API for programmable hardware including
vertex and fragment shaders.

This package provides a development environment for building
applications using the OpenGL|ES 2.x APIs.

%package -n mesa-libGLESv3-devel
Summary:        Development files for the OpenGL ES 3.x API
Requires:       pkgconfig(egl)

%description -n mesa-libGLESv3-devel
OpenGL|ES is a cross-platform API for full-function 2D and 3D
graphics on embedded systems - including consoles, phones, appliances
and vehicles. It contains a subset of OpenGL plus a number of
extensions for the special needs of embedded systems.

This package provides a development environment for building
applications using the OpenGL|ES 3.x APIs.

%package -n libgbm
# as per gbm.pc
Version:        0.0.0
Release:        0
Summary:        Generic buffer management API

%description -n libgbm
This package contains the GBM buffer management library. It provides
a mechanism for allocating buffers for graphics rendering tied to
Mesa.

GBM is intended to be used as a native platform for EGL on drm or
openwfd.

%package -n libgbm-devel
Version:        0.0.0
Release:        0
Summary:        Development files for the EGL API
Requires:       libgbm = %{version}

%description -n libgbm-devel
This package contains the GBM buffer management library. It provides
a mechanism for allocating buffers for graphics rendering tied to
Mesa.

GBM is intended to be used as a native platform for EGL on drm or
openwfd.

This package provides the development environment for compiling
programs against the GBM library.

%package -n mesa-libglapi
Summary:        Free implementation of the GL API

%description -n mesa-libglapi
The Mesa GL API module is responsible for dispatching all the gl*
functions. It is intended to be mainly used by the Mesa-libGLES*
packages.

%prep
%setup -q
cp %{SOURCE1001} .

rm -rf docs/README.{VMS,WIN32,OS2}

%build

%install
rm -f src/mesa/depend
autoreconf -fi
%configure --enable-gles1 \
           --enable-gles2 \
           --disable-dri3 \
           --with-egl-platforms=drm,wayland \
           --disable-glx \
           --enable-shared-glapi \
           --disable-gallium-egl \
           --enable-texture-float \
%if %glamor
           --enable-gbm \
%endif
           --with-dri-searchpath=/usr/%{_lib}/dri/updates:/usr/%{_lib}/dri \
%ifarch %ix86 x86_64
           --enable-gallium-egl \
           --enable-gallium-llvm \
           --with-dri-drivers=i915,i965,swrast \
           --with-gallium-drivers="i915,svga,swrast" \
%endif
%ifarch %arm
           --with-dri-drivers=swrast \
           --with-gallium-drivers="" \
%endif
           CFLAGS="%{optflags} -DNDEBUG"
make %{?_smp_mflags}
%make_install

%if %{with wayland}
rm -rf %{buildroot}%{_includedir}/GL
rm -f %{buildroot}%{_libdir}/pkgconfig/gl.pc
%endif

# DRI driver update mechanism
mkdir -p %{buildroot}%{_libdir}/dri/updates
install -m 644 $RPM_SOURCE_DIR/README.updates \
  %{buildroot}%{_libdir}/dri/updates
# global drirc file
mkdir -p %{buildroot}/etc
install -m 644 $RPM_SOURCE_DIR/drirc %{buildroot}/etc


%post   -p /sbin/ldconfig

%postun -p /sbin/ldconfig

%post   -n libwayland-egl -p /sbin/ldconfig

%postun -n libwayland-egl -p /sbin/ldconfig

%post   -n mesa-libEGL -p /sbin/ldconfig

%postun -n mesa-libEGL -p /sbin/ldconfig

%post   -n mesa-gallium-pipe -p /sbin/ldconfig

%postun -n mesa-gallium-pipe -p /sbin/ldconfig

%post   -n mesa-libGLESv1_CM -p /sbin/ldconfig

%postun -n mesa-libGLESv1_CM -p /sbin/ldconfig

%post   -n mesa-libGLESv2 -p /sbin/ldconfig

%postun -n mesa-libGLESv2 -p /sbin/ldconfig

%post   -n libgbm -p /sbin/ldconfig

%postun -n libgbm -p /sbin/ldconfig

%post   -n mesa-libglapi -p /sbin/ldconfig

%postun -n mesa-libglapi -p /sbin/ldconfig

%files
%manifest %{name}.manifest
%defattr(-,root,root)
%license docs/COPYING
%config %{_sysconfdir}/drirc
%{_libdir}/dri/

%files -n mesa-libEGL
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libEGL.so.1*
%{_libdir}/egl/egl_gallium.so

%files -n mesa-libEGL-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/EGL
%{_includedir}/KHR
%{_libdir}/libEGL.so
%{_libdir}/pkgconfig/egl.pc

%files -n mesa-gallium-pipe
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/gallium-pipe/*

%files -n mesa-libGLESv1_CM
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libGLESv1_CM.so.1*

%files -n mesa-libGLESv1_CM-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/GLES
%{_libdir}/libGLESv1_CM.so
%{_libdir}/pkgconfig/glesv1_cm.pc

%files -n mesa-libGLESv2
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libGLESv2.so.2*

%files -n mesa-libGLESv2-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/GLES2
%{_libdir}/libGLESv2.so
%{_libdir}/pkgconfig/glesv2.pc

%files -n mesa-libGLESv3-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/GLES3

%if %{with wayland}

%files -n libwayland-egl
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libwayland-egl.so.1*

%endif

%files -n libgbm
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libgbm.so.1*
%{_libdir}/gbm/gbm_gallium_drm.so

%files -n libgbm-devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_includedir}/gbm.h
%{_libdir}/libgbm.so
%{_libdir}/pkgconfig/gbm.pc


%files -n mesa-libglapi
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libglapi.so.0*

%files devel
%manifest %{name}.manifest
%defattr(-,root,root)
%{_libdir}/libglapi.so
%if %{with wayland}
%{_libdir}/libwayland-egl.so
%{_libdir}/pkgconfig/wayland-egl.pc
%endif
%{_libdir}/pkgconfig/dri.pc

%changelog