Article 52A50 How to apply patch in CentOS 8

How to apply patch in CentOS 8

by
ddenial
from LinuxQuestions.org on (#52A50)
Hello

I am trying to compile libva-utils package in CentOS 8. Since it is not available in CentOS 8 repo, I'm using EL7 package to compile it. But I don't know how to apply patches.

Steps I followed:
1. Downloaded srpm from https://download-ib01.fedoraproject....-4.el7.src.rpm
2. Extracted it using command 'rpm2cpio libva-utils-1.8.3-4.el7.src.rpm | cpio -ivd'
3.Extracted files listing
Code:ls -1
0001-vainfo-add-an-option-device-to-specify-a-drm-device.patch
0002-vainfo-Add-help-to-show-available-options.patch
libva-utils-1.8.3.tar.gz
libva-utils.spec4. Contents of libva-utils.spec
Code:Name: libva-utils
Version: 1.8.3
Release: 4%{?dist}
Summary: Tools for VAAPI (including vainfo)
License: MIT and BSD
URL: https://01.org/linuxmedia
Source0: https://github.com/01org/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
Patch0: 0001-vainfo-add-an-option-device-to-specify-a-drm-device.patch
Patch1: 0002-vainfo-Add-help-to-show-available-options.patch


BuildRequires: libtool

BuildRequires: libXext-devel
BuildRequires: libXfixes-devel
BuildRequires: libdrm-devel
BuildRequires: libva-devel
%{?_with_wayland:
BuildRequires: wayland-devel
BuildRequires: pkgconfig(wayland-client) >= 1
BuildRequires: pkgconfig(wayland-scanner) >= 1
}

%description
The libva-utils package contains tools that are provided as part
of libva, including the vainfo tool for determining what (if any)
libva support is available on a system.

%prep
%autosetup -p1
autoreconf -vif

%build
%configure --disable-static \
%{!?_with_wayland:--disable-wayland}

%make_build

%install
%make_install INSTALL="install -p"

%files
%license COPYING
%doc CONTRIBUTING.md README.md
%{_bindir}/vainfo
%{_bindir}/loadjpeg
%{_bindir}/jpegenc
%{_bindir}/avcenc
%{_bindir}/h264encode
%{_bindir}/mpeg2vldemo
%{_bindir}/mpeg2vaenc
%{_bindir}/putsurface
%{?_with_wayland:%{_bindir}/putsurface_wayland}5. According to libva-utils.spec file, installed these build prerequistes
Code:# yum install libtool libXext-devel libXfixes-devel libdrm-devel libva-devel wayland-devel pkgconfig6. Now I've to apply patch and compile the source. But I don't know how to apply patches as specified in point 4

I really appreciate if someone tells me how to apply those two .patch files

Thankslatest?d=yIl2AUoC8zA latest?i=pZDAutK3Q0g:C2Lj2IURJF0:F7zBnMy latest?i=pZDAutK3Q0g:C2Lj2IURJF0:V_sGLiP latest?d=qj6IDK7rITs latest?i=pZDAutK3Q0g:C2Lj2IURJF0:gIN9vFwpZDAutK3Q0g
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments