# # SPDX-FileCopyrightText: 2022 Nicolas Chauvet # SPDX-License-Identifier: AGPL-3.0 # %if 0%{?fedora} %global buildforkernels akmod %global debug_package %{nil} %endif Name: nvidia-open-kmod Epoch: 3 Version: 515.48.07 # Taken over by kmodtool Release: 3%{?dist} Summary: NVIDIA open display driver kernel module License: GPLv2 and MIT URL: https://github.com/NVIDIA/open-gpu-kernel-modules Source0: %{url}/archive/%{version}/open-gpu-kernel-modules-%{version}.tar.gz Source11: nvidia-open-kmodtool-excludekernel-filterfile ExclusiveArch: x86_64 aarch64 ppc64le # get the needed BuildRequires (in parts depending on what we build for) %global AkmodsBuildRequires %{_bindir}/kmodtool BuildRequires: %{AkmodsBuildRequires} %{!?kernels:BuildRequires: gcc, elfutils-libelf-devel, buildsys-build-rpmfusion-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu} } # kmodtool does its magic here %{expand:%(kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } %description The nvidia open %{version} display driver kernel module for kernel %{kversion}. %prep # error out if there was something wrong with kmodtool %{?kmodtool_check} # print kmodtool output for debugging purposes: kmodtool --target %{_target_cpu} --repo rpmfusion --kmodname %{name} --filterfile %{SOURCE11} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null %setup -q -c # patch loop %if 0%{?_without_nvidia_kmod_patches:1} # placeholder %endif for kernel_version in %{?kernel_versions} ; do cp -a open-gpu-kernel-modules-%{version} _kmod_build_${kernel_version%%___*} done %build %if 0%{?_without_nvidia_uvm:1} export NV_EXCLUDE_KERNEL_MODULES="${NV_EXCLUDE_KERNEL_MODULES} nvidia_uvm " %endif %if 0%{?_without_nvidia_modeset:1} export NV_EXCLUDE_KERNEL_MODULES="${NV_EXCLUDE_KERNEL_MODULES} nvidia_modeset " %endif for kernel_version in %{?kernel_versions}; do pushd _kmod_build_${kernel_version%%___*}/ make V=1 %{?_smp_mflags} CC=gcc \ KERNEL_UNAME="${kernel_version%%___*}" SYSSRC="${kernel_version##*___}" \ IGNORE_CC_MISMATCH=1 IGNORE_XEN_PRESENCE=1 IGNORE_PREEMPT_RT_PRESENCE=1 \ modules popd done %install for kernel_version in %{?kernel_versions}; do mkdir -p %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ install -D -m 0755 _kmod_build_${kernel_version%%___*}/kernel-open/nvidia*.ko \ %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ done %{?akmod_install} %changelog * Wed Jun 01 2022 Nicolas Chauvet - 3:515.48.07-3 - Switch to kernel-open * Wed May 11 2022 Leigh Scott - 3:515.43.04-1 - Update to 515.43.04 beta