aboutsummaryrefslogtreecommitdiff
path: root/multimedia/handbrake
diff options
context:
space:
mode:
authorPiotr Kubaj <pkubaj@FreeBSD.org>2019-11-24 11:42:24 +0000
committerPiotr Kubaj <pkubaj@FreeBSD.org>2019-11-24 11:42:24 +0000
commitd1ec063c7004ebbb2695cdacdfe8cf50ffa36774 (patch)
tree9ba85d2c309ab82d50b00d6ba3f524376a6670fa /multimedia/handbrake
parent10538d905e5d06fe102aa600de53609a05935e20 (diff)
downloadports-d1ec063c7004ebbb2695cdacdfe8cf50ffa36774.tar.gz
ports-d1ec063c7004ebbb2695cdacdfe8cf50ffa36774.zip
multimedia/handbrake: fix build on powerpc64
Use C11 compiler, because of ffmpeg. Correct comment typo. Don't include asm/cputable.h and linux/auxvec.h in libvpx-1.7.0/vpx_ports/ppc_cpudetect.c - those headers are Linux-only. Merge upstream patch from x265 to fix compilation on non-x86. Don't link with libc++ when using GCC. PR: 241928 Approved by: naito.yuichiro@gmail.com (maintainer), linimon (mentor)
Notes
Notes: svn path=/head/; revision=518318
Diffstat (limited to 'multimedia/handbrake')
-rw-r--r--multimedia/handbrake/Makefile7
-rw-r--r--multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch14
-rw-r--r--multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch53
-rw-r--r--multimedia/handbrake/files/patch-make_variant_freebsd.defs8
4 files changed, 78 insertions, 4 deletions
diff --git a/multimedia/handbrake/Makefile b/multimedia/handbrake/Makefile
index 46986ede4da8..3f812f992724 100644
--- a/multimedia/handbrake/Makefile
+++ b/multimedia/handbrake/Makefile
@@ -13,8 +13,7 @@ COMMENT= Versatile DVD ripper and video transcoder
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/COPYING
-ONLY_FOR_ARCHS= amd64 i386
-ONLY_FOR_ARCHS_REASON= invokes x86 assembler
+ONLY_FOR_ARCHS= amd64 i386 powerpc64
BUILD_DEPENDS= bash:shells/bash \
nasm:devel/nasm \
@@ -54,7 +53,7 @@ LIB_DEPENDS+= libdvdcss.so:multimedia/libdvdcss
.endif
GNU_CONFIGURE= yes
-USES= autoreconf:build compiler:features gmake iconv \
+USES= autoreconf:build compiler:c11 gmake iconv \
libtool:build localbase:ldflags pkgconfig python:2.7,build
MAKE_ENV= V=1 ACLOCAL=${LOCALBASE}/bin/aclocal
@@ -101,7 +100,7 @@ X11_USE= gstreamer1=gdkpixbuf,libav \
gnome=gtk30,intltool,cairo,gdkpixbuf2
# HandBrake tries to fetch its dependencies during build phase, which is not
-# considered good in FreeBSD. Instead, we will provided the downloaded files.
+# considered good in FreeBSD. Instead, we will provide the downloaded files.
post-extract: .SILENT
${MKDIR} ${WRKSRC}/download
.for f in ${CONTRIB_FILES}
diff --git a/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch b/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch
new file mode 100644
index 000000000000..9f81fca45b55
--- /dev/null
+++ b/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch
@@ -0,0 +1,14 @@
+--- contrib/libvpx/P05-freebsd-ppc.patch.orig 2019-11-12 14:12:26 UTC
++++ contrib/libvpx/P05-freebsd-ppc.patch
+@@ -0,0 +1,11 @@
++--- libvpx-1.7.0/vpx_ports/ppc_cpudetect.c.orig 2019-11-12 15:11:30.139706000 +0100
+++++ libvpx-1.7.0/vpx_ports/ppc_cpudetect.c
++@@ -11,8 +11,6 @@
++ #include <fcntl.h>
++ #include <unistd.h>
++ #include <stdint.h>
++-#include <asm/cputable.h>
++-#include <linux/auxvec.h>
++
++ #include "./vpx_config.h"
++ #include "vpx_ports/ppc.h"
diff --git a/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch b/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch
new file mode 100644
index 000000000000..e58fbc424c7b
--- /dev/null
+++ b/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch
@@ -0,0 +1,53 @@
+--- contrib/x265/P01-freebsd-ppc.patch.orig 2019-11-12 19:13:27 UTC
++++ contrib/x265/P01-freebsd-ppc.patch
+@@ -0,0 +1,50 @@
++--- x265_2.9/source/common/cpu.cpp.orig 2019-11-12 20:19:28.629150000 +0100
+++++ x265_2.9/source/common/cpu.cpp
++@@ -127,6 +127,7 @@
++ {
++ return(enable512);
++ }
+++
++ uint32_t cpu_detect(bool benableavx512 )
++ {
++
++--- x265_2.9/source/common/quant.cpp.orig 2019-11-12 20:19:34.848807000 +0100
+++++ x265_2.9/source/common/quant.cpp
++@@ -723,6 +723,7 @@
++ X265_CHECK(coeffNum[cgScanPos] == 0, "count of coeff failure\n");
++ uint32_t scanPosBase = (cgScanPos << MLS_CG_SIZE);
++ uint32_t blkPos = codeParams.scan[scanPosBase];
+++#if X265_ARCH_X86
++ bool enable512 = detect512();
++ if (enable512)
++ primitives.cu[log2TrSize - 2].psyRdoQuant(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
++@@ -731,6 +732,10 @@
++ primitives.cu[log2TrSize - 2].psyRdoQuant_1p(m_resiDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost,blkPos);
++ primitives.cu[log2TrSize - 2].psyRdoQuant_2p(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
++ }
+++#else
+++ primitives.cu[log2TrSize - 2].psyRdoQuant_1p(m_resiDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, blkPos);
+++ primitives.cu[log2TrSize - 2].psyRdoQuant_2p(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+++#endif
++ }
++ }
++ else
++@@ -805,6 +810,7 @@
++ uint32_t blkPos = codeParams.scan[scanPosBase];
++ if (usePsyMask)
++ {
+++#if X265_ARCH_X86
++ bool enable512 = detect512();
++
++ if (enable512)
++@@ -814,6 +820,10 @@
++ primitives.cu[log2TrSize - 2].psyRdoQuant_1p(m_resiDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, blkPos);
++ primitives.cu[log2TrSize - 2].psyRdoQuant_2p(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
++ }
+++#else
+++ primitives.cu[log2TrSize - 2].psyRdoQuant_1p(m_resiDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, blkPos);
+++ primitives.cu[log2TrSize - 2].psyRdoQuant_2p(m_resiDctCoeff, m_fencDctCoeff, costUncoded, &totalUncodedCost, &totalRdCost, &psyScale, blkPos);
+++#endif
++ blkPos = codeParams.scan[scanPosBase];
++ for (int y = 0; y < MLS_CG_SIZE; y++)
++ {
diff --git a/multimedia/handbrake/files/patch-make_variant_freebsd.defs b/multimedia/handbrake/files/patch-make_variant_freebsd.defs
new file mode 100644
index 000000000000..f46dbb9e1abb
--- /dev/null
+++ b/multimedia/handbrake/files/patch-make_variant_freebsd.defs
@@ -0,0 +1,8 @@
+--- make/variant/freebsd.defs.orig 2019-02-22 17:23:51.000000000 +0100
++++ make/variant/freebsd.defs 2019-11-17 20:08:28.821497000 +0100
+@@ -15,4 +15,4 @@
+
+ GCC.MAJOR_VERSION = $(shell $(GCC.gcc) -dumpversion | cut -f 1 -d .)
+ GCC.LDFLAGS = -lc++ -Wl,-rpath=$(LOCALBASE)/lib/gcc$(GCC.MAJOR_VERSION)
+-LDFLAGS += $(if $(findstring gcc, $(GCC.gcc)), $(GCC.LDFLAGS), )
++LDFLAGS += $(if $(findstring gcc, $(GCC.gcc)), $(if $(findstring x86, $(GCC.archs)), $(GCC.LDFLAGS), ), )