Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2019 11:42:24 +0000 (UTC)
From:      Piotr Kubaj <pkubaj@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r518318 - in head/multimedia/handbrake: . files
Message-ID:  <201911241142.xAOBgOJG024171@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pkubaj
Date: Sun Nov 24 11:42:24 2019
New Revision: 518318
URL: https://svnweb.freebsd.org/changeset/ports/518318

Log:
  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)

Added:
  head/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch   (contents, props changed)
  head/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch   (contents, props changed)
  head/multimedia/handbrake/files/patch-make_variant_freebsd.defs   (contents, props changed)
Modified:
  head/multimedia/handbrake/Makefile

Modified: head/multimedia/handbrake/Makefile
==============================================================================
--- head/multimedia/handbrake/Makefile	Sun Nov 24 11:27:43 2019	(r518317)
+++ head/multimedia/handbrake/Makefile	Sun Nov 24 11:42:24 2019	(r518318)
@@ -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}

Added: head/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/handbrake/files/patch-contrib_libvpx_P05-freebsd-ppc.patch	Sun Nov 24 11:42:24 2019	(r518318)
@@ -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"

Added: head/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/handbrake/files/patch-contrib_x265_P01-freebsd-ppc.patch	Sun Nov 24 11:42:24 2019	(r518318)
@@ -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++)
++                 {

Added: head/multimedia/handbrake/files/patch-make_variant_freebsd.defs
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/handbrake/files/patch-make_variant_freebsd.defs	Sun Nov 24 11:42:24 2019	(r518318)
@@ -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), ), )



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911241142.xAOBgOJG024171>