Change install path to /hal/lib
[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
41 %description
42 Mesa is a 3-D graphics library with an API which is very similar to
43 that of OpenGL.* To the extent that Mesa utilizes the OpenGL command
44 syntax or state machine, it is being used with authorization from
45 Silicon Graphics, Inc.(SGI). However, the author does not possess an
46 OpenGL license from SGI, and makes no claim that Mesa is in any way a
47 compatible replacement for OpenGL or associated with SGI. Those who
48 want a licensed implementation of OpenGL should contact a licensed
49 vendor.
50
51 Please do not refer to the library as MesaGL (for legal reasons). It's
52 just Mesa or The Mesa 3-D graphics library.
53
54 * OpenGL is a trademark of Silicon Graphics Incorporated.
55
56 %prep
57 %setup -q -n %{name}-%{version}
58 cp %{SOURCE1001} .
59 cp %{SOURCE1002} .
60
61 %build
62 %{?asan:/usr/bin/gcc-unforce-options}
63 mkdir build
64 meson --prefix %{_prefix} build/ \
65                 -Dc_link_args="-lttrace" \
66                 -Dcpp_link_args="-lttrace" \
67                 -Dlibdir=%{_libdir} \
68                 -Dgallium-va=false \
69                 -Dgallium-vdpau=false \
70                 -Dgallium-xa=false \
71                 -Dgallium-xvmc=false \
72                 -Dglx=disabled \
73                 -Ddri3=false \
74                 -Dgbm=true \
75                 -Dplatforms="tizen,wayland,drm" \
76 %ifarch %ix86 x86_64
77                 -Dgallium-drivers="i915,swrast" \
78                 -Ddri-drivers="" \
79                 -Dvulkan-drivers=""
80 %else
81 %if "%{USE_VULKAN}" == "1"
82                 -Dvulkan-drivers="broadcom" \
83 %endif
84                 -Dgallium-drivers="vc4,v3d,kmsro,swrast"
85 %endif
86 ninja -C build/
87
88 %install
89 DESTDIR=%{buildroot} ninja -C build/ install
90 mkdir -p %{buildroot}%{_hal_libdir}/driver
91 mkdir -p %{buildroot}%{_hal_libdir}/dri
92
93 cp -a %{buildroot}%{_libdir}/libEGL* %{buildroot}%{_hal_libdir}/driver/
94 cp -a %{buildroot}%{_libdir}/libGLES* %{buildroot}%{_hal_libdir}/driver/
95 cp -a %{buildroot}%{_libdir}/dri/* %{buildroot}%{_hal_libdir}/dri/
96 cp -a %{buildroot}%{_libdir}/libglapi* %{buildroot}%{_hal_libdir}/
97
98 %if "%{USE_VULKAN}" == "1"
99 cp -a %{buildroot}%{_libdir}/libvulkan* %{buildroot}%{_hal_libdir}/
100 %endif
101 ln -sf %{_hal_libdir}/dri %{buildroot}%{_libdir}/dri
102 ln -sf %{_hal_libdri}/libglapi.so.0.0.0 %{buildroot}%{_libdir}/libglapi.0.0.0
103
104 mkdir -p %{buildroot}%{_udevrulesdir}
105 cp 99-GPU-Acceleration.rules %{buildroot}%{_udevrulesdir}
106
107 %post -p /sbin/ldconfig
108 %postun -p /sbin/ldconfig
109
110 %files
111 %define _unpackaged_files_terminate_build 0
112 %manifest %{name}.manifest
113 %defattr(-,root,root)
114 %license COPYING
115 %{_libdir}/libglapi*
116 %{_hal_libdir}/libglapi*
117 %{_hal_libdir}/driver/*
118 %{_hal_libdir}/dri/*
119 %{_libdir}/dri
120 %{_libdir}/libgbm*
121 %if "%{USE_VULKAN}" == "1"
122 %{_hal_libdir}/libvulkan*
123 /usr/share/vulkan/icd.d/*
124 %endif
125 %{_udevrulesdir}/99-GPU-Acceleration.rules