Change the build prefix to /hal/
[platform/upstream/mesa.git] / packaging / mesa.spec
1 Name:           mesa
2 Version:        19.3.0
3 Release:        0
4 License:        MIT and Apache-2.0 and SGI Free Software License B v2.0 and BSD-3-Clause
5 Summary:        System for rendering interactive 3-D graphics
6 Url:            http://www.mesa3d.org
7 Group:          Graphics & UI Framework/Hardware Adaptation
8 Source:         %{name}-%{version}.tar.gz
9 Source1001:     %{name}.manifest
10 Source1002:     99-GPU-Acceleration.rules
11
12 BuildRequires:  bison
13 BuildRequires:  flex
14 BuildRequires:  pkgconfig
15 BuildRequires:  pkgconfig(expat)
16 BuildRequires:  pkgconfig(libdrm) >= 2.4.75
17 BuildRequires:  pkgconfig(libudev) > 150
18 BuildRequires:  pkgconfig(wayland-client)
19 BuildRequires:  pkgconfig(wayland-server)
20 BuildRequires:  pkgconfig(wayland-protocols)
21 BuildRequires:  pkgconfig(tpl-egl)
22 BuildRequires:  pkgconfig(libtbm)
23 BuildRequires:  pkgconfig(libtdm)
24 BuildRequires:  pkgconfig(zlib)
25 BuildRequires:  pkgconfig(dlog)
26 BuildRequires:  pkgconfig(libsystemd)
27 BuildRequires:  meson
28 BuildRequires:  python3
29 BuildRequires:  python3-mako
30 BuildRequires:  pkgconfig(ttrace)
31 %ifarch x86_64 %ix86
32 BuildRequires:  pkgconfig(libdrm_intel) >= 2.4.24
33 %endif
34
35 %if "%{_with_emulator}" == "1"
36 ExclusiveArch:
37 %endif
38
39 %define USE_VULKAN 0
40 %define VULKAN_DRIVER broadcom
41
42 %define USE_GBM 0
43
44 %description
45 Mesa is a 3-D graphics library with an API which is very similar to
46 that of OpenGL.* To the extent that Mesa utilizes the OpenGL command
47 syntax or state machine, it is being used with authorization from
48 Silicon Graphics, Inc.(SGI). However, the author does not possess an
49 OpenGL license from SGI, and makes no claim that Mesa is in any way a
50 compatible replacement for OpenGL or associated with SGI. Those who
51 want a licensed implementation of OpenGL should contact a licensed
52 vendor.
53
54 Please do not refer to the library as MesaGL (for legal reasons). It's
55 just Mesa or The Mesa 3-D graphics library.
56
57 * OpenGL is a trademark of Silicon Graphics Incorporated.
58
59 %prep
60 %setup -q -n %{name}-%{version}
61 cp %{SOURCE1001} .
62 cp %{SOURCE1002} .
63
64 %build
65 %{?asan:/usr/bin/gcc-unforce-options}
66 mkdir build
67
68 meson --prefix %{_hal_prefix} build/ \
69                 -Dc_link_args="-lttrace" \
70                 -Dcpp_link_args="-lttrace" \
71                 -Dlibdir=%{_hal_libdir} \
72                 -Dgallium-va=false \
73                 -Dgallium-vdpau=false \
74                 -Dgallium-xa=false \
75                 -Dgallium-xvmc=false \
76                 -Dglx=disabled \
77                 -Ddri3=false \
78 %if "%{USE_GBM}" == "1"
79                 -Dgbm=true \
80 %else
81                 -Dgbm=false \
82 %endif
83                 -Dplatforms="tizen" \
84 %ifarch %ix86 x86_64
85                 -Dgallium-drivers="i915,swrast" \
86                 -Ddri-drivers="" \
87                 -Dvulkan-drivers=""
88 %else
89 %if "%{USE_VULKAN}" == "1"
90                 -Dvulkan-drivers="%{VULKAN_DRIVER}" \
91 %endif
92                 -Dgallium-drivers="vc4,v3d,kmsro,swrast"
93 %endif
94
95 ninja -C build/
96
97 %install
98 DESTDIR=%{buildroot} ninja -C build/ install
99 mkdir -p %{buildroot}%{_hal_libdir}/driver
100 mkdir -p %{buildroot}%{_hal_libdir}/dri
101 mkdir -p %{buildroot}%{_hal_prefix}/share/vulkan/icd.d
102
103 cp -a %{buildroot}%{_hal_libdir}/libEGL* %{buildroot}%{_hal_libdir}/driver/
104 cp -a %{buildroot}%{_hal_libdir}/libGLES* %{buildroot}%{_hal_libdir}/driver/
105
106 mkdir -p %{buildroot}%{_hal_libdir}/udev/rules.d
107 cp 99-GPU-Acceleration.rules %{buildroot}%{_hal_libdir}/udev/rules.d
108
109 mkdir -p %{buildroot}%{_hal_prefix}/share/licenses/%{name}
110 cp COPYING %{buildroot}%{_hal_prefix}/share/licenses/%{name}/
111
112 %post -p /sbin/ldconfig
113 %postun -p /sbin/ldconfig
114
115 %files
116 %define _unpackaged_files_terminate_build 0
117 %manifest %{name}.manifest
118 %defattr(-,root,root)
119 %{_hal_prefix}/share/licenses/%{name}/COPYING
120 %{_hal_libdir}/libglapi*
121 %{_hal_libdir}/driver/*
122 %{_hal_libdir}/dri/v3d_dri.so
123 %{_hal_libdir}/dri/vc4_dri.so
124 %if "%{USE_GBM}" == "1"
125 %{_hal_libdir}/libgbm*
126 %endif
127 %if "%{USE_VULKAN}" == "1"
128 %{_hal_libdir}/libvulkan_%{VULKAN_DRIVER}.so
129 %{_hal_prefix}/share/vulkan/icd.d/*
130 %endif
131 %{_hal_libdir}/udev/rules.d/99-GPU-Acceleration.rules