mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-22 10:57:07 -08:00
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>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user