From 4a04df0a5804801eb22f8ebe60f5d13c077c0b01 Mon Sep 17 00:00:00 2001 From: Leigh Scott Date: Sun, 28 Apr 2019 23:19:22 +0100 Subject: [PATCH 1/6] Fix opencl dlopen (rfbz#5185) --- x264-opencl.patch | 11 +++++++++++ x264.spec | 8 +++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 x264-opencl.patch diff --git a/x264-opencl.patch b/x264-opencl.patch new file mode 100644 index 0000000..6a6363e --- /dev/null +++ b/x264-opencl.patch @@ -0,0 +1,11 @@ +--- a/common/opencl.c 2019-03-12 00:41:42.000000000 +0000 ++++ b/common/opencl.c 2019-04-28 22:39:02.672147762 +0100 +@@ -36,7 +36,7 @@ + #if SYS_MACOSX + #define ocl_open dlopen( "/System/Library/Frameworks/OpenCL.framework/OpenCL", RTLD_NOW ) + #else +-#define ocl_open dlopen( "libOpenCL.so", RTLD_NOW ) ++#define ocl_open dlopen( "libOpenCL.so.1", RTLD_NOW ) + #endif + #define ocl_close dlclose + #define ocl_address dlsym diff --git a/x264.spec b/x264.spec index f808b7c..d599a44 100644 --- a/x264.spec +++ b/x264.spec @@ -31,7 +31,7 @@ Summary: H264/AVC video streams encoder Name: x264 Version: 0.%{api} -Release: 2%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} +Release: 3%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} License: GPLv2+ URL: https://www.videolan.org/developers/x264.html Source0: %{name}-0.%{api}-%{snapshot}.tar.bz2 @@ -42,6 +42,7 @@ Patch0: x264-nover.patch # add 10b suffix to high bit depth build Patch1: x264-10b.patch Patch10: x264-gpac.patch +Patch11: x264-opencl.patch Patch20: x264-sandbox.git-b63c73dc5c37e5405bf032c9113c1daced3e45a4.patch BuildRequires: gcc @@ -66,6 +67,7 @@ This package contains the frontend. %package libs Summary: Library for encoding H264/AVC video streams +Recommends: %{_libdir}/libOpenCL.so.1 %description libs x264 is a free library for encoding H264/AVC video streams, written from @@ -99,6 +101,7 @@ pushd %{name}-0.%{api}-%{snapshot} %patch0 -p1 -b .nover %patch1 -p1 -b .10b %patch10 -p1 -b .gpac +%patch11 -p1 -b .opencl %patch20 -p1 -b .stack_align popd @@ -205,6 +208,9 @@ install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/ %endif %changelog +* Sun Apr 28 2019 Leigh Scott - 0.155-3.20180806git0a84d98 +- Fix opencl dlopen (rfbz#5185) + * Wed Nov 07 2018 Stefan Becker - 0.155-2.20180806git0a84d98 - reverse order of generic/generic10 install to fix -devel contents (rfbz #5071) From fda3c03bf180d65f76871c5bb3d81827ca243d6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 7 May 2019 00:08:09 +0100 Subject: [PATCH 2/6] Enable opencl (which is default) only exist --disable-opencl option Disable opencl on 10bit seems that is just prepared for 8bit. --- x264.spec | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/x264.spec b/x264.spec index d599a44..577a049 100644 --- a/x264.spec +++ b/x264.spec @@ -31,7 +31,7 @@ Summary: H264/AVC video streams encoder Name: x264 Version: 0.%{api} -Release: 3%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} +Release: 4%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} License: GPLv2+ URL: https://www.videolan.org/developers/x264.html Source0: %{name}-0.%{api}-%{snapshot}.tar.bz2 @@ -89,7 +89,6 @@ This package contains the development files. %{?_without_libavformat:--disable-lavf} \\\ %{?_without_libswscale:--disable-swscale} \\\ %{!?_with_ffmpegsource:--disable-ffms} \\\ - --disable-opencl \\\ --enable-debug \\\ --enable-shared \\\ --system-libx264 \\\ @@ -127,6 +126,7 @@ pushd generic10 %{x_configure}\ %{?_without_asm:--disable-asm}\ --disable-cli\ + --disable-opencl \ --bit-depth=10 %{__make} %{?_smp_mflags} @@ -144,6 +144,7 @@ pushd simd10 %{x_configure}\ --disable-cli\ --libdir=%{slibdir}\ + --disable-opencl \ --bit-depth=10 %{__make} %{?_smp_mflags} @@ -208,6 +209,10 @@ install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/ %endif %changelog +* Mon May 06 2019 Sérgio Basto - 0.155-4.20180806git0a84d98 +- Enable opencl (which is default) only exist --disable-opencl option +- Disable opencl on 10bit seems that is just prepared for 8bit. + * Sun Apr 28 2019 Leigh Scott - 0.155-3.20180806git0a84d98 - Fix opencl dlopen (rfbz#5185) From 808c02f2380dfd5c387cdc98ef682728cb62bccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 7 May 2019 00:08:49 +0100 Subject: [PATCH 3/6] Build /usr/bin/x264 with gpac shared lib instead static lib. --- x264-gpac.patch | 16 +++++++--------- x264.spec | 1 + 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/x264-gpac.patch b/x264-gpac.patch index 19d1a4e..4b4604f 100644 --- a/x264-gpac.patch +++ b/x264-gpac.patch @@ -1,13 +1,11 @@ ---- x264-0.140-20140122-de0bc36/configure.orig 2014-01-22 23:26:55.922650888 +0000 -+++ x264-0.140-20140122-de0bc36/configure 2014-02-24 02:35:19.263127505 +0000 -@@ -941,7 +941,9 @@ +--- ./configure.orig 2019-05-07 00:00:16.289260869 +0100 ++++ ./configure 2019-05-07 00:03:39.415602593 +0100 +@@ -1199,7 +1199,7 @@ fi + if [ "$gpac" = "auto" -a "$lsmash" != "yes" ] ; then gpac="no" - GPAC_LIBS="-lgpac_static" -- cc_check "" -lz && GPAC_LIBS="$GPAC_LIBS -lz" -+ for lib in -lz -lssl -lcrypto -lpng -ljpeg; do -+ cc_check "" $lib && GPAC_LIBS="$GPAC_LIBS $lib" -+ done +- GPAC_LIBS="-lgpac_static" ++ GPAC_LIBS="-lgpac" + cc_check "" -lz && GPAC_LIBS="$GPAC_LIBS -lz" if [ "$SYS" = "WINDOWS" ] ; then cc_check "" -lws2_32 && GPAC_LIBS="$GPAC_LIBS -lws2_32" - cc_check "" -lwinmm && GPAC_LIBS="$GPAC_LIBS -lwinmm" diff --git a/x264.spec b/x264.spec index 577a049..ce1f5aa 100644 --- a/x264.spec +++ b/x264.spec @@ -212,6 +212,7 @@ install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/ * Mon May 06 2019 Sérgio Basto - 0.155-4.20180806git0a84d98 - Enable opencl (which is default) only exist --disable-opencl option - Disable opencl on 10bit seems that is just prepared for 8bit. +- Build /usr/bin/x264 with gpac shared lib instead static lib. * Sun Apr 28 2019 Leigh Scott - 0.155-3.20180806git0a84d98 - Fix opencl dlopen (rfbz#5185) From a5fc59d6e20aa1c5b35b80a7c544e7c055b04dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20M=2E=20Basto?= Date: Tue, 7 May 2019 02:52:00 +0100 Subject: [PATCH 4/6] Revert "Build /usr/bin/x264 with gpac shared lib instead static lib." This reverts commit 808c02f2380dfd5c387cdc98ef682728cb62bccf. --- x264-gpac.patch | 16 +++++++++------- x264.spec | 5 ++++- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/x264-gpac.patch b/x264-gpac.patch index 4b4604f..19d1a4e 100644 --- a/x264-gpac.patch +++ b/x264-gpac.patch @@ -1,11 +1,13 @@ ---- ./configure.orig 2019-05-07 00:00:16.289260869 +0100 -+++ ./configure 2019-05-07 00:03:39.415602593 +0100 -@@ -1199,7 +1199,7 @@ fi - +--- x264-0.140-20140122-de0bc36/configure.orig 2014-01-22 23:26:55.922650888 +0000 ++++ x264-0.140-20140122-de0bc36/configure 2014-02-24 02:35:19.263127505 +0000 +@@ -941,7 +941,9 @@ if [ "$gpac" = "auto" -a "$lsmash" != "yes" ] ; then gpac="no" -- GPAC_LIBS="-lgpac_static" -+ GPAC_LIBS="-lgpac" - cc_check "" -lz && GPAC_LIBS="$GPAC_LIBS -lz" + GPAC_LIBS="-lgpac_static" +- cc_check "" -lz && GPAC_LIBS="$GPAC_LIBS -lz" ++ for lib in -lz -lssl -lcrypto -lpng -ljpeg; do ++ cc_check "" $lib && GPAC_LIBS="$GPAC_LIBS $lib" ++ done if [ "$SYS" = "WINDOWS" ] ; then cc_check "" -lws2_32 && GPAC_LIBS="$GPAC_LIBS -lws2_32" + cc_check "" -lwinmm && GPAC_LIBS="$GPAC_LIBS -lwinmm" diff --git a/x264.spec b/x264.spec index ce1f5aa..a7175ea 100644 --- a/x264.spec +++ b/x264.spec @@ -31,7 +31,7 @@ Summary: H264/AVC video streams encoder Name: x264 Version: 0.%{api} -Release: 4%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} +Release: 5%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} License: GPLv2+ URL: https://www.videolan.org/developers/x264.html Source0: %{name}-0.%{api}-%{snapshot}.tar.bz2 @@ -209,6 +209,9 @@ install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/ %endif %changelog +* Tue May 07 2019 Sérgio Basto - 0.155-5.20180806git0a84d98 +- Revert "Build /usr/bin/x264 with gpac shared lib instead static lib." + * Mon May 06 2019 Sérgio Basto - 0.155-4.20180806git0a84d98 - Enable opencl (which is default) only exist --disable-opencl option - Disable opencl on 10bit seems that is just prepared for 8bit. From 7e32722fab8410d62c2cf5fbcbb1800237c874f5 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 4 Oct 2019 09:54:00 +0200 Subject: [PATCH 5/6] don't overwrite generic headers with 10bit on simdarch (rfbz#5071) --- x264.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/x264.spec b/x264.spec index a7175ea..5d42b93 100644 --- a/x264.spec +++ b/x264.spec @@ -31,7 +31,7 @@ Summary: H264/AVC video streams encoder Name: x264 Version: 0.%{api} -Release: 5%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} +Release: 6%{?gver}%{?_with_bootstrap:_bootstrap}%{?dist} License: GPLv2+ URL: https://www.videolan.org/developers/x264.html Source0: %{name}-0.%{api}-%{snapshot}.tar.bz2 @@ -159,7 +159,7 @@ pushd ${variant} popd done %ifarch %{simdarch} -for variant in simd simd10 ; do +for variant in simd10 simd ; do pushd ${variant} %make_install rm %{buildroot}%{slibdir}/pkgconfig/x264.pc @@ -209,6 +209,9 @@ install -pm644 generic/{AUTHORS,COPYING} %{buildroot}%{_pkgdocdir}/ %endif %changelog +* Fri Oct 04 2019 Dominik Mierzejewski - 0.155-6.20180806git0a84d98 +- don't overwrite generic headers with 10bit on simdarch (rfbz#5071) + * Tue May 07 2019 Sérgio Basto - 0.155-5.20180806git0a84d98 - Revert "Build /usr/bin/x264 with gpac shared lib instead static lib." From c696e2a46b7ed99fae5f8fcc93373b06034c5447 Mon Sep 17 00:00:00 2001 From: Dominik 'Rathann' Mierzejewski Date: Fri, 4 Oct 2019 09:57:23 +0200 Subject: [PATCH 6/6] whitespace cosmetics: replace tabs with spaces --- x264.spec | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/x264.spec b/x264.spec index 5d42b93..bbeaabc 100644 --- a/x264.spec +++ b/x264.spec @@ -86,13 +86,13 @@ This package contains the development files. %global x_configure \ %configure \\\ - %{?_without_libavformat:--disable-lavf} \\\ - %{?_without_libswscale:--disable-swscale} \\\ - %{!?_with_ffmpegsource:--disable-ffms} \\\ - --enable-debug \\\ - --enable-shared \\\ - --system-libx264 \\\ - --enable-pic + %{?_without_libavformat:--disable-lavf} \\\ + %{?_without_libswscale:--disable-swscale} \\\ + %{!?_with_ffmpegsource:--disable-ffms} \\\ + --enable-debug \\\ + --enable-shared \\\ + --system-libx264 \\\ + --enable-pic %prep %setup -q -c -n %{name}-0.%{api}-%{snapshot} @@ -117,17 +117,17 @@ done %build pushd generic %{x_configure}\ - %{?_without_asm:--disable-asm} + %{?_without_asm:--disable-asm} %{__make} %{?_smp_mflags} popd pushd generic10 %{x_configure}\ - %{?_without_asm:--disable-asm}\ - --disable-cli\ + %{?_without_asm:--disable-asm}\ + --disable-cli\ --disable-opencl \ - --bit-depth=10 + --bit-depth=10 %{__make} %{?_smp_mflags} popd @@ -135,17 +135,17 @@ popd %ifarch %{simdarch} pushd simd %{x_configure}\ - --libdir=%{slibdir} + --libdir=%{slibdir} %{__make} %{?_smp_mflags} popd pushd simd10 %{x_configure}\ - --disable-cli\ - --libdir=%{slibdir}\ + --disable-cli\ + --libdir=%{slibdir}\ --disable-opencl \ - --bit-depth=10 + --bit-depth=10 %{__make} %{?_smp_mflags} popd