summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2020-06-14 09:22:27 +0100
committerSergei Trofimovich <slyfox@gentoo.org>2020-06-14 09:36:20 +0100
commit4531c7dc10670235bb6ff4658eb05f6081d4e205 (patch)
tree61ed6d3fe7af4170901039209cd2dd12f7ecc7f3 /media-libs/x264
parentdev-python/addons: Remove last-rited pkg (diff)
downloadgentoo-4531c7dc10670235bb6ff4658eb05f6081d4e205.tar.gz
gentoo-4531c7dc10670235bb6ff4658eb05f6081d4e205.tar.bz2
gentoo-4531c7dc10670235bb6ff4658eb05f6081d4e205.zip
media-libs/x264: use tuple-prefixed tools
Two changes here: 1. backport upstream ee55c88ec commit ("configure: allow 'strings' override via STRINGS variable"). 2. set '--cross-prefix=${CHOST}-' to use tuple-prefixed tools by default. The change allows building x264 as-is on sys-devel/binutils-config[-native-symlinks] system. Package-Manager: Portage-2.3.100, Repoman-2.3.22 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'media-libs/x264')
-rw-r--r--media-libs/x264/files/x264-0.0.20190903-STRINGS.patch37
-rw-r--r--media-libs/x264/x264-0.0.20190903-r1.ebuild61
2 files changed, 98 insertions, 0 deletions
diff --git a/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch b/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch
new file mode 100644
index 000000000000..952fd268005b
--- /dev/null
+++ b/media-libs/x264/files/x264-0.0.20190903-STRINGS.patch
@@ -0,0 +1,37 @@
+From 235ce6130168f4deee55c88ecda5ab84d81d125b Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox@inbox.ru>
+Date: Fri, 5 Jun 2020 19:34:02 +0200
+Subject: [PATCH] configure: allow 'strings' override via STRINGS variable
+
+This allows building x264 on systems where 'strings' or
+'${HOST}-strings' does not exist, but llvm-strings exists.
+---
+ configure | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/configure
++++ b/configure
+@@ -541,6 +541,7 @@ done
+
+ CC="${CC-${cross_prefix}gcc}"
+ STRIP="${STRIP-${cross_prefix}strip}"
++STRINGS="${STRINGS-${cross_prefix}strings}"
+ INSTALL="${INSTALL-install}"
+ PKGCONFIG="${PKGCONFIG-${cross_prefix}pkg-config}"
+
+@@ -1017,10 +1018,10 @@ CPU_ENDIAN="little-endian"
+ if [ $compiler = GNU ]; then
+ echo "int i[2] = {0x42494745,0}; double f[2] = {0x1.0656e6469616ep+102,0};" > conftest.c
+ $CC $CFLAGS conftest.c -c -o conftest.o 2>/dev/null || die "endian test failed"
+- if (${cross_prefix}strings -a conftest.o | grep -q BIGE) && (${cross_prefix}strings -a conftest.o | grep -q FPendian) ; then
++ if (${STRINGS} -a conftest.o | grep -q BIGE) && (${STRINGS} -a conftest.o | grep -q FPendian) ; then
+ define WORDS_BIGENDIAN
+ CPU_ENDIAN="big-endian"
+- elif !(${cross_prefix}strings -a conftest.o | grep -q EGIB && ${cross_prefix}strings -a conftest.o | grep -q naidnePF) ; then
++ elif !(${STRINGS} -a conftest.o | grep -q EGIB && ${STRINGS} -a conftest.o | grep -q naidnePF) ; then
+ die "endian test failed"
+ fi
+ fi
+--
+2.27.0
+
diff --git a/media-libs/x264/x264-0.0.20190903-r1.ebuild b/media-libs/x264/x264-0.0.20190903-r1.ebuild
new file mode 100644
index 000000000000..452ddd0f1835
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20190903-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit flag-o-matic multilib-minimal toolchain-funcs
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="https://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://code.videolan.org/videolan/x264.git"
+else
+ MY_P="x264-snapshot-$(ver_cut 3)-2245"
+ SRC_URI="https://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+SLOT="0/157" # SONAME
+
+LICENSE="GPL-2"
+IUSE="cpu_flags_ppc_altivec +interlaced opencl pic static-libs cpu_flags_x86_sse +threads"
+
+ASM_DEP=">=dev-lang/nasm-2.13"
+DEPEND="abi_x86_32? ( ${ASM_DEP} )
+ abi_x86_64? ( ${ASM_DEP} )
+ opencl? ( dev-lang/perl )"
+RDEPEND="opencl? ( >=virtual/opencl-0-r3[${MULTILIB_USEDEP}] )"
+
+DOCS=( AUTHORS doc/{ratecontrol,regression_test,standards,threads,vui}.txt )
+
+PATCHES=("${FILESDIR}"/${P}-STRINGS.patch)
+
+multilib_src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ if [[ ${ABI} == x86* ]] && { use pic || use !cpu_flags_x86_sse ; } || [[ ${ABI} == "x32" ]] || [[ ${CHOST} == armv5* ]] || [[ ${ABI} == ppc* ]] && { use !cpu_flags_ppc_altivec ; }; then
+ asm_conf=" --disable-asm"
+ fi
+
+ "${S}/configure" \
+ --prefix="${EPREFIX}"/usr \
+ --libdir="${EPREFIX}"/usr/$(get_libdir) \
+ --disable-cli \
+ --disable-avs \
+ --disable-lavf \
+ --disable-swscale \
+ --disable-ffms \
+ --disable-gpac \
+ --enable-pic \
+ --enable-shared \
+ --host="${CHOST}" \
+ --cross-prefix="${CHOST}-" \
+ $(usex interlaced "" "--disable-interlaced") \
+ $(usex opencl "" "--disable-opencl") \
+ $(usex static-libs "--enable-static" "") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+}