BuildRequires: pkgconfig(libtdm)
BuildRequires: pkgconfig(zlib)
BuildRequires: pkgconfig(dlog)
+BuildRequires: pkgconfig(libsystemd)
BuildRequires: meson
BuildRequires: python3
BuildRequires: python3-mako
+BuildRequires: pkgconfig(ttrace)
%ifarch x86_64 %ix86
BuildRequires: pkgconfig(libdrm_intel) >= 2.4.24
%endif
ExclusiveArch:
%endif
+%define USE_VULKAN 0
+%define VULKAN_DRIVER broadcom
+
+%define USE_GBM 0
+
%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
%{?asan:/usr/bin/gcc-unforce-options}
mkdir build
meson --prefix %{_prefix} build/ \
+ -Dc_link_args="-lttrace" \
+ -Dcpp_link_args="-lttrace" \
-Dlibdir=%{_libdir} \
-Dgallium-va=false \
-Dgallium-vdpau=false \
-Dgallium-xvmc=false \
-Dglx=disabled \
-Ddri3=false \
+%if "%{USE_GBM}" == "1"
-Dgbm=true \
- -Dplatforms="tizen,wayland,drm" \
+%else
+ -Dgbm=false \
+%endif
+ -Dplatforms="tizen" \
%ifarch %ix86 x86_64
-Dgallium-drivers="i915,swrast" \
-Ddri-drivers="" \
-Dvulkan-drivers=""
%else
- -Dgallium-drivers="vc4,swrast"
+%if "%{USE_VULKAN}" == "1"
+ -Dvulkan-drivers="%{VULKAN_DRIVER}" \
+%endif
+ -Dgallium-drivers="vc4,v3d,kmsro,swrast"
%endif
+
ninja -C build/
%install
DESTDIR=%{buildroot} ninja -C build/ install
-mkdir -p %{buildroot}%{_libdir}/driver
-cp -a %{buildroot}%{_libdir}/libEGL* %{buildroot}%{_libdir}/driver
-cp -a %{buildroot}%{_libdir}/libGLES* %{buildroot}%{_libdir}/driver
+mkdir -p %{buildroot}%{_hal_libdir}/driver
-mkdir -p %{buildroot}/etc/udev/rules.d
-cp 99-GPU-Acceleration.rules %{buildroot}/etc/udev/rules.d
+cp -a %{buildroot}%{_libdir}/libEGL* %{buildroot}%{_hal_libdir}/driver/
+cp -a %{buildroot}%{_libdir}/libGLES* %{buildroot}%{_hal_libdir}/driver/
+cp -a %{buildroot}%{_libdir}/libglapi* %{buildroot}%{_hal_libdir}/
+mv %{buildroot}%{_libdir}/dri %{buildroot}%{_hal_libdir}/dri
+
+%if "%{USE_VULKAN}" == "1"
+mv %{buildroot}%{_libdir}/libvulkan_%{VULKAN_DRIVER}.so %{buildroot}%{_hal_libdir}/
+ln -sf %{_hal_libdir}/libvulkan_%{VULKAN_DRIVER}.so %{buildroot}%{_libdir}/libvulkan_%{VULKAN_DRIVER}.so
+%endif
+ln -sf %{_hal_libdir}/dri %{buildroot}%{_libdir}/dri
+ln -sf %{_hal_libdir}/libglapi.so.0.0.0 %{buildroot}%{_libdir}/libglapi.0.0.0
+
+mkdir -p %{buildroot}%{_udevrulesdir}
+cp 99-GPU-Acceleration.rules %{buildroot}%{_udevrulesdir}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%defattr(-,root,root)
%license COPYING
%{_libdir}/libglapi*
-%{_libdir}/driver/*
-%{_libdir}/dri/*
+%{_hal_libdir}/libglapi*
+%{_hal_libdir}/driver/*
+%{_hal_libdir}/dri/*
+%{_libdir}/dri
+%if "%{USE_GBM}" == "1"
%{_libdir}/libgbm*
-/etc/udev/rules.d/99-GPU-Acceleration.rules
+%endif
+%if "%{USE_VULKAN}" == "1"
+%{_hal_libdir}/libvulkan_%{VULKAN_DRIVER}.so
+%{_libdir}/libvulkan_%{VULKAN_DRIVER}.so
+/usr/share/vulkan/icd.d/*
+%endif
+%{_udevrulesdir}/99-GPU-Acceleration.rules