2025-08-27 16:05:24 -07:00
|
|
|
#
|
2025-08-31 08:49:28 +02:00
|
|
|
# spec file for package rocdecode
|
|
|
|
#
|
2025-08-27 16:05:24 -07:00
|
|
|
# Copyright Fedora Project Authors.
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to
|
|
|
|
# deal in the Software without restriction, including without limitation the
|
|
|
|
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
# sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
# THE SOFTWARE.
|
|
|
|
#
|
2025-08-31 08:49:28 +02:00
|
|
|
# Copyright (c) 2025 SUSE LLC and contributors
|
|
|
|
#
|
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2025-02-11 16:19:24 -08:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
%global rocdecode_name librocdecode0
|
|
|
|
%else
|
|
|
|
%global rocdecode_name rocdecode
|
|
|
|
%endif
|
|
|
|
|
2024-11-01 19:05:00 -04:00
|
|
|
%global upstreamname rocDecode
|
|
|
|
|
2025-04-19 20:22:55 -07:00
|
|
|
%global rocm_release 6.4
|
2024-12-17 05:24:15 -08:00
|
|
|
%global rocm_patch 0
|
2024-11-01 19:05:00 -04:00
|
|
|
%global rocm_version %{rocm_release}.%{rocm_patch}
|
|
|
|
|
|
|
|
%global toolchain rocm
|
|
|
|
# hipcc does not support some clang flags
|
2025-07-29 18:04:21 -07:00
|
|
|
%global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/' -e 's/-mtls-dialect=gnu2//')
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
# Requires actual HW, so disabled by default.
|
2025-08-31 08:49:28 +02:00
|
|
|
# Tests also have issues and possibly requires ffmpeg from rpmfusion to work
|
2025-08-14 11:40:49 -07:00
|
|
|
%bcond_with check
|
2024-11-01 19:05:00 -04:00
|
|
|
|
2025-01-20 06:40:19 -08:00
|
|
|
# Compression type and level for source/binary package payloads.
|
|
|
|
# "w7T0.xzdio" xz level 7 using %%{getncpus} threads
|
2025-04-10 17:33:06 -07:00
|
|
|
%global _source_payload w7T0.xzdio
|
|
|
|
%global _binary_payload w7T0.xzdio
|
|
|
|
|
|
|
|
# Use ninja if it is available
|
|
|
|
%if 0%{?fedora} || 0%{?suse_version}
|
|
|
|
%bcond_without ninja
|
|
|
|
%else
|
|
|
|
%bcond_with ninja
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with ninja}
|
|
|
|
%global cmake_generator -G Ninja
|
|
|
|
%else
|
|
|
|
%global cmake_generator %{nil}
|
|
|
|
%endif
|
2025-01-20 06:40:19 -08:00
|
|
|
|
2025-02-11 16:19:24 -08:00
|
|
|
Name: %{rocdecode_name}
|
2024-11-01 19:05:00 -04:00
|
|
|
Version: %{rocm_version}
|
2025-08-27 16:05:24 -07:00
|
|
|
Release: 8%{?dist}
|
2024-11-01 19:05:00 -04:00
|
|
|
Summary: High-performance video decode SDK for AMD GPUs
|
|
|
|
|
2025-08-31 08:49:28 +02:00
|
|
|
URL: https://github.com/ROCm/rocDecode
|
2024-11-01 19:05:00 -04:00
|
|
|
# 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
|
2024-12-17 05:24:15 -08:00
|
|
|
Source0: %{url}/archive/rocm-%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
BuildRequires: cmake
|
2025-01-15 16:56:39 -08:00
|
|
|
BuildRequires: gcc-c++
|
2025-04-19 20:22:55 -07:00
|
|
|
BuildRequires: libdrm-devel
|
2024-11-01 19:05:00 -04:00
|
|
|
BuildRequires: libva-devel
|
|
|
|
BuildRequires: rocm-cmake
|
|
|
|
BuildRequires: rocm-comgr-devel
|
|
|
|
BuildRequires: rocm-hip-devel
|
|
|
|
BuildRequires: rocm-rpm-macros
|
2025-08-31 08:49:28 +02:00
|
|
|
BuildRequires: rocm-runtime-devel
|
2025-04-10 17:33:06 -07:00
|
|
|
|
2025-08-14 11:40:49 -07:00
|
|
|
%if %{with check}
|
2025-08-19 07:51:26 -07:00
|
|
|
%if 0%{?suse_version}
|
2025-08-31 08:49:28 +02:00
|
|
|
BuildRequires: Mesa-libva
|
2025-08-19 07:51:26 -07:00
|
|
|
BuildRequires: ffmpeg
|
|
|
|
BuildRequires: libavcodec-devel
|
|
|
|
BuildRequires: libavformat-devel
|
|
|
|
BuildRequires: libavutil-devel
|
2025-08-31 08:49:28 +02:00
|
|
|
%else
|
2024-11-01 19:05:00 -04:00
|
|
|
BuildRequires: ffmpeg-free
|
|
|
|
BuildRequires: libavcodec-free-devel
|
|
|
|
BuildRequires: libavformat-free-devel
|
|
|
|
BuildRequires: libavutil-free-devel
|
|
|
|
BuildRequires: mesa-va-drivers
|
|
|
|
%endif
|
2025-08-19 07:51:26 -07:00
|
|
|
%endif
|
2024-11-01 19:05:00 -04:00
|
|
|
|
2025-04-10 17:33:06 -07:00
|
|
|
%if %{with ninja}
|
|
|
|
%if 0%{?fedora}
|
|
|
|
BuildRequires: ninja-build
|
|
|
|
%endif
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
BuildRequires: ninja
|
|
|
|
%define __builder ninja
|
|
|
|
%endif
|
|
|
|
%endif
|
|
|
|
|
2024-11-01 19:05:00 -04:00
|
|
|
# Rocdecode isn't useful without AMD's mesa va drivers:
|
2025-08-31 08:49:28 +02:00
|
|
|
Requires: mesa-va-drivers
|
|
|
|
Provides: rocdecode = %{version}-%{release}
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2025-02-11 16:19:24 -08:00
|
|
|
%post -p /sbin/ldconfig
|
|
|
|
%postun -p /sbin/ldconfig
|
|
|
|
|
2024-11-01 19:05:00 -04:00
|
|
|
%package devel
|
2025-08-31 08:49:28 +02:00
|
|
|
Summary: The rocDecode development package
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
Provides: rocdecode-devel = %{version}-%{release}
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
The rocDecode development package.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%autosetup -p1 -n %{upstreamname}-rocm-%{version}
|
2025-08-31 08:49:28 +02:00
|
|
|
# Allow overriding CMAKE_CXX_COMPILER:
|
2024-11-01 19:05:00 -04:00
|
|
|
# https://github.com/ROCm/rocDecode/pull/436
|
|
|
|
sed -i "s|\(llvm/bin/clang++\)|\1 CACHE STRING \"ROCm Compiler path\"|" \
|
|
|
|
CMakeLists.txt \
|
|
|
|
samples/*/CMakeLists.txt
|
|
|
|
|
2024-12-17 05:24:15 -08:00
|
|
|
# Problems finding va.h
|
|
|
|
# https://github.com/ROCm/rocDecode/issues/477
|
|
|
|
sed -i "s|/opt/amdgpu/include NO_DEFAULT_PATH|/usr/include|" cmake/FindLibva.cmake
|
|
|
|
|
2025-02-04 12:14:09 -08:00
|
|
|
# cpack cruft in the middle of the configure, this breaks TW and is only used for ubuntu
|
|
|
|
sed -i -e 's@file(READ "/etc/os-release" OS_RELEASE)@#file(READ "/etc/os-release" OS_RELEASE)@' CMakeLists.txt
|
|
|
|
sed -i -e 's@string(REGEX MATCH "22.04" UBUNTU_22_FOUND ${OS_RELEASE})@#string(REGEX MATCH "22.04" UBUNTU_22_FOUND ${OS_RELEASE})@' CMakeLists.txt
|
|
|
|
|
2025-04-23 10:15:26 -07:00
|
|
|
# Need to add libdrm_amdgpu to link
|
|
|
|
# https://github.com/ROCm/rocDecode/issues/571
|
|
|
|
sed -i -e 's@${LINK_LIBRARY_LIST} ${LIBVA_DRM_LIBRARY}@${LINK_LIBRARY_LIST} ${LIBVA_DRM_LIBRARY} -ldrm_amdgpu@' CMakeLists.txt
|
|
|
|
|
2024-11-01 19:05:00 -04:00
|
|
|
%build
|
2025-04-10 17:33:06 -07:00
|
|
|
%cmake %{cmake_generator} \
|
2024-11-01 19:05:00 -04:00
|
|
|
-DCMAKE_CXX_COMPILER=hipcc \
|
|
|
|
-DCMAKE_INSTALL_LIBDIR=%{_lib}
|
|
|
|
%cmake_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%cmake_install
|
|
|
|
|
2025-08-25 15:54:08 -07:00
|
|
|
rm -f %{buildroot}%{_prefix}/share/doc/rocdecode/LICENSE
|
|
|
|
rm -f %{buildroot}%{_prefix}/share/doc/rocdecode-asan/LICENSE
|
|
|
|
rm -f %{buildroot}%{_prefix}/share/doc/packages/%{name}/LICENSE
|
|
|
|
rm -f %{buildroot}%{_prefix}/share/doc/packages/%{name}-asan/LICENSE
|
2025-02-04 12:14:09 -08:00
|
|
|
|
2025-08-19 07:51:26 -07:00
|
|
|
# Need to install the sample first
|
2025-08-14 11:40:49 -07:00
|
|
|
%if %{with check}
|
2024-11-01 19:05:00 -04:00
|
|
|
%check
|
|
|
|
%ctest
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%files
|
2025-02-04 12:14:09 -08:00
|
|
|
%license LICENSE
|
2025-02-11 16:19:24 -08:00
|
|
|
%{_libdir}/librocdecode.so.0{,.*}
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
%files devel
|
2025-02-11 16:19:24 -08:00
|
|
|
%{_libdir}/librocdecode.so
|
|
|
|
%{_includedir}/rocdecode
|
|
|
|
%{_datadir}/rocdecode
|
|
|
|
%exclude %{_datadir}/rocdecode/samples
|
2024-11-01 19:05:00 -04:00
|
|
|
|
|
|
|
%changelog
|