LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-17-2020, 03:05 PM   #1
ddenial
Member
 
Registered: Dec 2016
Distribution: CentOS, Fedora, Ubuntu
Posts: 359

Rep: Reputation: 56
How to apply patch in CentOS 8


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.spec
4. 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 pkgconfig
6. 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

Thanks
 
Old 04-18-2020, 08:01 AM   #2
shruggy
Senior Member
 
Registered: Mar 2020
Posts: 3,670

Rep: Reputation: Disabled
You're doing it wrong. The proper way to rebuild a source RPM on CentOS is using mock:
Code:
sudo dnf install epel-release
sudo dnf install mock
sudo usermod -a -G mock $USER
curl -LO https://download.fedoraproject.org/pub/fedora/linux/releases/31/Everything/source/tree/Packages/l/libva-utils-2.5.0-1.fc31.src.rpm
mock libva-utils-2.5.0-1.fc31.src.rpm
ls /var/lib/mock/epel-8-x86-64/result/*.rpm
See also:A word of caution. Rebuilding libva-utils-2.7.1-1.fc33.src.rpm currently in Fedora Rawhide or even libva-utils-2.6.0-1.fc31.src.rpm currently in Fedora 31 updates-testing won't work out of the box on CentOS 8.1: they'll probably require a newer C compiler than GCC 8.3.1 coming by default with CentOS 8.

Last edited by shruggy; 04-18-2020 at 08:04 AM.
 
1 members found this post helpful.
  


Reply

Tags
centos, packaging



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Patch not apply and tell me "file to Patch" :( hack3rcon Linux - Software 2 06-08-2015 07:35 AM
How to Apply patch for Mass Storage device to work? (uss725-2.4.20-rc2.patch) cevjr Linux - Hardware 3 04-20-2004 11:14 PM
How do I apply a patch for the new version of xchat? Womandrake Linux - Software 2 04-24-2003 06:46 PM
How To Apply Patch To Kernel WILLIAMATHOMAS Linux - Software 2 02-12-2003 12:57 PM
help a newbie apply php 4.2.2 patch! bobotron Linux - Software 1 08-01-2002 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration