%define bootstrap 0 %{?_without_bootstrap: %global bootstrap 0} %{?_with_bootstrap: %global bootstrap 1} %if 0%{?!valgrind_arches:1} %define valgrind_arches %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl %endif # The naming scheme in non-Mandriva-based distros %if 0%{!?mklibname:1} %define mklibname(ds) lib%{1}%{?2:%{2}}%{-s:-static}%{-d:-devel} %endif %define major 2 %define libname %mklibname drm %{major} %define develname %mklibname drm -d %define intel_major 1 %define libintel %mklibname drm_intel %{intel_major} %define nouveau_major 2 %define libnouveau %mklibname drm_nouveau %{nouveau_major} %define radeon_major 1 %define libradeon %mklibname drm_radeon %{radeon_major} %define tegra_major 0 %define libtegra %mklibname drm_tegra %{tegra_major} %define omap_major 1 %define libomap %mklibname drm_omap %{omap_major} %define etnaviv_major 1 %define libetnaviv %mklibname drm_etnaviv %{etnaviv_major} %define exynos_major 1 %define libexynos %mklibname drm_exynos %{exynos_major} %define freedreno_major 1 %define libfreedreno %mklibname drm_freedreno %{freedreno_major} %define amdgpu_major 1 %define libamdgpu %mklibname drm_amdgpu %{amdgpu_major} %define bcond_meson() %{lua: do local option = rpm.expand("%{1}") local with = rpm.expand("%{?with_" .. option .. "}") local value = (with ~= '') and "enabled" or "disabled" option = option:gsub('_', '-') print(string.format("-D%s=%s", option, value)) end} %define bcond_meson_bool() %{lua: do local option = rpm.expand("%{1}") local with = rpm.expand("%{?with_" .. option .. "}") local value = (with ~= '') and "true" or "false" option = option:gsub('_', '-') print(string.format("-D%s=%s", option, value)) end} %ifarch %{ix86} x86_64 %bcond_without intel %else %bcond_with intel %endif %bcond_without radeon %bcond_without amdgpu %bcond_without nouveau %bcond_without vmwgfx %ifarch %{arm} %bcond_without omap %else %bcond_with omap %endif %ifarch %{arm} aarch64 %bcond_without exynos %bcond_without freedreno %bcond_without tegra %bcond_without vc4 %bcond_without etnaviv %else %bcond_with exynos %bcond_with freedreno %bcond_with tegra %bcond_with vc4 %bcond_with etnaviv %endif %bcond_with cairo_tests %bcond_without man_pages %ifarch %{valgrind_arches} %bcond_without valgrind %else %bcond_with valgrind %endif %bcond_with freedreno_kgsl %bcond_without install_test_programs %bcond_without udev Name: libdrm Summary: Direct Rendering Manager runtime library Version: 2.4.123 Release: 1%{?dist} License: MIT Group: System/Libraries URL: https://dri.freedesktop.org/libdrm/ Source0: https://dri.freedesktop.org/libdrm/libdrm-%{version}.tar.xz Source2: 91-drm-modeset.rules BuildRequires: meson >= 0.43 BuildRequires: pkgconfig BuildRequires: automake BuildRequires: autoconf BuildRequires: libtool BuildRequires: kernel-userspace-headers >= 3.3.1-1 BuildRequires: libpthread-stubs BuildRequires: x11-util-macros >= 1.0.1 %if !%bootstrap BuildRequires: pkgconfig(libsystemd) %endif BuildRequires: pkgconfig(pciaccess) BuildRequires: pkgconfig(cairo) BuildRequires: xsltproc BuildRequires: docbook-xsl %if %{with valgrind} BuildRequires: pkgconfig(valgrind) %endif BuildRequires: pkgconfig(cunit) BuildRequires: pkgconfig(udev) BuildRequires: python3-docutils # force new gcc %if 0%{?mageia} >= 9 BuildRequires: gcc >= 12.1.0 BuildRequires: binutils >= 1:2.38-4 %else BuildRequires: gcc, binutils %endif # Upstream fixes # Fedora patches: # hardcode the 666 instead of 660 for device nodes #Patch1001: libdrm-make-dri-perms-okay.patch # remove backwards compat not needed on Fedora #Patch1002: libdrm-2.4.69-no-bc.patch #Patch0500: 0500-improve-waiting-for-dri-device-to-appear-when-system.patch %description Direct Rendering Manager runtime library %package common Summary: Common files for the userspace interface to kernel DRM services Group: System/Libraries %description common Common files for the userspace interface to kernel DRM services %package -n %{libname} Summary: Userspace interface to kernel DRM services Group: System/Libraries Provides: %{name} = %{version} Requires: %{name}-common %description -n %{libname} Userspace interface to kernel DRM services %ifarch %{ix86} x86_64 %package -n %{libintel} Summary: Shared library for Intel kernel DRM services Group: System/Libraries Conflicts: %{mklibname drm 2} < 2.4.5-2 %description -n %{libintel} Shared library for Intel kernel Direct Rendering Manager services. %endif %package -n %{libnouveau} Summary: Shared library for Nouveau kernel DRM services Group: System/Libraries %description -n %{libnouveau} Shared library for Nouveau kernel Direct Rendering Manager services. %package -n %{libradeon} Summary: Shared library for Radeon kernel DRM services Group: System/Libraries Conflicts: %{mklibname drm 2} < 2.4.5-2 %description -n %{libradeon} Shared library for Radeon kernel Direct Rendering Manager services. %ifarch %arm %package -n %{libomap} Summary: Shared library for OMAP kernel DRM services Group: System/Libraries Conflicts: %{mklibname drm 2} < 2.4.5-2 %description -n %{libomap} Shared library for OMAP kernel Direct Rendering Manager services. %endif %ifarch %arm aarch64 %package -n %{libtegra} Summary: Shared library for TEGRA kernel DRM services Group: System/Libraries %description -n %{libtegra} Shared library for TEGRA kernel Direct Rendering Manager services. %package -n %{libetnaviv} Summary: Shared library for Etnaviv kernel DRM services Group: System/Libraries %description -n %{libetnaviv} Shared library for Etnaviv kernel Direct Rendering Manager services. %package -n %{libexynos} Summary: Shared library for Exynos kernel DRM services Group: System/Libraries Conflicts: %{mklibname drm 2} < 2.4.5-2 %description -n %{libexynos} Shared library for EXYNOS kernel Direct Rendering Manager services. %package -n %{libfreedreno} Summary: Shared library for Freedreno kernel DRM services Group: System/Libraries %description -n %{libfreedreno} Shared library for Freedreno kernel Direct Rendering Manager services. %endif %package -n %{libamdgpu} Summary: Shared library for AMDGPU kernel DRM services Group: System/Libraries %description -n %{libamdgpu} Shared library for AMDGPU kernel Direct Rendering Manager services. %package -n %{develname} Summary: Direct Rendering Manager development package Group: Development/X11 Requires: %{libname} = %{version} %ifarch %{ix86} x86_64 Requires: %{libintel} = %{version} %endif Requires: %{libnouveau} = %{version} Requires: %{libradeon} = %{version} Requires: %{libamdgpu} = %{version} %ifarch %arm Requires: %{libomap} = %{version} %endif %ifarch %arm aarch64 Requires: %{libtegra} = %{version} Requires: %{libexynos} = %{version} Requires: %{libfreedreno} = %{version} Requires: %{libetnaviv} = %{version} %endif Provides: %{name}-devel = %{version}-%{release} Obsoletes: drm-nouveau-devel < 2.3.0-2.20090111.2 %description -n %{develname} Direct Rendering Manager development package. %package -n drm-utils Summary: Direct Rendering Manager utilities Group: System/Base Requires: %{libname}%{?_isa} = %{version}-%{release} %description -n drm-utils Utility programs for the kernel DRM interface. Will void your warranty. %prep %autosetup -p1 %build %meson \ -Dman-pages=disabled \ %{bcond_meson intel} \ %{bcond_meson radeon} \ %{bcond_meson amdgpu} \ %{bcond_meson nouveau} \ %{bcond_meson vmwgfx} \ %{bcond_meson omap} \ %{bcond_meson exynos} \ %{bcond_meson freedreno} \ %{bcond_meson tegra} \ %{bcond_meson vc4} \ %{bcond_meson etnaviv} \ %{bcond_meson cairo_tests} \ %{bcond_meson valgrind} \ %{bcond_meson_bool freedreno_kgsl} \ %{bcond_meson_bool install_test_programs} \ %{bcond_meson_bool udev} \ %{nil} %meson_build %install %meson_install install -Dpm0755 -t %{buildroot}%{_bindir} %{_vpath_builddir}/tests/drmdevice # NOTE: We intentionally don't ship *.la files find %{buildroot} -type f -name "*.la" -delete # (cg) Note that RH remove r300_reg.h via_3d_reg.h # and we should perhaps do the same? (previous attempts have not gone well :) %files common %{_datadir}/libdrm/amdgpu.ids %files -n %{libname} %{_libdir}/libdrm.so.%{major}{,.*} %ifarch %{ix86} x86_64 %files -n %{libintel} %{_libdir}/libdrm_intel.so.%{intel_major}{,.*} %endif %files -n %{libnouveau} %{_libdir}/libdrm_nouveau.so.%{nouveau_major}{,.*} %files -n %{libamdgpu} %{_libdir}/libdrm_amdgpu.so.%{amdgpu_major}{,.*} %files -n %{libradeon} %{_libdir}/libdrm_radeon.so.%{radeon_major}{,.*} %ifarch %arm %files -n %{libomap} %{_libdir}/libdrm_omap.so.%{omap_major}{,.*} %endif %ifarch %arm aarch64 %files -n %{libtegra} %{_libdir}/libdrm_tegra.so.%{tegra_major}{,.*} %files -n %{libetnaviv} %{_libdir}/libdrm_etnaviv.so.%{etnaviv_major}{,.*} %files -n %{libexynos} %{_libdir}/libdrm_exynos.so.%{exynos_major}{,.*} %files -n %{libfreedreno} %{_libdir}/libdrm_freedreno.so.%{freedreno_major}{,.*} %endif %files -n drm-utils %{_bindir}/amdgpu_stress %{_bindir}/amdgpu_test %{_bindir}/drmdevice %ifarch %arm aarch64 %{_bindir}/etnaviv* %{_bindir}/exynos* %{_bindir}/tegra* %endif %{_bindir}/modetest %{_bindir}/modeprint %{_bindir}/proptest %{_bindir}/vbltest %files -n %{develname} %{_includedir}/libdrm %{_includedir}/*.h %ifarch %arm %{_includedir}/omap/*.h %endif %ifarch %arm aarch64 %{_includedir}/exynos/*.h %{_includedir}/freedreno/*.h %endif %{_libdir}/libdrm*.so %{_libdir}/pkgconfig/libdrm*.pc