[packages/openHEVC] - added x32 hacks
qboosh
qboosh at pld-linux.org
Tue Apr 16 21:25:38 CEST 2024
commit 9cc34cac05b789d3c8632a9822ed6c35674380fb
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Tue Apr 16 21:14:42 2024 +0200
- added x32 hacks
openHEVC-x32.patch | 36 ++++++++++++++++++++++++++++++++++++
openHEVC.spec | 16 ++++++++++++++--
2 files changed, 50 insertions(+), 2 deletions(-)
---
diff --git a/openHEVC.spec b/openHEVC.spec
index 581f4db..c1fb142 100644
--- a/openHEVC.spec
+++ b/openHEVC.spec
@@ -11,10 +11,13 @@ Source0: https://github.com/OpenHEVC/openHEVC/archive/openhevc-%{version}/%{name
Patch0: %{name}-sysctl.patch
Patch1: %{name}-asm.patch
Patch2: %{name}-libdir.patch
+Patch3: %{name}-x32.patch
URL: https://github.com/OpenHEVC/openHEVC
BuildRequires: SDL2-devel >= 2.0
BuildRequires: cmake >= 2.8
+%ifarch %{ix86} %{x8664}
BuildRequires: yasm
+%endif
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
@@ -42,14 +45,23 @@ Pliki nagłówkowe biblioteki openHEVC.
%patch0 -p1
%patch1 -p1
%patch2 -p1
+%patch3 -p1
+
+%ifarch x32
+# disable references to asm routines
+%{__sed} -i -e 's/\(define HAVE_.*_EXTERNAL\) \+.*/\1 0/' platform/x86/config.h.in
+%endif
%build
install -d build
cd build
-%ifarch %{ix86}
+%ifarch %{ix86} x32
CFLAGS="%{rpmcflags} -DX86_32"
%endif
-%cmake ..
+%cmake .. \
+%ifarch x32
+ -DUSE_YASM=OFF
+%endif
%{__make}
diff --git a/openHEVC-x32.patch b/openHEVC-x32.patch
new file mode 100644
index 0000000..b4f5acc
--- /dev/null
+++ b/openHEVC-x32.patch
@@ -0,0 +1,36 @@
+--- openHEVC-openhevc-2.0/CMakeLists.txt.orig 2024-04-16 18:38:09.341210316 +0200
++++ openHEVC-openhevc-2.0/CMakeLists.txt 2024-04-16 18:43:33.946439215 +0200
+@@ -135,7 +135,11 @@ if(YASM_FOUND)
+ if(APPLE)
+ set(YASM_ARGS -f macho64 -m amd64 -DPREFIX ${COMMON_YASM_ARGS})
+ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
++ if(CMAKE_SIZEOF_VOID_P EQUAL 4)
++ set(YASM_ARGS -f elfx32 -m amd64 -DX86_32 ${COMMON_YASM_ARGS})
++ else()
+ set(YASM_ARGS -f elf -m amd64 ${COMMON_YASM_ARGS})
++ endif()
+ elseif("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "i686")
+ set(YASM_ARGS -f elf -DX86_32 ${COMMON_YASM_ARGS})
+ else()
+--- openHEVC-openhevc-2.0/libavutil/x86/x86inc.asm.orig 2017-10-04 15:08:10.000000000 +0200
++++ openHEVC-openhevc-2.0/libavutil/x86/x86inc.asm 2024-04-16 19:33:22.927275688 +0200
+@@ -74,6 +74,8 @@
+ %define FORMAT_ELF 1
+ %elifidn __OUTPUT_FORMAT__,elf64
+ %define FORMAT_ELF 1
++%elifidn __OUTPUT_FORMAT__,elfx32
++ %define FORMAT_ELF 1
+ %endif
+
+ %ifdef PREFIX
+--- openHEVC-openhevc-2.0/libavutil/x86/cpu.c.orig 2017-10-04 15:08:10.000000000 +0200
++++ openHEVC-openhevc-2.0/libavutil/x86/cpu.c 2024-04-16 20:35:52.529221165 +0200
+@@ -62,7 +62,7 @@
+
+ #endif /* HAVE_INLINE_ASM */
+
+-#if ARCH_X86_64
++#if ARCH_X86_64 || defined(__x86_64__)
+
+ #define cpuid_test() 1
+
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/openHEVC.git/commitdiff/9cc34cac05b789d3c8632a9822ed6c35674380fb
More information about the pld-cvs-commit
mailing list