Initial commit.

el9
Vasiliy Glazov 5 years ago
parent 0d0eacfce1
commit 5f65c6f1f8

1
.gitignore vendored

@ -0,0 +1 @@
/SVT-HEVC-1.4.1.tar.gz

@ -0,0 +1,55 @@
From d313b632ede3c47945e42289672c08013bc6a56f Mon Sep 17 00:00:00 2001
From: Austin Hu <austin.hu@intel.com>
Date: Thu, 19 Sep 2019 06:28:28 +0800
Subject: [PATCH] Don't compile the binaries as executable stack.
Signed-off-by: Austin Hu <austin.hu@intel.com>
---
Source/Lib/ASM_SSE2/x64Macro.asm | 14 ++++++++++++++
Source/Lib/ASM_SSE2/x64inc.asm | 14 ++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/Source/Lib/ASM_SSE2/x64Macro.asm b/Source/Lib/ASM_SSE2/x64Macro.asm
index eaeeac61..7dcb9038 100644
--- a/Source/Lib/ASM_SSE2/x64Macro.asm
+++ b/Source/Lib/ASM_SSE2/x64Macro.asm
@@ -28,3 +28,17 @@
punpckl%1 xmm%8, xmm%9 ; 67 66 65 64 63 62 61 60 73 63 72 62 71 61 70 60 75 65 55 45 74 64 54 44 76 66 56 46 36 26 16 06
punpckh%1 xmm%13, xmm%9 ; 77 76 75 74 73 72 71 70 77 67 76 66 75 65 74 64 77 67 57 47 76 66 56 46 77 67 57 47 37 27 17 07
%endmacro
+
+%define FORMAT_ELF 0
+%ifidn __OUTPUT_FORMAT__,elf
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf32
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf64
+ %define FORMAT_ELF 1
+%endif
+
+; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default.
+%if FORMAT_ELF
+ [SECTION .note.GNU-stack noalloc noexec nowrite progbits]
+%endif
diff --git a/Source/Lib/ASM_SSE2/x64inc.asm b/Source/Lib/ASM_SSE2/x64inc.asm
index 4440b060..a884545b 100644
--- a/Source/Lib/ASM_SSE2/x64inc.asm
+++ b/Source/Lib/ASM_SSE2/x64inc.asm
@@ -323,3 +323,17 @@ bits 64
%endif
%endmacro
%define NEED_EMMS 1
+
+%define FORMAT_ELF 0
+%ifidn __OUTPUT_FORMAT__,elf
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf32
+ %define FORMAT_ELF 1
+%elifidn __OUTPUT_FORMAT__,elf64
+ %define FORMAT_ELF 1
+%endif
+
+; This is needed for ELF, otherwise the GNU linker assumes the stack is executable by default.
+%if FORMAT_ELF
+ [SECTION .note.GNU-stack noalloc noexec nowrite progbits]
+%endif

@ -0,0 +1 @@
SHA512 (SVT-HEVC-1.4.1.tar.gz) = 0a41068e7ecbb7d7ec2bd709bfb8b8da3028dbdc7c5c52d1e5bc689722c61fc359312c55ab1b043c9a0d7e8957fce43075f6ec1b24363b0551e4b17c12b5a30f

@ -0,0 +1,97 @@
Name: svt-hevc
Version: 1.4.1
Release: 1%{?dist}
Summary: Scalable Video Technology for HEVC Encoder
License: BSD-2-Clause-Patent
URL: https://github.com/OpenVisualCloud/SVT-HEVC
Source0: %url/archive/v%{version}/SVT-HEVC-%{version}.tar.gz
# https://github.com/OpenVisualCloud/SVT-HEVC/issues/364
Patch0: d313b632ede3c47945e42289672c08013bc6a56f.patch
BuildRequires: gcc
BuildRequires: cmake
BuildRequires: yasm
BuildRequires: meson
BuildRequires: gstreamer1-devel
BuildRequires: gstreamer1-plugins-base-devel
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
ExclusiveArch: x86_64
%description
The Scalable Video Technology for HEVC Encoder (SVT-HEVC Encoder) is an
HEVC-compliant encoder library core that achieves excellent density-quality
tradeoffs, and is highly optimized for Intel® Xeon™ Scalable Processor and
Xeon™ D processors.
%package libs
Summary: Libraries for svt-hevc
%description libs
Libraries for development svt-hevc.
%package devel
Summary: Include files and mandatory libraries for development svt-hevc
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description devel
Include files and mandatory libraries for development svt-hevc.
%package -n gstreamer1-%{name}
Summary: GStreamer 1.0 %{name}-based plug-in
Requires: gstreamer1-plugins-base%{?_isa}
%description -n gstreamer1-%{name}
This package provides %{name}-based GStreamer plug-in.
%prep
%autosetup -p1 -n SVT-HEVC-%{version}
# Remove unneeded flags
sed -i 's|-O3)|)|' CMakeLists.txt
# Patch build gstreamer plugin
sed -e "s|install: true,|install: true, include_directories : '../Source/API', link_args : '-lSvtHevcEnc',|" \
-e "/svthevcenc_dep =/d" -e 's|, svthevcenc_dep||' -e "s|svthevcenc_dep.found()|true|" -i gstreamer-plugin/meson.build
%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake -G Ninja \
..
popd
%ninja_build -C %{_target_platform}
pushd gstreamer-plugin
export LIBRARY_PATH="$PWD/../Bin/Release:$LIBRARY_PATH"
%meson
%meson_build
popd
%install
%ninja_install -C %{_target_platform}
pushd gstreamer-plugin
%meson_install
popd
%files
%{_bindir}/SvtHevcEncApp
%files libs
%license LICENSE.md
%doc README.md Docs/svt-hevc_encoder_user_guide.md
%{_libdir}/libSvtHevcEnc.so.1*
%files devel
%{_includedir}/%{name}
%{_libdir}/libSvtHevcEnc.so
%{_libdir}/pkgconfig/*.pc
%files -n gstreamer1-%{name}
%{_libdir}/gstreamer-1.0/libgstsvthevcenc.so
%changelog
* Tue Sep 17 2019 Vasiliy Glazov <vascom2@gmail.com> - 1.4.1-1
- Initial release
Loading…
Cancel
Save