%if 0%{?rhel} %define with_private_llvm 1 %else %define with_private_llvm 0 %define with_wayland 1 %endif # S390 doesn't have video cards, but we need swrast for xserver's GLX # llvm (and thus llvmpipe) doesn't actually work on ppc32 # llvm support for ppc64le is supposed to come in llvm-3.5 %ifnarch s390 ppc %define with_llvm 1 %endif %define min_wayland_version 1.0 %if 0%{?with_llvm} %define with_radeonsi 1 %endif %ifarch s390 s390x ppc %define with_hardware 0 %define base_drivers swrast %endif %ifnarch s390 s390x ppc %define with_hardware 1 %define with_vdpau 1 %define with_nine 1 %define base_drivers swrast,nouveau,radeon,r200 %ifarch %{ix86} x86_64 %define platform_drivers ,i915,i965 %define with_ilo 1 %define with_vmware 1 %define with_xa 1 %endif %ifarch %{arm} aarch64 %define with_freedreno 1 %define with_xa 1 %endif %endif %define dri_drivers --with-dri-drivers=i965 %define _default_patch_fuzz 2 #define gitdate 20150505 #% define githash 6171131 #define git %{?githash:%{githash}}%{!?githash:%{gitdate}} Summary: Vulkan driver for Intel GPUs Name: anvil Version: 0 Release: 0.1%{?dist} License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org ExclusiveArch: %{ix86} x86_64 # https://cgit.freedesktop.org/mesa/mesa/log/?h=vulkan Source0: anvil.tar.xz Source1: anv_icd.json # Source compat with libdrm 2.4.60 for RHEL 7.2 Patch0: 0001-i965-bump-libdrm-requirement-to-2.4.61-and-drop-in-t.patch # Mustard: don't collide with the loader's soname Patch1: 0001-anv-Change-driver-name.patch BuildRequires: pkgconfig autoconf automake libtool %if %{with_hardware} BuildRequires: kernel-headers BuildRequires: xorg-x11-server-devel %endif BuildRequires: libdrm-devel >= 2.4.42 BuildRequires: libXxf86vm-devel BuildRequires: expat-devel BuildRequires: xorg-x11-proto-devel BuildRequires: makedepend BuildRequires: libselinux-devel BuildRequires: libXext-devel BuildRequires: libXfixes-devel BuildRequires: libXdamage-devel BuildRequires: libXi-devel BuildRequires: libXmu-devel BuildRequires: libxshmfence-devel BuildRequires: elfutils BuildRequires: python BuildRequires: gettext BuildRequires: elfutils-libelf-devel BuildRequires: libxml2-python BuildRequires: libudev-devel BuildRequires: bison flex %if 0%{?with_wayland} BuildRequires: pkgconfig(wayland-client) >= %{min_wayland_version} BuildRequires: pkgconfig(wayland-server) >= %{min_wayland_version} %endif BuildRequires: mesa-libGL-devel %if 0%{?with_vdpau} BuildRequires: libvdpau-devel %endif BuildRequires: zlib-devel BuildRequires: python-mako BuildRequires: openssl-devel %description Anvil %package devel Summary: anvil devel Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: vulkan-devel %description devel Anvil devel %prep %setup -q -n anvil %patch0 -p1 -b .libdrm %patch1 -p1 -b .mustard %build autoreconf --install %ifarch %{ix86} # i do not have words for how much the assembly dispatch code infuriates me %define asm_flags --disable-asm # this driver only supports Ivybridge and above anyway export CFLAGS="$RPM_OPT_FLAGS -march=ivybridge" %endif sed -i 's/©//g' src/vulkan/*.py # sed -i 's/python3/python/' src/vulkan/*.py # completely gross sed -i 's/MESA_GIT_SHA1/"xxxxFedora"/' src/vulkan/anv_device.c %configure \ %{?asm_flags} \ --with-dri-driverdir=%{_libdir}/dri \ --disable-gles1 \ --disable-gles2 \ --disable-xvmc \ --with-egl-platforms=x11,drm%{?with_wayland:,wayland} \ --enable-shared-glapi \ --enable-gbm \ --enable-glx-tls \ --enable-dri \ --with-gallium-drivers= \ %{?dri_drivers} make V=1 %{?_smp_mflags} MKDEP=/bin/true %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT # strip out useless headers and other mesa leftovers rm -rf $RPM_BUILD_ROOT%{_sysconfdir}/drirc rm -rf $RPM_BUILD_ROOT%{_includedir}/*GL* rm -rf $RPM_BUILD_ROOT%{_includedir}/*[gGK]* rm -rf $RPM_BUILD_ROOT%{_includedir}/vulkan/{vulkan,vk_platform}.h rm -rf $RPM_BUILD_ROOT%{_libdir}/*GL* rm -rf $RPM_BUILD_ROOT%{_libdir}/lib[gw]* rm -rf $RPM_BUILD_ROOT%{_libdir}/{dri,pkgconfig} # remove .la files find $RPM_BUILD_ROOT -name \*.la | xargs rm -f mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/vulkan/icd.d install %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/vulkan/icd.d %clean rm -rf $RPM_BUILD_ROOT %check %files %doc docs/COPYING README.intel-vulkan.txt %{_libdir}/libVK_anv.so %{_sysconfdir}/vulkan/icd.d/*.json %files devel %{_includedir}/vulkan/*.h %changelog * Mon Feb 15 2016 Adam Jackson 0-0.1 - Initial packaging