New package

This commit is contained in:
Jeremy Newton
2024-11-01 19:05:00 -04:00
parent e461e839d1
commit 1db17a2afd
3 changed files with 95 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/rocDecode-6.2.2.tar.gz

93
rocdecode.spec Normal file
View File

@@ -0,0 +1,93 @@
%global upstreamname rocDecode
%global rocm_release 6.2
%global rocm_patch 2
%global rocm_version %{rocm_release}.%{rocm_patch}
%global toolchain rocm
# hipcc does not support some clang flags
%global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/')
# Requires actual HW, so disabled by default.
# Tests also have issues and possibly requires ffmpeg from rpmfusion to work
%bcond_with test
Name: rocdecode
Version: %{rocm_version}
Release: %autorelease
Summary: High-performance video decode SDK for AMD GPUs
Url: https://github.com/ROCm/rocDecode
# Note: MIT with a clause clarifying that AMD will not pay for codec royalties
# The clause has little weight on the licensing, it is just a clarification
License: MIT
Source0: %{url}/archive/refs/tags/rocm-%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: libva-devel
BuildRequires: rocm-cmake
BuildRequires: rocm-comgr-devel
BuildRequires: rocm-hip-devel
BuildRequires: rocm-runtime-devel
BuildRequires: rocm-rpm-macros
%if %{with test}
BuildRequires: ffmpeg-free
BuildRequires: libavcodec-free-devel
BuildRequires: libavformat-free-devel
BuildRequires: libavutil-free-devel
BuildRequires: mesa-va-drivers
%endif
# Rocdecode isn't useful without AMD's mesa va drivers:
Requires: mesa-va-drivers
# Only x86_64 works right now:
ExclusiveArch: x86_64
%description
rocDecode is a high-performance video decode SDK for AMD GPUs. Using the
rocDecode API, you can access the video decoding features available on your GPU.
%package devel
Summary: The rocDecode development package
Requires: %{name}%{?_isa} = %{version}-%{release}
%description devel
The rocDecode development package.
%prep
%autosetup -p1 -n %{upstreamname}-rocm-%{version}
# Allow overriding CMAKE_CXX_COMPILER:
# https://github.com/ROCm/rocDecode/pull/436
sed -i "s|\(llvm/bin/clang++\)|\1 CACHE STRING \"ROCm Compiler path\"|" \
CMakeLists.txt \
samples/*/CMakeLists.txt
%build
%cmake \
-DCMAKE_CXX_COMPILER=hipcc \
-DCMAKE_INSTALL_LIBDIR=%{_lib}
%cmake_build
%install
%cmake_install
%if %{with test}
%check
%ctest
%endif
%files
%license /usr/share/doc/%{name}/LICENSE
%exclude /usr/share/doc/%{name}-*/LICENSE
%dir %{_docdir}/%{name}
%{_libdir}/lib%{name}.so.0{,.*}
%files devel
%{_libdir}/lib%{name}.so
%{_includedir}/%{name}
%{_datadir}/%{name}
%exclude %{_datadir}/%{name}/samples
%changelog
%autochangelog

1
sources Normal file
View File

@@ -0,0 +1 @@
SHA512 (rocDecode-6.2.2.tar.gz) = 0927e5eda08e29a668d5a2991fc9909bbc52c888ddcb0dd2196a03574e791c669bb9cb37b44780009a45a937efc349463eee3e2418717072c9fc1603903339e5