summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /media-libs/x264
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'media-libs/x264')
-rw-r--r--media-libs/x264/Manifest7
-rw-r--r--media-libs/x264/files/x264-0.0.20120707-gcc48.patch138
-rw-r--r--media-libs/x264/files/x264-0.0.20130731-cflags.patch62
-rw-r--r--media-libs/x264/files/x264-0.0.20130912-cflags.patch54
-rw-r--r--media-libs/x264/files/x264-cflags.patch55
-rw-r--r--media-libs/x264/files/x264-nostrip.patch16
-rw-r--r--media-libs/x264/files/x264-onlylib-20110425.patch30
-rw-r--r--media-libs/x264/files/x264-x32.patch34
-rw-r--r--media-libs/x264/metadata.xml14
-rw-r--r--media-libs/x264/x264-0.0.20111220.ebuild88
-rw-r--r--media-libs/x264/x264-0.0.20120327.ebuild88
-rw-r--r--media-libs/x264/x264-0.0.20120707.ebuild104
-rw-r--r--media-libs/x264/x264-0.0.20130506.ebuild82
-rw-r--r--media-libs/x264/x264-0.0.20130731.ebuild71
-rw-r--r--media-libs/x264/x264-0.0.20130912.ebuild71
-rw-r--r--media-libs/x264/x264-0.0.20140308.ebuild73
-rw-r--r--media-libs/x264/x264-9999.ebuild73
17 files changed, 1060 insertions, 0 deletions
diff --git a/media-libs/x264/Manifest b/media-libs/x264/Manifest
new file mode 100644
index 000000000000..22b65d8c99c7
--- /dev/null
+++ b/media-libs/x264/Manifest
@@ -0,0 +1,7 @@
+DIST x264-snapshot-20111220-2245.tar.bz2 532402 SHA256 c360b0320cc72a77c5f2ececbd100bbbdd0461227f7c4bc06212e86f5aa0fb8a SHA512 d6801f326f9848672f889cb9fe43da865b2351143b8f31f17341c62b89ac01f430cdc56c12d8bf9cf9f041e8381494915a84508eaf41898ef87631385ee6f3c2 WHIRLPOOL 6aed824854947435819d157c2c371ca358ce05d518adcfea9ec6c47a74bdd97d9c527e989b9eb0a6d2f00060c45186d3a3ade22af21d450c9e2c25be9aa46b34
+DIST x264-snapshot-20120327-2245.tar.bz2 551101 SHA256 065ffdbd7c9f9dcc7194bd6a4943b0d4b2e99b5dd68979fb3634644c725c2cbe SHA512 915e2933596f4809a7cba25a6eb7f8a555daaeeb3a5a95a314cb947940d562e12d164f52ab6b94d7abd52e66ee986d3414c54685390a619357eef22ba0cd6a6a WHIRLPOOL e61b779d9eba7cad48899bc7eb88e9b5e140013d016792ddd4d2c149f7447d8bbf528615b751c095813519218bc7e3072ded407c386043dff8270d2c43a7ecb9
+DIST x264-snapshot-20120707-2245.tar.bz2 554243 SHA256 52fdc8b558fa7dcb6419fef73fb07e771cdc2544f7652cde42968d640139eedb SHA512 5e263dfe4b4defd66a8a855467692473723ada9c34ab8da7042f2d10327f944914d0c8103f22edd4dc7a1c4664db5bfbf42052652c9f57b392db32f4ab77081b WHIRLPOOL 1a9061e5940e22071390b579abf859fec49f8da51f31e241b65513566eda66178c46b4b4c20318bb981230a16511e84b89e6174bc7f9ccbd48915a909cef3b5b
+DIST x264-snapshot-20130506-2245.tar.bz2 608013 SHA256 da7055a457d19b97ff35a2830e7caae665ea06d22ddc28393168983d1cd21f61 SHA512 6ba35f6b39fefbda6990dc0fd674efbe403b0616f2f02d71ae3e7bbc6ce2bab8878a963dd5f306f8a2b3b9a74c5c0b4dbf9dfb9dc0e602b807f726cf072905b5 WHIRLPOOL bfb4b7dd0e865cd9305ac177f5c544555004039209dda695fcc932aab647b87c96f0bae4fa040276bd3dbee64dcf982f3c2447efdbc01c1d42f040c9d5d0af85
+DIST x264-snapshot-20130731-2245.tar.bz2 625052 SHA256 caa39660f2ddc9dc53033af709452a21479c7b7c715c5f9d744d0d452c2d9e67 SHA512 2abcab4013dee9ac58779afd89fc558a8286cf33affda037e95a7e10cf00387cee1ad461ac59c5020fd9b72d303170f16d4e4b5593ec21528a33b0f530878d9d WHIRLPOOL 6f7fcc1c05c47a0d31578fbd0268b84ba458a968b087fb7d1050f67739bec140a1c3ded288cd0000180b5be921b469357ec9cdc363fc1eec82d82bd795557b56
+DIST x264-snapshot-20130912-2245.tar.bz2 628862 SHA256 87142cf15b7d7052f2e046a4b80adc3176fd6421889ab3bae83afc10d57ec648 SHA512 3e2223ca465b1ac214a421c512477524309694f321baabcd62b84bc341de34ecf196c8c91a931bbda0d7538dc138b924dc22ed7f242e135e4b53b387638b40c0 WHIRLPOOL b795a91511994761e9cf6e3a279708e4536ebc281b9ca1d18f0bceb93c89c062608d2e5c779a0f924d2dc005f90921223b42b22e409eaaca8a0041aae354213f
+DIST x264-snapshot-20140308-2245.tar.bz2 624712 SHA256 b179cb1e1d4f51418d292011a7494d5b62145571c05c22007f28d8fd89d2ebbe SHA512 42dc8183aa7af2bd4c360edc0349193cf69a119450880af0c1586e8f27490d7c6784c464b29c9f07ae972aaf661672ab4f2094a46a3d19b6df35be1f9d9a1629 WHIRLPOOL b1ac3341647d9d8d8ff6177f179ee8b5d6a49a38a48791748c24d5cd3c53858758785a0d21d42fbe373ec74465d947b69526a487da15fbca1a1f9aa50064288c
diff --git a/media-libs/x264/files/x264-0.0.20120707-gcc48.patch b/media-libs/x264/files/x264-0.0.20120707-gcc48.patch
new file mode 100644
index 000000000000..16cb4bff0018
--- /dev/null
+++ b/media-libs/x264/files/x264-0.0.20120707-gcc48.patch
@@ -0,0 +1,138 @@
+From 6129dbe86484393a2ea520be94ef9b550b0bd113 Mon Sep 17 00:00:00 2001
+From: Jason Garrett-Glaser <jason@x264.com>
+Date: Wed, 27 Feb 2013 13:30:22 -0800
+Subject: [PATCH] Fix array overreads that caused miscompilation in gcc 4.8
+
+---
+ common/common.h | 1 +
+ common/set.c | 78 +++++++++++++++++++++++++++++++-------------------------
+ tools/checkasm.c | 2 +-
+ 3 files changed, 45 insertions(+), 36 deletions(-)
+
+diff --git a/common/common.h b/common/common.h
+index 39ad5cb..0da1d43 100644
+--- a/common/common.h
++++ b/common/common.h
+@@ -40,6 +40,7 @@
+ #define IS_DISPOSABLE(type) ( type == X264_TYPE_B )
+ #define FIX8(f) ((int)(f*(1<<8)+.5))
+ #define ALIGN(x,a) (((x)+((a)-1))&~((a)-1))
++#define ARRAY_ELEMS(a) ((sizeof(a))/(sizeof(a[0])))
+
+ #define CHECKED_MALLOC( var, size )\
+ do {\
+diff --git a/common/set.c b/common/set.c
+index 4c72125..fa8b158 100644
+--- a/common/set.c
++++ b/common/set.c
+@@ -85,44 +85,49 @@ int x264_cqm_init( x264_t *h )
+ int max_qp_err = -1;
+ int max_chroma_qp_err = -1;
+ int min_qp_err = QP_MAX+1;
+- int num_8x8_lists = h->sps->i_chroma_format_idc == CHROMA_444 ? 4 : 2; /* Checkasm may segfault if optimized out by --chroma-format */
++ int num_8x8_lists = h->sps->i_chroma_format_idc == CHROMA_444 ? 4
++ : h->param.analyse.b_transform_8x8 ? 2 : 0; /* Checkasm may segfault if optimized out by --chroma-format */
+
+- for( int i = 0; i < 4 + num_8x8_lists; i++ )
+- {
+- int size = i<4 ? 16 : 64;
+- int j;
+- for( j = (i<4 ? 0 : 4); j < i; j++ )
+- if( !memcmp( h->pps->scaling_list[i], h->pps->scaling_list[j], size*sizeof(uint8_t) ) )
+- break;
+- if( j < i )
+- {
+- h-> quant4_mf[i] = h-> quant4_mf[j];
+- h->dequant4_mf[i] = h->dequant4_mf[j];
+- h->unquant4_mf[i] = h->unquant4_mf[j];
+- }
+- else
+- {
+- CHECKED_MALLOC( h-> quant4_mf[i], (QP_MAX+1)*size*sizeof(udctcoef) );
+- CHECKED_MALLOC( h->dequant4_mf[i], 6*size*sizeof(int) );
+- CHECKED_MALLOC( h->unquant4_mf[i], (QP_MAX+1)*size*sizeof(int) );
+- }
+-
+- for( j = (i<4 ? 0 : 4); j < i; j++ )
+- if( deadzone[j&3] == deadzone[i&3] &&
+- !memcmp( h->pps->scaling_list[i], h->pps->scaling_list[j], size*sizeof(uint8_t) ) )
+- break;
+- if( j < i )
+- {
+- h->quant4_bias[i] = h->quant4_bias[j];
+- h->quant4_bias0[i] = h->quant4_bias0[j];
+- }
+- else
+- {
+- CHECKED_MALLOC( h->quant4_bias[i], (QP_MAX+1)*size*sizeof(udctcoef) );
+- CHECKED_MALLOC( h->quant4_bias0[i], (QP_MAX+1)*size*sizeof(udctcoef) );
+- }
++#define CQM_ALLOC( w, count )\
++ for( int i = 0; i < count; i++ )\
++ {\
++ int size = w*w;\
++ int start = w == 8 ? 4 : 0;\
++ int j;\
++ for( j = 0; j < i; j++ )\
++ if( !memcmp( h->pps->scaling_list[i+start], h->pps->scaling_list[j+start], size*sizeof(uint8_t) ) )\
++ break;\
++ if( j < i )\
++ {\
++ h-> quant##w##_mf[i] = h-> quant##w##_mf[j];\
++ h->dequant##w##_mf[i] = h->dequant##w##_mf[j];\
++ h->unquant##w##_mf[i] = h->unquant##w##_mf[j];\
++ }\
++ else\
++ {\
++ CHECKED_MALLOC( h-> quant##w##_mf[i], (QP_MAX+1)*size*sizeof(udctcoef) );\
++ CHECKED_MALLOC( h->dequant##w##_mf[i], 6*size*sizeof(int) );\
++ CHECKED_MALLOC( h->unquant##w##_mf[i], (QP_MAX+1)*size*sizeof(int) );\
++ }\
++ for( j = 0; j < i; j++ )\
++ if( deadzone[j] == deadzone[i] &&\
++ !memcmp( h->pps->scaling_list[i+start], h->pps->scaling_list[j+start], size*sizeof(uint8_t) ) )\
++ break;\
++ if( j < i )\
++ {\
++ h->quant##w##_bias[i] = h->quant##w##_bias[j];\
++ h->quant##w##_bias0[i] = h->quant##w##_bias0[j];\
++ }\
++ else\
++ {\
++ CHECKED_MALLOC( h->quant##w##_bias[i], (QP_MAX+1)*size*sizeof(udctcoef) );\
++ CHECKED_MALLOC( h->quant##w##_bias0[i], (QP_MAX+1)*size*sizeof(udctcoef) );\
++ }\
+ }
+
++ CQM_ALLOC( 4, 4 )
++ CQM_ALLOC( 8, num_8x8_lists )
++
+ for( int q = 0; q < 6; q++ )
+ {
+ for( int i = 0; i < 16; i++ )
+@@ -204,6 +209,9 @@ int x264_cqm_init( x264_t *h )
+ for( int cat = 0; cat < 3 + CHROMA444; cat++ )
+ {
+ int dct8x8 = cat&1;
++ if( !h->param.analyse.b_transform_8x8 && dct8x8 )
++ continue;
++
+ int size = dct8x8 ? 64 : 16;
+ udctcoef *nr_offset = h->nr_offset_emergency[q][cat];
+ /* Denoise chroma first (due to h264's chroma QP offset), then luma, then DC. */
+diff --git a/tools/checkasm.c b/tools/checkasm.c
+index 9135b70..441687b 100644
+--- a/tools/checkasm.c
++++ b/tools/checkasm.c
+@@ -309,7 +309,7 @@ static int check_pixel( int cpu_ref, int cpu_new )
+
+ #define TEST_PIXEL( name, align ) \
+ ok = 1, used_asm = 0; \
+- for( int i = 0; i < 8; i++ ) \
++ for( int i = 0; i < ARRAY_ELEMS(pixel_c.name); i++ ) \
+ { \
+ int res_c, res_asm; \
+ if( pixel_asm.name[i] != pixel_ref.name[i] ) \
+--
+1.8.1.5
+
diff --git a/media-libs/x264/files/x264-0.0.20130731-cflags.patch b/media-libs/x264/files/x264-0.0.20130731-cflags.patch
new file mode 100644
index 000000000000..3014b47eca8e
--- /dev/null
+++ b/media-libs/x264/files/x264-0.0.20130731-cflags.patch
@@ -0,0 +1,62 @@
+https://bugs.gentoo.org/420241 for x32 stuff
+initial x32 support -- no asm code, just pure C
+
+avoid messing too much with CFLAGS.
+https://bugs.gentoo.org/show_bug.cgi?id=351219
+https://bugs.gentoo.org/show_bug.cgi?id=413661
+
+
+Index: x264-9999/configure
+===================================================================
+--- x264-9999.orig/configure
++++ x264-9999/configure
+@@ -553,11 +553,6 @@ case $host_cpu in
+ if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
+ CFLAGS="$CFLAGS -march=i686"
+ fi
+- if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
+- CFLAGS="$CFLAGS -mfpmath=sse -msse"
+- fi
+- CFLAGS="-m32 $CFLAGS"
+- LDFLAGS="-m32 $LDFLAGS"
+ else
+ # icc on linux has various degrees of mod16 stack support
+ if [ $SYS = LINUX ]; then
+@@ -588,13 +583,8 @@ case $host_cpu in
+ x86_64)
+ ARCH="X86_64"
+ AS="yasm"
+- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
+ if [ "$SYS" = MACOSX ]; then
+ ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
+- if cc_check '' "-arch x86_64"; then
+- CFLAGS="$CFLAGS -arch x86_64"
+- LDFLAGS="$LDFLAGS -arch x86_64"
+- fi
+ elif [ "$SYS" = WINDOWS ]; then
+ ASFLAGS="$ASFLAGS -f win32 -m amd64"
+ # only the GNU toolchain is inconsistent in prefixing function names with _
+@@ -602,7 +592,11 @@ case $host_cpu in
+ [ $compiler = GNU ] && LDFLAGS="$LDFLAGS -Wl,--nxcompat -Wl,--dynamicbase"
+ [ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+ else
+- ASFLAGS="$ASFLAGS -f elf -m amd64"
++ if cpp_check "" "" "__ILP32__" ; then
++ ASFLAGS="$ASFLAGS -f elf -m x32"
++ else
++ ASFLAGS="$ASFLAGS -f elf -m amd64"
++ fi
+ fi
+ ;;
+ powerpc|powerpc64)
+@@ -964,10 +958,6 @@ if [ "$pic" = "yes" ] ; then
+ [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
+ fi
+
+-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
+- CFLAGS="$CFLAGS -fomit-frame-pointer"
+-fi
+-
+ if [ "$strip" = "yes" ]; then
+ CFLAGS="$CFLAGS -s"
+ LDFLAGS="$LDFLAGS -s"
diff --git a/media-libs/x264/files/x264-0.0.20130912-cflags.patch b/media-libs/x264/files/x264-0.0.20130912-cflags.patch
new file mode 100644
index 000000000000..c08a0d7e3de1
--- /dev/null
+++ b/media-libs/x264/files/x264-0.0.20130912-cflags.patch
@@ -0,0 +1,54 @@
+diff --git a/configure b/configure
+index 07796b1..afdda94 100755
+--- a/configure
++++ b/configure
+@@ -556,11 +556,6 @@ case $host_cpu in
+ if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
+ CFLAGS="$CFLAGS -march=i686"
+ fi
+- if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
+- CFLAGS="$CFLAGS -mfpmath=sse -msse"
+- fi
+- CFLAGS="-m32 $CFLAGS"
+- LDFLAGS="-m32 $LDFLAGS"
+ else
+ # icc on linux has various degrees of mod16 stack support
+ if [ $SYS = LINUX ]; then
+@@ -591,13 +586,8 @@ case $host_cpu in
+ x86_64)
+ ARCH="X86_64"
+ AS="yasm"
+- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
+ if [ "$SYS" = MACOSX ]; then
+ ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
+- if cc_check '' "-arch x86_64"; then
+- CFLAGS="$CFLAGS -arch x86_64"
+- LDFLAGS="$LDFLAGS -arch x86_64"
+- fi
+ elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
+ ASFLAGS="$ASFLAGS -f win32 -m amd64"
+ # only the GNU toolchain is inconsistent in prefixing function names with _
+@@ -605,7 +595,11 @@ case $host_cpu in
+ [ $compiler = GNU ] && LDFLAGS="$LDFLAGS -Wl,--nxcompat -Wl,--dynamicbase"
+ [ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+ else
+- ASFLAGS="$ASFLAGS -f elf -m amd64"
++ if cpp_check "" "" "__ILP32__" ; then
++ ASFLAGS="$ASFLAGS -f elf -m x32"
++ else
++ ASFLAGS="$ASFLAGS -f elf -m amd64"
++ fi
+ fi
+ ;;
+ powerpc|powerpc64)
+@@ -971,10 +965,6 @@ if [ "$pic" = "yes" ] ; then
+ [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
+ fi
+
+-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
+- CFLAGS="$CFLAGS -fomit-frame-pointer"
+-fi
+-
+ if [ "$strip" = "yes" ]; then
+ CFLAGS="$CFLAGS -s"
+ LDFLAGS="$LDFLAGS -s"
diff --git a/media-libs/x264/files/x264-cflags.patch b/media-libs/x264/files/x264-cflags.patch
new file mode 100644
index 000000000000..a5f4d79119e9
--- /dev/null
+++ b/media-libs/x264/files/x264-cflags.patch
@@ -0,0 +1,55 @@
+diff --git a/configure b/configure
+index 0a4cb94..8f7ef75 100755
+--- a/configure
++++ b/configure
+@@ -591,11 +591,6 @@ case $host_cpu in
+ if [[ "$asm" == auto && "$CFLAGS" != *-march* ]]; then
+ CFLAGS="$CFLAGS -march=i686"
+ fi
+- if [[ "$asm" == auto && "$CFLAGS" != *-mfpmath* ]]; then
+- CFLAGS="$CFLAGS -mfpmath=sse -msse"
+- fi
+- CFLAGS="-m32 $CFLAGS"
+- LDFLAGS="-m32 $LDFLAGS"
+ elif [ $compiler = ICC ]; then
+ # icc on linux has various degrees of mod16 stack support
+ if [ $SYS = LINUX ]; then
+@@ -627,13 +622,8 @@ case $host_cpu in
+ ARCH="X86_64"
+ AS="yasm"
+ ASFLAGS="$ASFLAGS -DARCH_X86_64=1 -I\$(SRCPATH)/common/x86/"
+- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
+ if [ "$SYS" = MACOSX ]; then
+ ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
+- if cc_check '' "-arch x86_64"; then
+- CFLAGS="$CFLAGS -arch x86_64"
+- LDFLAGS="$LDFLAGS -arch x86_64"
+- fi
+ elif [ "$SYS" = WINDOWS -o "$SYS" = CYGWIN ]; then
+ ASFLAGS="$ASFLAGS -f win32 -m amd64"
+ # only the GNU toolchain is inconsistent in prefixing function names with _
+@@ -641,7 +631,11 @@ case $host_cpu in
+ [ $compiler = GNU ] && LDFLAGS="$LDFLAGS -Wl,--nxcompat -Wl,--dynamicbase"
+ [ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+ else
+- ASFLAGS="$ASFLAGS -f elf -m amd64"
++ if cpp_check "" "" "__ILP32__" ; then
++ ASFLAGS="$ASFLAGS -f elf -m x32"
++ else
++ ASFLAGS="$ASFLAGS -f elf -m amd64"
++ fi
+ fi
+ ;;
+ powerpc|powerpc64)
+@@ -1006,10 +1000,6 @@ if [ "$pic" = "yes" ] ; then
+ [ $SYS = SunOS -a "$ARCH" = "X86" ] && SOFLAGS="$SOFLAGS -mimpure-text"
+ fi
+
+-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
+- CFLAGS="$CFLAGS -fomit-frame-pointer"
+-fi
+-
+ if [ "$strip" = "yes" ]; then
+ LDFLAGS="$LDFLAGS -s"
+ fi
+
diff --git a/media-libs/x264/files/x264-nostrip.patch b/media-libs/x264/files/x264-nostrip.patch
new file mode 100644
index 000000000000..b4e2689a18e6
--- /dev/null
+++ b/media-libs/x264/files/x264-nostrip.patch
@@ -0,0 +1,16 @@
+Index: x264-svn/configure
+===================================================================
+--- x264-svn.orig/configure
++++ x264-svn/configure
+@@ -374,11 +374,6 @@ if [ "$pic" = "yes" ] ; then
+ ASFLAGS="$ASFLAGS -D__PIC__"
+ fi
+
+-if [ "$debug" != "yes" -a "$gprof" != "yes" ]; then
+- CFLAGS="$CFLAGS -s -fomit-frame-pointer"
+- LDFLAGS="$LDFLAGS -s"
+-fi
+-
+ if [ "$debug" = "yes" ]; then
+ CFLAGS="-O1 -g $CFLAGS"
+ else
diff --git a/media-libs/x264/files/x264-onlylib-20110425.patch b/media-libs/x264/files/x264-onlylib-20110425.patch
new file mode 100644
index 000000000000..6f216b92fa8e
--- /dev/null
+++ b/media-libs/x264/files/x264-onlylib-20110425.patch
@@ -0,0 +1,30 @@
+Index: x264-snapshot-20110425-2245/Makefile
+===================================================================
+--- x264-snapshot-20110425-2245.orig/Makefile
++++ x264-snapshot-20110425-2245/Makefile
+@@ -137,7 +137,7 @@ DEP = depend
+
+ .PHONY: all default fprofiled clean distclean install uninstall dox test testclean
+
+-default: $(DEP) x264$(EXE)
++default: $(DEP)
+
+ $(LIBX264): .depend $(OBJS) $(OBJASM)
+ $(AR)$@ $(OBJS) $(OBJASM)
+@@ -207,7 +207,7 @@ distclean: clean
+ rm -f config.mak x264_config.h config.h config.log x264.pc x264.def
+ rm -rf test/
+
+-install: x264$(EXE) $(SONAME)
++install: $(LIBX264) $(SONAME)
+ install -d $(DESTDIR)$(bindir)
+ install -d $(DESTDIR)$(includedir)
+ install -d $(DESTDIR)$(libdir)
+@@ -216,7 +216,6 @@ install: x264$(EXE) $(SONAME)
+ install -m 644 x264_config.h $(DESTDIR)$(includedir)
+ install -m 644 $(LIBX264) $(DESTDIR)$(libdir)
+ install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
+- install x264$(EXE) $(DESTDIR)$(bindir)
+ $(if $(RANLIB), $(RANLIB) $(DESTDIR)$(libdir)/$(LIBX264))
+ ifeq ($(SYS),WINDOWS)
+ $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir))
diff --git a/media-libs/x264/files/x264-x32.patch b/media-libs/x264/files/x264-x32.patch
new file mode 100644
index 000000000000..7af4405a8472
--- /dev/null
+++ b/media-libs/x264/files/x264-x32.patch
@@ -0,0 +1,34 @@
+https://bugs.gentoo.org/420241
+
+initial x32 support -- no asm code, just pure C
+
+--- a/configure
++++ b/configure
+@@ -567,7 +567,13 @@ case $host_cpu in
+ x86_64)
+ ARCH="X86_64"
+ AS="yasm"
+- [ $compiler = GNU ] && CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++ if [ $compiler = GNU ]; then
++ if cpp_check "" "" "__ILP32__" ; then
++ CFLAGS="-mx32 $CFLAGS" && LDFLAGS="-mx32 $LDFLAGS"
++ else
++ CFLAGS="-m64 $CFLAGS" && LDFLAGS="-m64 $LDFLAGS"
++ fi
++ fi
+ if [ "$SYS" = MACOSX ]; then
+ ASFLAGS="$ASFLAGS -f macho64 -m amd64 -DPIC -DPREFIX"
+ if cc_check '' "-arch x86_64"; then
+@@ -580,7 +586,11 @@ case $host_cpu in
+ [ $compiler = GNU ] && cc_check "" "-S" && grep -q "_main:" conftest && ASFLAGS="$ASFLAGS -DPREFIX"
+ [ $compiler = GNU ] && RCFLAGS="--target=pe-x86-64 $RCFLAGS"
+ else
+- ASFLAGS="$ASFLAGS -f elf -m amd64"
++ if cpp_check "" "" "__ILP32__" ; then
++ AS="${cross_prefix}as"
++ else
++ ASFLAGS="$ASFLAGS -f elf -m amd64"
++ fi
+ fi
+ ;;
+ powerpc|powerpc64)
diff --git a/media-libs/x264/metadata.xml b/media-libs/x264/metadata.xml
new file mode 100644
index 000000000000..4854bbd25485
--- /dev/null
+++ b/media-libs/x264/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>video</herd>
+ <maintainer>
+ <email>media-video@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name="10bit">Set output bit depth to 10, this may not be compatible with all decoders</flag>
+ <flag name="interlaced">enable interlaced encoding support, this can decrease encoding speed by up to 2%</flag>
+ <flag name="opencl">Add support for OpenCL.</flag>
+ <flag name="pic">disable optimized assembly code that is not PIC friendly</flag>
+ </use>
+</pkgmetadata>
diff --git a/media-libs/x264/x264-0.0.20111220.ebuild b/media-libs/x264/x264-0.0.20111220.ebuild
new file mode 100644
index 000000000000..a54e600713fd
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20111220.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ V_ECLASS="git-2"
+else
+ V_ECLASS="versionator"
+fi
+
+inherit multilib toolchain-funcs flag-o-matic ${V_ECLASS}
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+fi
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+ SRC_URI=""
+else
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+if [ "${PV#9999}" != "${PV}" ]; then
+ KEYWORDS=""
+else
+ KEYWORDS="alpha amd64 ~mips ppc ppc64 sparc x86 ~x86-fbsd"
+fi
+IUSE="10bit custom-cflags debug +interlaced pic static-libs +threads"
+
+RDEPEND=""
+DEPEND="amd64? ( >=dev-lang/yasm-1 )
+ x86? ( >=dev-lang/yasm-1 )
+ x86-fbsd? ( >=dev-lang/yasm-1 )"
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DOCS="AUTHORS doc/*.txt"
+
+src_configure() {
+ tc-export CC
+
+ local myconf=""
+ use 10bit && myconf+=" --bit-depth=10"
+ use debug && myconf+=" --enable-debug"
+ use interlaced || myconf+=" --disable-interlaced"
+ use static-libs && myconf+=" --enable-static"
+ use threads || myconf+=" --disable-thread"
+
+ # let upstream pick the optimization level by default
+ use custom-cflags || filter-flags -O?
+
+ if use x86 && use pic; then
+ myconf+=" --disable-asm"
+ fi
+
+ ./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}" \
+ ${myconf} || die
+
+ # this is a nasty workaround for bug #376925 as upstream doesn't like us
+ # fiddling with their CFLAGS
+ if use custom-cflags; then
+ local cflags
+ cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')"
+ cflags="${cflags//$(get-flag O)/}"
+ cflags="${cflags//-O? /$(get-flag O) }"
+ cflags="${cflags//-g /}"
+ sed -i "s:^CFLAGS=.*:CFLAGS=${cflags//:/\\:}:" config.mak
+ fi
+}
diff --git a/media-libs/x264/x264-0.0.20120327.ebuild b/media-libs/x264/x264-0.0.20120327.ebuild
new file mode 100644
index 000000000000..4c099cedd68d
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20120327.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ V_ECLASS="git-2"
+else
+ V_ECLASS="versionator"
+fi
+
+inherit multilib toolchain-funcs flag-o-matic ${V_ECLASS}
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+fi
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+ SRC_URI=""
+else
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+if [ "${PV#9999}" != "${PV}" ]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~alpha ~amd64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+fi
+IUSE="10bit custom-cflags debug +interlaced pic static-libs +threads"
+
+RDEPEND=""
+DEPEND="amd64? ( >=dev-lang/yasm-1 )
+ x86? ( >=dev-lang/yasm-1 )
+ x86-fbsd? ( >=dev-lang/yasm-1 )"
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DOCS="AUTHORS doc/*.txt"
+
+src_configure() {
+ tc-export CC
+
+ local myconf=""
+ use 10bit && myconf+=" --bit-depth=10"
+ use debug && myconf+=" --enable-debug"
+ use interlaced || myconf+=" --disable-interlaced"
+ use static-libs && myconf+=" --enable-static"
+ use threads || myconf+=" --disable-thread"
+
+ # let upstream pick the optimization level by default
+ use custom-cflags || filter-flags -O?
+
+ if use x86 && use pic; then
+ myconf+=" --disable-asm"
+ fi
+
+ ./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}" \
+ ${myconf} || die
+
+ # this is a nasty workaround for bug #376925 as upstream doesn't like us
+ # fiddling with their CFLAGS
+ if use custom-cflags; then
+ local cflags
+ cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')"
+ cflags="${cflags//$(get-flag O)/}"
+ cflags="${cflags//-O? /$(get-flag O) }"
+ cflags="${cflags//-g /}"
+ sed -i "s:^CFLAGS=.*:CFLAGS=${cflags//:/\\:}:" config.mak
+ fi
+}
diff --git a/media-libs/x264/x264-0.0.20120707.ebuild b/media-libs/x264/x264-0.0.20120707.ebuild
new file mode 100644
index 000000000000..49c91fb3381f
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20120707.ebuild
@@ -0,0 +1,104 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=4
+
+if [ "${PV#9999}" != "${PV}" ] ; then
+ V_ECLASS="git-2"
+else
+ V_ECLASS="versionator"
+fi
+
+inherit multilib toolchain-funcs flag-o-matic ${V_ECLASS}
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+fi
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+ SRC_URI=""
+else
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+fi
+
+LICENSE="GPL-2"
+SLOT="0"
+if [ "${PV#9999}" != "${PV}" ]; then
+ KEYWORDS=""
+else
+ KEYWORDS="~alpha ~amd64 ~arm hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+fi
+IUSE="10bit custom-cflags debug +interlaced pic static-libs +threads"
+
+RDEPEND=""
+DEPEND="amd64? ( >=dev-lang/yasm-1 )
+ amd64-fbsd? ( >=dev-lang/yasm-1 )
+ x86? ( >=dev-lang/yasm-1 )
+ x86-fbsd? ( >=dev-lang/yasm-1 )"
+
+if [ "${PV#9999}" = "${PV}" ]; then
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Solaris' /bin/sh doesn't grok the syntax in these files
+ sed -i -e '1c\#!/usr/bin/env sh' configure version.sh || die
+ # for sparc-solaris
+ if [[ ${CHOST} == sparc*-solaris* ]] ; then
+ sed -i -e 's:-DPIC::g' configure || die
+ fi
+ # for OSX
+ sed -i -e "s|-arch x86_64||g" configure || die
+ epatch "${FILESDIR}"/x264-x32.patch #420241
+
+ # fix crashes when compiled with gcc 4.8
+ epatch "${FILESDIR}"/${P}-gcc48.patch
+}
+
+src_configure() {
+ tc-export CC
+
+ local myconf=""
+ use 10bit && myconf+=" --bit-depth=10"
+ use debug && myconf+=" --enable-debug"
+ use interlaced || myconf+=" --disable-interlaced"
+ use static-libs && myconf+=" --enable-static"
+ use threads || myconf+=" --disable-thread"
+
+ # let upstream pick the optimization level by default
+ use custom-cflags || filter-flags -O?
+
+ if use x86 && use pic || [[ ${ABI} == "x32" ]] ; then
+ myconf+=" --disable-asm"
+ fi
+
+ ./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}" \
+ ${myconf} || die
+
+ # this is a nasty workaround for bug #376925 as upstream doesn't like us
+ # fiddling with their CFLAGS
+ if use custom-cflags; then
+ local cflags
+ cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')"
+ cflags="${cflags//$(get-flag O)/}"
+ cflags="${cflags//-O? /$(get-flag O) }"
+ cflags="${cflags//-g /}"
+ sed -i "s:^CFLAGS=.*:CFLAGS=${cflags//:/\\:}:" config.mak
+ fi
+}
diff --git a/media-libs/x264/x264-0.0.20130506.ebuild b/media-libs/x264/x264-0.0.20130506.ebuild
new file mode 100644
index 000000000000..11e10b0d330e
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20130506.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+ SLOT="0"
+else
+ inherit versionator
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+
+ SONAME="132"
+ SLOT="0/${SONAME}"
+
+ S="${WORKDIR}/${MY_P}"
+fi
+
+LICENSE="GPL-2"
+IUSE="10bit custom-cflags +interlaced pic static-libs +threads"
+
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+DEPEND="amd64? ( ${ASM_DEP} )
+ amd64-fbsd? ( ${ASM_DEP} )
+ x86? ( ${ASM_DEP} )
+ x86-fbsd? ( ${ASM_DEP} )"
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Initial support for x32 ABI, bug #420241
+ epatch "${FILESDIR}"/x264-x32.patch
+}
+
+src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ # let upstream pick the optimization level by default
+ use custom-cflags || filter-flags -O?
+
+ if use x86 && use pic || [[ ${ABI} == "x32" ]]; then
+ asm_conf=" --disable-asm"
+ fi
+
+ ./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}" \
+ $(usex 10bit "--bit-depth=10" "") \
+ $(usex interlaced "" "--disable-interlaced") \
+ $(usex static-libs "" "--enable-static") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+
+ # this is a nasty workaround for bug #376925 as upstream doesn't like us
+ # fiddling with their CFLAGS
+ if use custom-cflags; then
+ local cflags
+ cflags="$(grep "^CFLAGS=" config.mak | sed 's/CFLAGS=//')"
+ cflags="${cflags//$(get-flag O)/}"
+ cflags="${cflags//-O? /$(get-flag O) }"
+ cflags="${cflags//-g /}"
+ sed -i "s:^CFLAGS=.*:CFLAGS=${cflags//:/\\:}:" config.mak
+ fi
+}
diff --git a/media-libs/x264/x264-0.0.20130731.ebuild b/media-libs/x264/x264-0.0.20130731.ebuild
new file mode 100644
index 000000000000..0f1ce85f718c
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20130731.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+else
+ inherit versionator
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+SONAME="135"
+SLOT="0/${SONAME}"
+
+LICENSE="GPL-2"
+IUSE="10bit +interlaced pic static-libs cpu_flags_x86_sse +threads"
+
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+DEPEND="abi_x86_32? ( ${ASM_DEP} )
+ abi_x86_64? ( ${ASM_DEP} )"
+RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20130224-r7
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Initial support for x32 ABI, bug #420241
+ # Avoid messing too much with CFLAGS.
+ epatch "${FILESDIR}"/${P}-cflags.patch
+}
+
+multilib_src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ if [[ ${ABI} == x86* ]] && use pic || [[ ${ABI} == "x32" ]]; then
+ asm_conf=" --disable-asm"
+ fi
+
+ # Upstream uses this, see the cflags patch
+ use cpu_flags_x86_sse && append-flags "-msse" "-mfpmath=sse"
+
+ "${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}" \
+ $(usex 10bit "--bit-depth=10" "") \
+ $(usex interlaced "" "--disable-interlaced") \
+ --disable-opencl \
+ $(usex static-libs "--enable-static" "") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+}
diff --git a/media-libs/x264/x264-0.0.20130912.ebuild b/media-libs/x264/x264-0.0.20130912.ebuild
new file mode 100644
index 000000000000..c5613425973a
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20130912.ebuild
@@ -0,0 +1,71 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+else
+ inherit versionator
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+SONAME="138"
+SLOT="0/${SONAME}"
+
+LICENSE="GPL-2"
+IUSE="10bit +interlaced pic static-libs cpu_flags_x86_sse +threads"
+
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+DEPEND="abi_x86_32? ( ${ASM_DEP} )
+ abi_x86_64? ( ${ASM_DEP} )"
+RDEPEND="abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20130224-r7
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Initial support for x32 ABI, bug #420241
+ # Avoid messing too much with CFLAGS.
+ epatch "${FILESDIR}"/${P}-cflags.patch
+}
+
+multilib_src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ if [[ ${ABI} == x86* ]] && use pic || [[ ${ABI} == "x32" ]]; then
+ asm_conf=" --disable-asm"
+ fi
+
+ # Upstream uses this, see the cflags patch
+ use cpu_flags_x86_sse && append-flags "-msse" "-mfpmath=sse"
+
+ "${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}" \
+ $(usex 10bit "--bit-depth=10" "") \
+ $(usex interlaced "" "--disable-interlaced") \
+ --disable-opencl \
+ $(usex static-libs "--enable-static" "") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+}
diff --git a/media-libs/x264/x264-0.0.20140308.ebuild b/media-libs/x264/x264-0.0.20140308.ebuild
new file mode 100644
index 000000000000..aee8bc84d2af
--- /dev/null
+++ b/media-libs/x264/x264-0.0.20140308.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+else
+ inherit versionator
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="alpha amd64 ~arm hppa ~ia64 ~mips ppc ppc64 sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+SONAME="142"
+SLOT="0/${SONAME}"
+
+LICENSE="GPL-2"
+IUSE="10bit +interlaced opencl pic static-libs cpu_flags_x86_sse +threads"
+
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+DEPEND="abi_x86_32? ( ${ASM_DEP} )
+ abi_x86_64? ( ${ASM_DEP} )
+ opencl? ( dev-lang/perl )"
+RDEPEND="opencl? ( >=virtual/opencl-0-r3[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20130224-r7
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Initial support for x32 ABI, bug #420241
+ # Avoid messing too much with CFLAGS.
+ epatch "${FILESDIR}"/x264-0.0.20130912-cflags.patch
+}
+
+multilib_src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ if [[ ${ABI} == x86* ]] && use pic || [[ ${ABI} == "x32" ]]; then
+ asm_conf=" --disable-asm"
+ fi
+
+ # Upstream uses this, see the cflags patch
+ use cpu_flags_x86_sse && append-flags "-msse" "-mfpmath=sse"
+
+ "${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}" \
+ $(usex 10bit "--bit-depth=10" "") \
+ $(usex interlaced "" "--disable-interlaced") \
+ $(usex opencl "" "--disable-opencl") \
+ $(usex static-libs "--enable-static" "") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+}
diff --git a/media-libs/x264/x264-9999.ebuild b/media-libs/x264/x264-9999.ebuild
new file mode 100644
index 000000000000..e414ba2fbc79
--- /dev/null
+++ b/media-libs/x264/x264-9999.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit flag-o-matic multilib toolchain-funcs eutils multilib-minimal
+
+DESCRIPTION="A free library for encoding X264/AVC streams"
+HOMEPAGE="http://www.videolan.org/developers/x264.html"
+if [[ ${PV} == 9999 ]]; then
+ inherit git-2
+ EGIT_REPO_URI="git://git.videolan.org/x264.git"
+else
+ inherit versionator
+ MY_P="x264-snapshot-$(get_version_component_range 3)-2245"
+ SRC_URI="http://download.videolan.org/pub/videolan/x264/snapshots/${MY_P}.tar.bz2"
+ KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
+ S="${WORKDIR}/${MY_P}"
+fi
+
+SONAME="142"
+SLOT="0/${SONAME}"
+
+LICENSE="GPL-2"
+IUSE="10bit +interlaced opencl pic static-libs cpu_flags_x86_sse +threads"
+
+ASM_DEP=">=dev-lang/yasm-1.2.0"
+DEPEND="abi_x86_32? ( ${ASM_DEP} )
+ abi_x86_64? ( ${ASM_DEP} )
+ opencl? ( dev-lang/perl )"
+RDEPEND="opencl? ( >=virtual/opencl-0-r3[${MULTILIB_USEDEP}] )
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20130224-r7
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
+
+DOCS="AUTHORS doc/*.txt"
+
+src_prepare() {
+ # Initial support for x32 ABI, bug #420241
+ # Avoid messing too much with CFLAGS.
+ epatch "${FILESDIR}"/x264-cflags.patch
+}
+
+multilib_src_configure() {
+ tc-export CC
+ local asm_conf=""
+
+ if [[ ${ABI} == x86* ]] && use pic || [[ ${ABI} == "x32" ]]; then
+ asm_conf=" --disable-asm"
+ fi
+
+ # Upstream uses this, see the cflags patch
+ use cpu_flags_x86_sse && append-flags "-msse" "-mfpmath=sse"
+
+ "${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}" \
+ $(usex 10bit "--bit-depth=10" "") \
+ $(usex interlaced "" "--disable-interlaced") \
+ $(usex opencl "" "--disable-opencl") \
+ $(usex static-libs "--enable-static" "") \
+ $(usex threads "" "--disable-thread") \
+ ${asm_conf} || die
+}