From a489518383e4736d67bd5745a026d5f5f3b5e157 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 15 Aug 2012 11:36:59 -0400 Subject: [PATCH] Import libvpx ebuild. BUG=chromium-os:33547 TEST=`emerge libvpx` works TEST=`emerge-amd64-generic libvpx` works TEST=`emerge-x86-generic libvpx` works TEST=`emerge-arm-generic libvpx` works Change-Id: I34e6ee26d66f3eded3fff4e42e0facc60673c10c Reviewed-on: https://gerrit.chromium.org/gerrit/30196 Reviewed-by: Pawel Osciak Reviewed-by: Chih-Chung Chang Commit-Ready: Mike Frysinger Reviewed-by: Mike Frysinger Tested-by: Mike Frysinger --- .../portage-stable/media-libs/libvpx/Manifest | 1 + .../libvpx/files/libvpx-1.1.0-arm.patch | 38 ++++++++ .../libvpx/files/libvpx-1.1.0-chost.patch | 36 +++++++ .../libvpx-1.1.0-generic-gnu-shared.patch | 39 ++++++++ .../media-libs/libvpx/libvpx-1.1.0.ebuild | 94 +++++++++++++++++++ .../md5-cache/media-libs/libvpx-1.1.0 | 13 +++ 6 files changed, 221 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libvpx/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-arm.patch create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-chost.patch create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch create mode 100644 sdk_container/src/third_party/portage-stable/media-libs/libvpx/libvpx-1.1.0.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/metadata/md5-cache/media-libs/libvpx-1.1.0 diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libvpx/Manifest b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/Manifest new file mode 100644 index 0000000000..d9c7182a00 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/Manifest @@ -0,0 +1 @@ +DIST libvpx-v1.1.0.tar.bz2 1653485 RMD160 6f462c1421a51af77d3401ea4c1eaf0dbeaf4791 SHA1 356af5f770c50cd021c60863203d8f30164f6021 SHA256 9ce074cf4b3bcd9a49ff93e05485b71c273bfc3685a305e55a0e7fa51beb72c5 diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-arm.patch b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-arm.patch new file mode 100644 index 0000000000..698e65a2db --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-arm.patch @@ -0,0 +1,38 @@ +From 2b59e14a0023be9d084349d58ee156a49cc674bb Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Wed, 15 Aug 2012 11:55:31 -0400 +Subject: [PATCH] Parse out arm isa targets from dumpmachine + +The current parsing logic of the dumpmachine tuple lacks any arm +cases which means tgt_isa never gets set, so for all arm targets, +we get detected as generic-gnu. Add some basic arm checks here +so the automatic detection logic works. + +Change-Id: Ie5e98142876025c6708604236bc519c0bdb09319 +--- + build/make/configure.sh | 9 +++++++++ + 1 file changed, 9 insertions(+) + +diff --git a/build/make/configure.sh b/build/make/configure.sh +index 26eb864..eeb959a 100755 +--- a/build/make/configure.sh ++++ b/build/make/configure.sh +@@ -593,6 +593,15 @@ process_common_toolchain() { + + # detect tgt_isa + case "$gcctarget" in ++ armv6*) ++ tgt_isa=armv6 ++ ;; ++ armv7*) ++ tgt_isa=armv7 ++ ;; ++ armv5te*) ++ tgt_isa=armv5te ++ ;; + *x86_64*|*amd64*) + tgt_isa=x86_64 + ;; +-- +1.7.9.7 + diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-chost.patch b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-chost.patch new file mode 100644 index 0000000000..eb6b286cd6 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-chost.patch @@ -0,0 +1,36 @@ +commit 871bd23e4c41bb0fb94b72832b270766de540dea +Author: Alexis Ballier +Date: Sat May 12 15:45:13 2012 -0400 + + Allow target autodetection to work when cross-compiling. + + Allow CHOST to override the gcc -dumpmachine output. This allows to + use the target autodetection code when cross compiling by setting the + CHOST variable. + + On Gentoo, we would like to support easy cross-compilation, and for + libvpx this would basically mean copying the code in + build/make/configure.sh to setup the right --target option. It seems a + lot easier to let it guess by itself. + + Another option I considered was using CROSS-gcc instead but this would + not work for our multilib setups: They use gcc -m32 to build 32bits + binaries and gcc -m32 -dumpmachine will output the 64bits version, + which would then make libvpx wrongly believe it is building for a + 64bits architecture. + + Change-Id: I05a19be402228f749e23be7473ca53ae74fd2186 + +diff --git a/build/make/configure.sh b/build/make/configure.sh +index 3c772e5..3118c0a 100755 +--- a/build/make/configure.sh ++++ b/build/make/configure.sh +@@ -549,7 +549,7 @@ setup_gnu_toolchain() { + + process_common_toolchain() { + if [ -z "$toolchain" ]; then +- gcctarget="$(gcc -dumpmachine 2> /dev/null)" ++ gcctarget="${CHOST:-$(gcc -dumpmachine 2> /dev/null)}" + + # detect tgt_isa + case "$gcctarget" in diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch new file mode 100644 index 0000000000..84d536f505 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/files/libvpx-1.1.0-generic-gnu-shared.patch @@ -0,0 +1,39 @@ +From b4ab43f12cc44a24e8161eb2d0857b78c756b18c Mon Sep 17 00:00:00 2001 +From: Mike Frysinger +Date: Tue, 14 Aug 2012 14:24:28 -0400 +Subject: [PATCH] do not error out on generic-gnu + --enable-shared + +If you build with --enabled-shared on a Linux arch not explicitly +listed, the configure script will abort because it didn't detect +"linux" in the fallback generic-gnu tuple. + +Since this is the fallback tuple and people are passing +--enable-shared, assume the user knows what they're in for. + +Change-Id: Ia35b657e7247c8855e3a94fca424c9884d4241e3 +--- + configure | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 2e19e5b..dde215f 100755 +--- a/configure ++++ b/configure +@@ -454,7 +454,13 @@ process_detect() { + # Can only build shared libs on a subset of platforms. Doing this check + # here rather than at option parse time because the target auto-detect + # magic happens after the command line has been parsed. +- enabled linux || die "--enable-shared only supported on ELF for now" ++ if ! enabled linux; then ++ if enabled gnu; then ++ echo "--enable-shared is only supported on ELF; assuming this is OK" ++ else ++ die "--enable-shared only supported on ELF for now" ++ fi ++ fi + fi + if [ -z "$CC" ]; then + echo "Bypassing toolchain for environment detection." +-- +1.7.9.7 + diff --git a/sdk_container/src/third_party/portage-stable/media-libs/libvpx/libvpx-1.1.0.ebuild b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/libvpx-1.1.0.ebuild new file mode 100644 index 0000000000..bd19a1b4d6 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/media-libs/libvpx/libvpx-1.1.0.ebuild @@ -0,0 +1,94 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/media-libs/libvpx/libvpx-1.1.0.ebuild,v 1.13 2012/08/16 18:53:27 vapier Exp $ + +EAPI=4 +inherit multilib toolchain-funcs base + +if [[ ${PV} == *9999* ]]; then + inherit git-2 + EGIT_REPO_URI="http://git.chromium.org/webm/${PN}.git" + KEYWORDS="" +elif [[ ${PV} == *pre* ]]; then + SRC_URI="mirror://gentoo/${P}.tar.bz2" + KEYWORDS="~alpha amd64 arm ~ia64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" +else + SRC_URI="http://webm.googlecode.com/files/${PN}-v${PV}.tar.bz2" + KEYWORDS="~alpha amd64 arm ~ia64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux" + S="${WORKDIR}/${PN}-v${PV}" +fi + +DESCRIPTION="WebM VP8 Codec SDK" +HOMEPAGE="http://www.webmproject.org" + +LICENSE="BSD" +SLOT="0" +IUSE="altivec debug doc mmx postproc sse sse2 sse3 ssse3 sse4_1 static-libs +threads" + +RDEPEND="" +DEPEND="amd64? ( dev-lang/yasm ) + x86? ( dev-lang/yasm ) + x86-fbsd? ( dev-lang/yasm ) + doc? ( + app-doc/doxygen + dev-lang/php + ) +" + +REQUIRED_USE=" + sse2? ( mmx ) + " + +PATCHES=( + "${FILESDIR}/${P}-chost.patch" + "${FILESDIR}/${P}-generic-gnu-shared.patch" + "${FILESDIR}/${P}-arm.patch" +) + +src_configure() { + #let the build system decide which AS to use (it honours $AS but + #then feeds it with yasm flags without checking...) bug 345161 + local a + tc-export AS + for a in {amd64,x86}{,-{fbsd,linux}} ; do + use ${a} && unset AS + done + + # build verbose by default + MAKEOPTS="${MAKEOPTS} verbose=yes" + + # http://bugs.gentoo.org/show_bug.cgi?id=384585 + addpredict /usr/share/snmp/mibs/.index + + # Build with correct toolchain. + tc-export CC AR NM + # Link with gcc by default, the build system should override this if needed. + export LD="${CC}" + + ./configure \ + --prefix="${EPREFIX}"/usr \ + --libdir="${EPREFIX}"/usr/$(get_libdir) \ + --enable-pic \ + --enable-vp8 \ + --enable-shared \ + --extra-cflags="${CFLAGS}" \ + $(use_enable altivec) \ + $(use_enable debug debug-libs) \ + $(use_enable debug) \ + $(use_enable doc install-docs) \ + $(use_enable mmx) \ + $(use_enable postproc) \ + $(use_enable sse) \ + $(use_enable sse2) \ + $(use_enable sse3) \ + $(use_enable sse4_1) \ + $(use_enable ssse3) \ + $(use_enable static-libs static ) \ + $(use_enable threads multithread) \ + || die +} + +src_install() { + # Override base.eclass's src_install. + default +} diff --git a/sdk_container/src/third_party/portage-stable/metadata/md5-cache/media-libs/libvpx-1.1.0 b/sdk_container/src/third_party/portage-stable/metadata/md5-cache/media-libs/libvpx-1.1.0 new file mode 100644 index 0000000000..f9d3366c90 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/metadata/md5-cache/media-libs/libvpx-1.1.0 @@ -0,0 +1,13 @@ +DEFINED_PHASES=compile configure install prepare unpack +DEPEND=amd64? ( dev-lang/yasm ) x86? ( dev-lang/yasm ) x86-fbsd? ( dev-lang/yasm ) doc? ( app-doc/doxygen dev-lang/php ) +DESCRIPTION=WebM VP8 Codec SDK +EAPI=4 +HOMEPAGE=http://www.webmproject.org +IUSE=altivec debug doc mmx postproc sse sse2 sse3 ssse3 sse4_1 static-libs +threads +KEYWORDS=~alpha amd64 arm ~ia64 ~ppc ~ppc64 x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux +LICENSE=BSD +REQUIRED_USE=sse2? ( mmx ) +SLOT=0 +SRC_URI=http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2 +_eclasses_=base fc89786f3f7e7bcf03334359bd5b639b eutils 33ef77a15337022e05342d2c772a7a5a multilib 5f4ad6cf85e365e8f0c6050ddd21659e portability 0be430f759a631e692678ed796e09f5c toolchain-funcs 6526ac6fc9aedf391efb91fcd75ace68 user 9e552f935106ff0bc92af16da64b4b29 +_md5_=dd5dc66f2d0c8701257fc49de043f5e3