git: d0c99cee5491 - main - multimedia/handbrake: fix build on powerpc64le
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 07 Jun 2026 09:14:56 UTC
The branch main has been updated by pkubaj:
URL: https://cgit.FreeBSD.org/ports/commit/?id=d0c99cee5491423bb94be17a2bd6d2329e4f83eb
commit d0c99cee5491423bb94be17a2bd6d2329e4f83eb
Author: Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-06-06 20:36:54 +0000
Commit: Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-06-07 09:13:27 +0000
multimedia/handbrake: fix build on powerpc64le
1. Clang doesn't like -mabi=altivec.
2. x265's Altivec code is only valid for 8 bit.
---
multimedia/handbrake/Makefile | 7 +++++++
.../handbrake/files/P00-freebsd-x265-mabi-altivec.patch | 11 +++++++++++
.../handbrake/files/patch-contrib_x265__10bit_module.defs | 11 +++++++++++
.../handbrake/files/patch-contrib_x265__12bit_module.defs | 11 +++++++++++
4 files changed, 40 insertions(+)
diff --git a/multimedia/handbrake/Makefile b/multimedia/handbrake/Makefile
index cceb5faa3782..3b5e9238b9f3 100644
--- a/multimedia/handbrake/Makefile
+++ b/multimedia/handbrake/Makefile
@@ -116,6 +116,13 @@ pre-configure:
${INSTALL_DATA} ${CONTRIB_FILES} \
${WRKSRC}/download
+# x265's CMakeLists.txt adds the GCC-only `-mabi=altivec` flag on POWER, which
+# clang rejects. Hand it to HandBrake's contrib patch machinery, which applies
+# `P??-freebsd*.patch` to the bundled x265 source at build time.
+post-patch:
+ ${CP} ${FILESDIR}/P00-freebsd-x265-mabi-altivec.patch \
+ ${WRKSRC}/contrib/x265
+
# Some unbundled software uses a hardcoded `lib/pkgconfig` directory for .pc
# files. But the unbundled software built by Meson correctly places the .pc
# file in `libdata/pkgconfig` in the FreeBSD way. To handle these two kinds of
diff --git a/multimedia/handbrake/files/P00-freebsd-x265-mabi-altivec.patch b/multimedia/handbrake/files/P00-freebsd-x265-mabi-altivec.patch
new file mode 100644
index 000000000000..d6f6d3ce735d
--- /dev/null
+++ b/multimedia/handbrake/files/P00-freebsd-x265-mabi-altivec.patch
@@ -0,0 +1,11 @@
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -780,7 +780,7 @@ if(POWER)
+ # IBM Power8
+ option(ENABLE_ALTIVEC "Enable ALTIVEC profiling instrumentation" ON)
+ if(ENABLE_ALTIVEC)
+- add_definitions(-DHAVE_ALTIVEC=1 -maltivec -mabi=altivec)
++ add_definitions(-DHAVE_ALTIVEC=1 -maltivec)
+ add_definitions(-flax-vector-conversions -fpermissive)
+ else()
+ add_definitions(-DHAVE_ALTIVEC=0)
diff --git a/multimedia/handbrake/files/patch-contrib_x265__10bit_module.defs b/multimedia/handbrake/files/patch-contrib_x265__10bit_module.defs
new file mode 100644
index 000000000000..94811a2deb51
--- /dev/null
+++ b/multimedia/handbrake/files/patch-contrib_x265__10bit_module.defs
@@ -0,0 +1,11 @@
+--- contrib/x265_10bit/module.defs.orig 2026-03-22 14:31:00 UTC
++++ contrib/x265_10bit/module.defs
+@@ -16,7 +16,7 @@
+ X265_10.CONFIGURE.deps =
+ X265_10.CONFIGURE.static =
+ X265_10.CONFIGURE.shared = -DENABLE_SHARED=OFF
+-X265_10.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy
++X265_10.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_ALTIVEC=OFF -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy
+
+ ifneq (1,$(FEATURE.numa))
+ X265_10.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF
diff --git a/multimedia/handbrake/files/patch-contrib_x265__12bit_module.defs b/multimedia/handbrake/files/patch-contrib_x265__12bit_module.defs
new file mode 100644
index 000000000000..8589bff70b84
--- /dev/null
+++ b/multimedia/handbrake/files/patch-contrib_x265__12bit_module.defs
@@ -0,0 +1,11 @@
+--- contrib/x265_12bit/module.defs.orig 2026-03-22 14:31:00 UTC
++++ contrib/x265_12bit/module.defs
+@@ -16,7 +16,7 @@
+ X265_12.CONFIGURE.deps =
+ X265_12.CONFIGURE.static =
+ X265_12.CONFIGURE.shared = -DENABLE_SHARED=OFF
+-X265_12.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DMAIN12=ON -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy
++X265_12.CONFIGURE.extra = -DENABLE_CLI=OFF -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF -DENABLE_ALTIVEC=OFF -DMAIN12=ON -DCMAKE_ASM_NASM_FLAGS=-w-macro-params-legacy
+
+ ifneq (1,$(FEATURE.numa))
+ X265_12.CONFIGURE.extra += -DENABLE_LIBNUMA=OFF