Force python-2.4 usage #304521 by Domen Kožar. Apply upshader patch from upstream...
authorMike Frysinger <vapier@gentoo.org>
Sun, 23 May 2010 20:42:10 +0000 (20:42 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sun, 23 May 2010 20:42:10 +0000 (20:42 +0000)
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64

media-tv/xbmc/ChangeLog
media-tv/xbmc/Manifest
media-tv/xbmc/files/xbmc-9.11-TexturePacker-parallel-build.patch [new file with mode: 0644]
media-tv/xbmc/files/xbmc-9.11-shader-upscalers.patch [new file with mode: 0644]
media-tv/xbmc/xbmc-9.11-r4.ebuild [new file with mode: 0644]

index dd5b8d349b44d6be89f639a65c60e033c260fc13..e475cf89442db383dd9618948922cd227828d0e1 100644 (file)
@@ -1,6 +1,15 @@
 # ChangeLog for media-tv/xbmc
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-tv/xbmc/ChangeLog,v 1.54 2010/05/23 18:42:31 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-tv/xbmc/ChangeLog,v 1.55 2010/05/23 20:42:10 vapier Exp $
+
+*xbmc-9.11-r4 (23 May 2010)
+
+  23 May 2010; Mike Frysinger <vapier@gentoo.org> +xbmc-9.11-r4.ebuild,
+  +files/xbmc-9.11-TexturePacker-parallel-build.patch,
+  +files/xbmc-9.11-shader-upscalers.patch:
+  Force python-2.4 usage #304521 by Domen Kožar. Apply upshader patch from
+  upstream #306661 by zehner. Install the xbmc-send helper python script
+  #309885 by James Broadhead.
 
   23 May 2010; Mike Frysinger <vapier@gentoo.org> xbmc-9999.ebuild,
   metadata.xml:
index d48766262947da14a85950ffd81e9a2d69fee098..38c33cd712eecad38340c52973f7d75db65ad19f 100644 (file)
@@ -1,19 +1,22 @@
 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
+AUX xbmc-9.11-TexturePacker-parallel-build.patch 357 RMD160 37802ec3ce31d10d58802acf267aaf568d3ef8d0 SHA1 5909a4a61e1dbac3f51c6a8c393f1d4cfd7a38ca SHA256 a9b990cdd5473e72cc83cda36cc9faaf67e97649cec45af9c529455464b12d43
 AUX xbmc-9.11-jpeg-speedup.patch 804 RMD160 2aff1749ee8f4b85ce9199a78fcfb779c373d086 SHA1 ecef76650156b7fcba60f909496e43ae83bafd20 SHA256 3115b8668b60e307536a9314fc02c837d4f94f89571d403761b614a22447e2d8
 AUX xbmc-9.11-libpng14.patch 4263 RMD160 90a82d1783f2237416c0932c968347394f303bf9 SHA1 69407df931476df7fd20b30ddc42142d11602d8f SHA256 0516a466f2646867478781251d665e87f6f0697fcd9ce29b91c87194fafc7da6
+AUX xbmc-9.11-shader-upscalers.patch 29024 RMD160 d100a35684cad2a6dea0c6eeb9bfbc00e4151bbb SHA1 130fa8bccb6dfab723daf2ebafd88b6e22c109b3 SHA256 965099c217920d5db259944adc4250ed73e4b08ddcd7b0d88d843c9a9a41d396
 AUX xbmc-9.11-use-cdio-system-headers-on-non-win32.patch 3623 RMD160 d8b6d48a07265238bc1bd6425c53e7a52a679751 SHA1 1d4d41d00973c4199f866a7988a709a188683403 SHA256 ceb6952025c8baf5bb4eed18380c9bf6022893407f22a3e587eebd657863ab83
 AUX xbmc-9.11-wavpack.patch 2637 RMD160 35a7f5446aaef27ff563da4a8200616fffb66e00 SHA1 0f9a2845a5b9d0b554569f1379af0557b071ef69 SHA256 b09e9072f0a2d4451588c40b0b300611944ba7d4cefbae0c400389ed9f8485dc
 DIST xbmc-9.11.tar.gz 141420517 RMD160 0d0890ba373e05af95a66360aed8871b384849f2 SHA1 71956ed8630d46662e49de9d96304308078f10b5 SHA256 e810aaaf1c380bbe923d9e30e2e472577081b7b893e12a7ef4bb70a911c3db87
 EBUILD xbmc-9.11-r3.ebuild 5062 RMD160 bd1d51bf0637833c8ea1e6a79a00bc0a5dbbeaa1 SHA1 bd451c1b37c11d800496d40a5657b2ac21d65ed8 SHA256 0f34e65defa5b970eb91e69d42ac1e37ab032797e2d98fc8b7386d736ab983ad
+EBUILD xbmc-9.11-r4.ebuild 5448 RMD160 0de60b770462a378945099324f871b01f4249b40 SHA1 20536ba2297e55ef58f56ccce93cbb697e5d92df SHA256 0f2d7e4aea7126f954cfe903751e4d27a808381a33f65712ff716f3ce600f0cf
 EBUILD xbmc-9999.ebuild 4662 RMD160 f63c7edcdd88f7a7fd9f44172b2fb131b45ce318 SHA1 4996b6be88fd242d402f0f35e1ae210fd9a4688a SHA256 11ee06c04e64c14879a0b9f9e2915156e0849979b721f0d995c568e6b8d6183a
-MISC ChangeLog 8930 RMD160 154b5c73281a79d870e1a54fb10bd069f5c2eb49 SHA1 c8d54bfbc09ae839f8e77f09ce5389f2edd58bd0 SHA256 4e2ab53721284b66431efe1dc5663e39986d259247d7e62193bceea3ddec3540
+MISC ChangeLog 9309 RMD160 276ea5551b68f689e3a60413c6349461b6ce02fa SHA1 c948220087e2f9f8b16bfc9713342e73dde0ed17 SHA256 cace621f2894e58ab9468fb3ff6894b4cf7f0e033d384191d5fd662017933cea
 MISC metadata.xml 446 RMD160 8784194c0d5667ad0a7a662e090aaf2006a2dc9a SHA1 28161d5a31a40fb383431a1b069b45270938bcc2 SHA256 ef0d7c7d3311d8a7b2b534d8e0e5ae8216dbbc91bb1a808d7d427f828be5bad8
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.15 (GNU/Linux)
 
-iF4EAREIAAYFAkv5dygACgkQTwhj9JtAlp6TRwEAld7mxetuwVp6dRQU+8dLCAvX
-+4HT70qisLN1c+eZen0A/3+XxRLOMe1HrAJuuaG8VWrMJZQQcOcl8PsUwgxQSibw
-=jcE+
+iF4EAREIAAYFAkv5ky4ACgkQTwhj9JtAlp71eAEAyERD+hSwEAqodKnnZ0OzXyjJ
+8UoycGoU8vnA5HwWp8cA/21+t6JqGwAST7PXOOD/qF1OBGmMZrTaA+FQVX8S/yLA
+=98In
 -----END PGP SIGNATURE-----
diff --git a/media-tv/xbmc/files/xbmc-9.11-TexturePacker-parallel-build.patch b/media-tv/xbmc/files/xbmc-9.11-TexturePacker-parallel-build.patch
new file mode 100644 (file)
index 0000000..f6bc030
--- /dev/null
@@ -0,0 +1,13 @@
+http://trac.xbmc.org/ticket/9275
+
+--- xbmc/Makefile.in
++++ xbmc/Makefile.in
+@@ -501,7 +501,7 @@ else
+       $(MAKE) -C tools/XBMCTex/
+ endif
+ 
+-tools/TexturePacker/TexturePacker:
++tools/TexturePacker/TexturePacker: guilib/guilib.a xbmc/lib/libsquish/libsquish-@ARCH@.a
+       $(MAKE) -C tools/TexturePacker/
+ 
+ install-bin: xbmc.bin # developement convenience target
diff --git a/media-tv/xbmc/files/xbmc-9.11-shader-upscalers.patch b/media-tv/xbmc/files/xbmc-9.11-shader-upscalers.patch
new file mode 100644 (file)
index 0000000..d4feaa4
--- /dev/null
@@ -0,0 +1,887 @@
+http://bugs.gentoo.org/306661
+
+backport shader based upscalers from svn trunk
+
+--- language/English/strings.xml
++++ language/English/strings.xml
+@@ -1554,16 +1554,17 @@
+   <string id="16304">Lanczos2</string>
+   <string id="16305">Lanczos3</string>
+   <string id="16306">Sinc8</string>
+-
+   <string id="16307">Bicubic (software)</string>
+   <string id="16308">Lanczos (software)</string>
+   <string id="16309">Sinc (software)</string>
+-
+   <string id="16310">(VDPAU)Temporal</string>
+   <string id="16311">(VDPAU)Temporal/Spatial</string>
+   <string id="16312">(VDPAU)Noise Reduction</string>
+   <string id="16313">(VDPAU)Sharpness</string>
+   <string id="16314">Inverse Telecine</string>
++  <string id="16315">Lanczos3 optimized</string>
++  <string id="16316">Auto</string>
++
+   <string id="17500">Display sleep timeout</string>
+ 
+   <string id="19000">Switch to channel</string>
+--- system/shaders/convolution-6x6.glsl
++++ system/shaders/convolution-6x6.glsl
+@@ -0,0 +1,69 @@
++uniform sampler2D img;
++uniform float     stepx;
++uniform float     stepy;
++
++#if (HAS_FLOAT_TEXTURE)
++uniform sampler1D kernelTex;
++
++vec3 weight(float pos)
++{
++  return texture1D(kernelTex, pos).rgb;
++}
++#else
++uniform sampler2D kernelTex;
++
++vec3 weight(float pos)
++{
++  //row 0 contains the high byte, row 1 contains the low byte
++  return ((texture2D(kernelTex, vec2(pos, 0.0)) * 256.0 + texture2D(kernelTex, vec2(pos, 1.0)))).rgb / 128.5 - 1.0;
++}
++#endif
++
++vec3 pixel(float xpos, float ypos)
++{
++  return texture2D(img, vec2(xpos, ypos)).rgb;
++}
++
++vec3 line (float ypos, vec3 xpos1, vec3 xpos2, vec3 linetaps1, vec3 linetaps2)
++{
++  vec3  pixels;
++
++  pixels  = pixel(xpos1.r, ypos) * linetaps1.r;
++  pixels += pixel(xpos1.g, ypos) * linetaps2.r;
++  pixels += pixel(xpos1.b, ypos) * linetaps1.g;
++  pixels += pixel(xpos2.r, ypos) * linetaps2.g;
++  pixels += pixel(xpos2.g, ypos) * linetaps1.b;
++  pixels += pixel(xpos2.b, ypos) * linetaps2.b;
++
++  return pixels;
++}
++
++void main()
++{
++  float xf = fract(gl_TexCoord[0].x / stepx);
++  float yf = fract(gl_TexCoord[0].y / stepy);
++
++  vec3 linetaps1   = weight((1.0 - xf) / 2.0);
++  vec3 linetaps2   = weight((1.0 - xf) / 2.0 + 0.5);
++  vec3 columntaps1 = weight((1.0 - yf) / 2.0);
++  vec3 columntaps2 = weight((1.0 - yf) / 2.0 + 0.5);
++
++  vec3 xpos1 = vec3(
++      (-1.5 - xf) * stepx + gl_TexCoord[0].x,
++      (-0.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 0.5 - xf) * stepx + gl_TexCoord[0].x);
++  vec3 xpos2 = vec3(
++      ( 1.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 2.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 3.5 - xf) * stepx + gl_TexCoord[0].x);
++
++  gl_FragColor.rgb  = line((-1.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.r;
++  gl_FragColor.rgb += line((-0.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.r;
++  gl_FragColor.rgb += line(( 0.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.g;
++  gl_FragColor.rgb += line(( 1.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.g;
++  gl_FragColor.rgb += line(( 2.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps1.b;
++  gl_FragColor.rgb += line(( 3.5 - yf) * stepy + gl_TexCoord[0].y, xpos1, xpos2, linetaps1, linetaps2) * columntaps2.b;
++
++  gl_FragColor.a = gl_Color.a;
++}
++
+--- system/shaders/bicubic.glsl
++++ system/shaders/bicubic.glsl
+@@ -0,0 +1,47 @@
++uniform sampler2D img;
++uniform float stepx;
++uniform float stepy;
++uniform sampler2D kernelTex;
++
++vec4 cubicFilter(float xValue, vec4 c0, vec4 c1, vec4 c2, vec4 c3)
++{
++  vec4 h = texture2D(kernelTex, vec2(xValue, 0.5));
++  vec4 r = c0 * h.r;
++  r += c1 * h.g;
++  r += c2 * h.b;
++  r += c3 * h.a;
++  return r;
++}
++
++void main()
++{
++  vec2 f = vec2(gl_TexCoord[0].x / stepx , gl_TexCoord[0].y / stepy);
++  f = fract(f);
++  vec4 t0 = cubicFilter(f.x,
++  texture2D(img, gl_TexCoord[0].xy + vec2(-stepx,    -stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(0.0,       -stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(stepx,     -stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, -stepy)));
++
++  vec4 t1 = cubicFilter(f.x,
++  texture2D(img, gl_TexCoord[0].xy + vec2(-stepx,    0.0)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(0.0,       0.0)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(stepx,     0.0)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, 0.0)));
++
++  vec4 t2 = cubicFilter(f.x,
++  texture2D(img, gl_TexCoord[0].xy + vec2(-stepx,    stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(0.0,       stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(stepx,     stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, stepy)));
++
++  vec4 t3 = cubicFilter(f.x,
++  texture2D(img, gl_TexCoord[0].xy + vec2(-stepx,    2.0*stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(0,         2.0*stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(stepx,     2.0*stepy)),
++  texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, 2.0*stepy)));
++
++  gl_FragColor = cubicFilter(f.y, t0, t1, t2, t3);   
++  gl_FragColor.a = gl_Color.a;
++}
++
+--- system/shaders/convolution-4x4.glsl
++++ system/shaders/convolution-4x4.glsl
+@@ -0,0 +1,60 @@
++uniform sampler2D img;
++uniform float     stepx;
++uniform float     stepy;
++
++#if (HAS_FLOAT_TEXTURE)
++uniform sampler1D kernelTex;
++
++vec4 weight(float pos)
++{
++  return texture1D(kernelTex, pos);
++}
++#else
++uniform sampler2D kernelTex;
++
++vec4 weight(float pos)
++{
++  //row 0 contains the high byte, row 1 contains the low byte
++  return (texture2D(kernelTex, vec2(pos, 0.0)) * 256.0 + texture2D(kernelTex, vec2(pos, 1.0))) / 128.5 - 1.0;
++}
++#endif
++
++vec3 pixel(float xpos, float ypos)
++{
++  return texture2D(img, vec2(xpos, ypos)).rgb;
++}
++
++vec3 line (float ypos, vec4 xpos, vec4 linetaps)
++{
++  vec3  pixels;
++
++  pixels  = pixel(xpos.r, ypos) * linetaps.r;
++  pixels += pixel(xpos.g, ypos) * linetaps.g;
++  pixels += pixel(xpos.b, ypos) * linetaps.b;
++  pixels += pixel(xpos.a, ypos) * linetaps.a;
++
++  return pixels;
++}
++
++void main()
++{
++  float xf = fract(gl_TexCoord[0].x / stepx);
++  float yf = fract(gl_TexCoord[0].y / stepy);
++
++  vec4 linetaps   = weight(1.0 - xf);
++  vec4 columntaps = weight(1.0 - yf);
++
++  vec4 xpos = vec4(
++      (-0.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 0.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 1.5 - xf) * stepx + gl_TexCoord[0].x,
++      ( 2.5 - xf) * stepx + gl_TexCoord[0].x);
++
++  gl_FragColor.rgb  = line((-0.5 - yf) * stepy + gl_TexCoord[0].y, xpos, linetaps) * columntaps.r;
++  gl_FragColor.rgb += line(( 0.5 - yf) * stepy + gl_TexCoord[0].y, xpos, linetaps) * columntaps.g;
++  gl_FragColor.rgb += line(( 1.5 - yf) * stepy + gl_TexCoord[0].y, xpos, linetaps) * columntaps.b;
++  gl_FragColor.rgb += line(( 2.5 - yf) * stepy + gl_TexCoord[0].y, xpos, linetaps) * columntaps.a;
++
++  gl_FragColor.a = gl_Color.a;
++}
++
+--- xbmc/settings/VideoSettings.h
++++ xbmc/settings/VideoSettings.h
+@@ -51,9 +51,10 @@
+ {
+   VS_SCALINGMETHOD_NEAREST=0,
+   VS_SCALINGMETHOD_LINEAR,
+-  
++
+   VS_SCALINGMETHOD_CUBIC,
+   VS_SCALINGMETHOD_LANCZOS2,
++  VS_SCALINGMETHOD_LANCZOS3_FAST,
+   VS_SCALINGMETHOD_LANCZOS3,
+   VS_SCALINGMETHOD_SINC8,
+   VS_SCALINGMETHOD_NEDI,
+@@ -61,7 +62,9 @@
+   VS_SCALINGMETHOD_BICUBIC_SOFTWARE,
+   VS_SCALINGMETHOD_LANCZOS_SOFTWARE,
+   VS_SCALINGMETHOD_SINC_SOFTWARE,
+-  VS_SCALINGMETHOD_VDPAU_HARDWARE
++  VS_SCALINGMETHOD_VDPAU_HARDWARE,
++
++  VS_SCALINGMETHOD_AUTO
+ };
+ 
+ class CVideoSettings
+--- xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
++++ xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.cpp
+@@ -21,6 +21,7 @@
+ #include "system.h"
+ #include "VideoFilterShader.h"
+ #include "utils/log.h"
++#include "ConvolutionKernels.h"
+ 
+ #include <string>
+ #include <math.h>
+@@ -63,60 +64,13 @@
+ 
+ BicubicFilterShader::BicubicFilterShader(float B, float C)
+ {
+-  string shaderf = 
+-    "uniform sampler2D img;"
+-    "uniform float stepx;"
+-    "uniform float stepy;"
+-    "uniform sampler2D kernelTex;"
+-    
+-    "vec4 cubicFilter(float xValue, vec4 c0, vec4 c1, vec4 c2, vec4 c3)"
+-    "{"
+-    " vec4 h = texture2D(kernelTex, vec2(xValue, 0.5));"
+-    " vec4 r = c0 * h.r;"
+-    " r += c1 * h.g;"
+-    " r += c2 * h.b;"
+-    " r += c3 * h.a;"
+-    " return r;"
+-    "}"
+-    ""
+-    "void main()"
+-    "{"
+-    "vec2 f = vec2(gl_TexCoord[0].x / stepx , gl_TexCoord[0].y / stepy);"
+-    "f = fract(f);"
+-    "vec4 t0 = cubicFilter(f.x,"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(-stepx, -stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(0.0, -stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(stepx, -stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, -stepy)));"
+-    ""
+-    "vec4 t1 = cubicFilter(f.x,"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(-stepx, 0.0)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(0.0, 0.0)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(stepx, 0.0)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, 0.0)));"
+-    ""
+-    "vec4 t2 = cubicFilter(f.x,"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(-stepx, stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(0.0, stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(stepx, stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, stepy)));"
+-    ""
+-    "vec4 t3 = cubicFilter(f.x,"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(-stepx, 2.0*stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(0, 2.0*stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(stepx, 2.0*stepy)),"
+-    "texture2D(img, gl_TexCoord[0].xy + vec2(2.0*stepx, 2.0*stepy)));"
+-    
+-    "gl_FragColor = cubicFilter(f.y, t0, t1, t2, t3) ;"    
+-    "gl_FragColor.a = gl_Color.a;"
+-    "}";
+-  PixelShader()->SetSource(shaderf);
++  PixelShader()->LoadSource("bicubic.glsl");
+   m_kernelTex1 = 0;
+   m_B = B;
+   m_C = C;
+-  if (B<=0)
++  if (B<0)
+     m_B=1.0f/3.0f;
+-  if (C<=0)
++  if (C<0)
+     m_C=1.0f/3.0f;
+ }
+ 
+@@ -209,8 +163,8 @@
+   glBindTexture(GL_TEXTURE_2D, m_kernelTex1);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
+-  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
++  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
++  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+   glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, size, 1, 0, GL_RGBA, GL_FLOAT, img);
+ 
+   glActiveTexture(GL_TEXTURE0);
+@@ -254,4 +208,110 @@
+   return val;
+ }
+ 
++ConvolutionFilterShader::ConvolutionFilterShader(ESCALINGMETHOD method)
++{
++  m_method = method;
++  m_kernelTex1 = 0;
++
++  string shadername;
++  string defines;
++
++  if (m_method == VS_SCALINGMETHOD_CUBIC ||
++      m_method == VS_SCALINGMETHOD_LANCZOS2 ||
++      m_method == VS_SCALINGMETHOD_LANCZOS3_FAST)
++    shadername = "convolution-4x4.glsl";
++  else if (m_method == VS_SCALINGMETHOD_LANCZOS3)
++    shadername = "convolution-6x6.glsl";
++
++  m_floattex = glewIsSupported("GL_ARB_texture_float");
++
++  if (m_floattex)
++    defines = "#define HAS_FLOAT_TEXTURE 1\n";
++  else
++    defines = "#define HAS_FLOAT_TEXTURE 0\n";
++
++  CLog::Log(LOGDEBUG, "GL: ConvolutionFilterShader: using %s defines: %s", shadername.c_str(), defines.c_str());
++  PixelShader()->LoadSource(shadername, defines);
++}
++
++void ConvolutionFilterShader::OnCompiledAndLinked()
++{
++  // obtain shader attribute handles on successfull compilation
++  m_hSourceTex = glGetUniformLocation(ProgramHandle(), "img");
++  m_hStepX     = glGetUniformLocation(ProgramHandle(), "stepx");
++  m_hStepY     = glGetUniformLocation(ProgramHandle(), "stepy");
++  m_hKernTex   = glGetUniformLocation(ProgramHandle(), "kernelTex");
++
++  CConvolutionKernel kernel(m_method, 256);
++
++  if (m_kernelTex1)
++  {
++    glDeleteTextures(1, &m_kernelTex1);
++    m_kernelTex1 = 0;
++  }
++
++  glGenTextures(1, &m_kernelTex1);
++
++  if ((m_kernelTex1<=0))
++  {
++    CLog::Log(LOGERROR, "GL: ConvolutionFilterShader: Error creating kernel texture");
++    return;
++  }
++
++  glActiveTexture(GL_TEXTURE2);
++
++  //if float textures are supported, we can load the kernel as a 1d float texture
++  //if not, we load it as a 2d texture with 2 rows, where row 0 contains the high byte
++  //and row 1 contains the low byte, which can be converted in the shader
++  if (m_floattex)
++  {
++    glBindTexture(GL_TEXTURE_1D, m_kernelTex1);
++    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
++    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
++    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
++    glTexParameteri(GL_TEXTURE_1D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
++    glTexImage1D(GL_TEXTURE_1D, 0, GL_RGBA16F_ARB, kernel.GetSize(), 0, GL_RGBA, GL_FLOAT, kernel.GetFloatPixels());
++  }
++  else
++  {
++    glBindTexture(GL_TEXTURE_2D, m_kernelTex1);
++    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
++    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
++    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
++    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
++    glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, kernel.GetSize(), 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, kernel.GetIntFractPixels());
++  }
++
++  glActiveTexture(GL_TEXTURE0);
++
++  VerifyGLState();
++}
++
++bool ConvolutionFilterShader::OnEnabled()
++{
++  // set shader attributes once enabled
++  glActiveTexture(GL_TEXTURE2);
++
++  if (m_floattex)
++    glBindTexture(GL_TEXTURE_1D, m_kernelTex1);
++  else
++    glBindTexture(GL_TEXTURE_2D, m_kernelTex1);
++
++  glActiveTexture(GL_TEXTURE0);
++  glUniform1i(m_hSourceTex, m_sourceTexUnit);
++  glUniform1i(m_hKernTex, 2);
++  glUniform1f(m_hStepX, m_stepX);
++  glUniform1f(m_hStepY, m_stepY);
++  VerifyGLState();
++  return true;
++}
++
++void ConvolutionFilterShader::Free()
++{
++  if (m_kernelTex1)
++    glDeleteTextures(1, &m_kernelTex1);
++  m_kernelTex1 = 0;
++  BaseVideoFilterShader::Free();
++}
++
+ #endif
+--- xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp
++++ xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.cpp
+@@ -0,0 +1,226 @@
++/*
++ *      Copyright (C) 2005-2008 Team XBMC
++ *      http://www.xbmc.org
++ *
++ *  This Program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2, or (at your option)
++ *  any later version.
++ *
++ *  This Program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with XBMC; see the file COPYING.  If not, write to
++ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  http://www.gnu.org/copyleft/gpl.html
++ *
++ */
++#ifdef _WIN32
++  #define _USE_MATH_DEFINES
++#endif
++
++#include "ConvolutionKernels.h"
++#include "MathUtils.h"
++
++#define SINC(x) (sin(M_PI * (x)) / (M_PI * (x)))
++
++CConvolutionKernel::CConvolutionKernel(ESCALINGMETHOD method, int size)
++{
++  m_size = size;
++  m_floatpixels = new float[m_size * 4];
++
++  if (method == VS_SCALINGMETHOD_LANCZOS2)
++    Lanczos2();
++  else if (method == VS_SCALINGMETHOD_LANCZOS3_FAST)
++    Lanczos3Fast();
++  else if (method == VS_SCALINGMETHOD_LANCZOS3)
++    Lanczos3();
++  else if (method == VS_SCALINGMETHOD_CUBIC) 
++    Bicubic(1.0 / 3.0, 1.0 / 3.0);
++
++  ToIntFract();
++}
++
++CConvolutionKernel::~CConvolutionKernel()
++{
++  delete [] m_floatpixels;
++  delete [] m_intfractpixels;
++}
++
++//generate a lanczos2 kernel which can be loaded with RGBA format
++//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup
++void CConvolutionKernel::Lanczos2()
++{
++  for (int i = 0; i < m_size; i++)
++  {
++    double x = (double)i / (double)m_size;
++
++    //generate taps
++    for (int j = 0; j < 4; j++)
++      m_floatpixels[i * 4 + j] = (float)LanczosWeight(x + (double)(j - 2), 2.0);
++
++    //any collection of 4 taps added together needs to be exactly 1.0
++    //for lanczos this is not always the case, so we take each collection of 4 taps
++    //and divide those taps by the sum of the taps
++    float weight = 0.0;
++    for (int j = 0; j < 4; j++)
++      weight += m_floatpixels[i * 4 + j];
++
++    for (int j = 0; j < 4; j++)
++      m_floatpixels[i * 4 + j] /= weight;
++  }
++}
++
++//generate a lanczos3 kernel which can be loaded with RGBA format
++//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup
++//the two outer lobes of the lanczos3 kernel are added to the two lobes one step to the middle
++//this basically looks the same as lanczos3, but the kernel only has 4 taps,
++//so it can use the 4x4 convolution shader which is twice as fast as the 6x6 one
++void CConvolutionKernel::Lanczos3Fast()
++{
++  for (int i = 0; i < m_size; i++)
++  {
++    double a = 3.0;
++    double x = (double)i / (double)m_size;
++
++    //generate taps
++    m_floatpixels[i * 4 + 0] = (float)(LanczosWeight(x - 2.0, a) + LanczosWeight(x - 3.0, a));
++    m_floatpixels[i * 4 + 1] = (float) LanczosWeight(x - 1.0, a);
++    m_floatpixels[i * 4 + 2] = (float) LanczosWeight(x      , a);
++    m_floatpixels[i * 4 + 3] = (float)(LanczosWeight(x + 1.0, a) + LanczosWeight(x + 2.0, a));
++
++    //any collection of 4 taps added together needs to be exactly 1.0
++    //for lanczos this is not always the case, so we take each collection of 4 taps
++    //and divide those taps by the sum of the taps
++    float weight = 0.0;
++    for (int j = 0; j < 4; j++)
++      weight += m_floatpixels[i * 4 + j];
++
++    for (int j = 0; j < 4; j++)
++      m_floatpixels[i * 4 + j] /= weight;
++  }
++}
++
++//generate a lanczos3 kernel which can be loaded with RGBA format
++//each value of RGB has one tap, so a shader can load 3 taps with a single pixel lookup
++void CConvolutionKernel::Lanczos3()
++{
++  for (int i = 0; i < m_size; i++)
++  {
++    double x = (double)i / (double)m_size;
++
++    //generate taps
++    for (int j = 0; j < 3; j++)
++      m_floatpixels[i * 4 + j] = (float)LanczosWeight(x * 2.0 + (double)(j * 2 - 3), 3.0);
++
++    m_floatpixels[i * 4 + 3] = 0.0;
++  }
++
++  //any collection of 6 taps added together needs to be exactly 1.0
++  //for lanczos this is not always the case, so we take each collection of 6 taps
++  //and divide those taps by the sum of the taps
++  for (int i = 0; i < m_size / 2; i++)
++  {
++    float weight = 0.0;
++    for (int j = 0; j < 3; j++)
++    {
++      weight += m_floatpixels[i * 4 + j];
++      weight += m_floatpixels[(i + m_size / 2) * 4 + j];
++    }
++    for (int j = 0; j < 3; j++)
++    {
++      m_floatpixels[i * 4 + j] /= weight;
++      m_floatpixels[(i + m_size / 2) * 4 + j] /= weight;
++    }
++  }
++}
++
++//generate a bicubic kernel which can be loaded with RGBA format
++//each value of RGBA has one tap, so a shader can load 4 taps with a single pixel lookup
++void CConvolutionKernel::Bicubic(double B, double C)
++{
++  for (int i = 0; i < m_size; i++)
++  {
++    double x = (double)i / (double)m_size;
++
++    //generate taps
++    for (int j = 0; j < 4; j++)
++      m_floatpixels[i * 4 + j] = (float)BicubicWeight(x + (double)(j - 2), B, C);
++  }
++}
++
++double CConvolutionKernel::LanczosWeight(double x, double radius)
++{
++  double ax = fabs(x);
++
++  if (ax == 0.0)
++    return 1.0;
++  else if (ax < radius)
++    return SINC(ax) * SINC(ax / radius);
++  else
++    return 0.0;
++}
++
++double CConvolutionKernel::BicubicWeight(double x, double B, double C)
++{
++  double ax = fabs(x);
++
++  if (ax<1.0)
++  {
++    return ((12 - 9*B - 6*C) * ax * ax * ax +
++            (-18 + 12*B + 6*C) * ax * ax +
++            (6 - 2*B))/6;
++  }
++  else if (ax<2.0)
++  {
++    return ((-B - 6*C) * ax * ax * ax + 
++            (6*B + 30*C) * ax * ax + (-12*B - 48*C) * 
++             ax + (8*B + 24*C)) / 6;
++  }
++  else
++  {
++    return 0.0;
++  }
++}
++
++
++//convert float to high byte/low byte, so the kernel can be loaded into an 8 bit texture
++//with height 2 and converted back to real float in the shader
++//it only works when the kernel texture uses nearest neighbour, but there's almost no difference
++//between that and linear interpolation
++void CConvolutionKernel::ToIntFract()
++{
++  m_intfractpixels = new uint8_t[m_size * 8];
++
++  for (int i = 0; i < m_size * 4; i++)
++  {
++    int value = MathUtils::round_int((m_floatpixels[i] + 1.0) / 2.0 * 65535.0);
++    if (value < 0)
++      value = 0;
++    else if (value > 65535)
++      value = 65535;
++    
++    int integer = value / 256;
++    int fract   = value % 256;
++
++    m_intfractpixels[i] = (uint8_t)integer;
++    m_intfractpixels[i + m_size * 4] = (uint8_t)fract;
++  }
++
++#if 0
++  for (int i = 0; i < 4; i++)
++  {
++    for (int j = 0; j < m_size; j++)
++    {
++      printf("%i %f %f\n",
++          i * m_size + j,
++          ((double)m_intfractpixels[j * 4 + i] + (double)m_intfractpixels[j * 4 + i + m_size * 4] / 255.0) / 255.0 * 2.0 - 1.0,
++          m_floatpixels[j * 4 + i]);
++    }
++  }
++#endif
++}
++
+--- xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.h
++++ xbmc/cores/VideoRenderers/VideoShaders/VideoFilterShader.h
+@@ -4,6 +4,7 @@
+ #ifdef HAS_GL
+ 
+ #include "../../../../guilib/Shader.h"
++#include "../../../settings/VideoSettings.h"
+ 
+ using namespace Shaders;
+ 
+@@ -35,7 +36,7 @@
+   class BicubicFilterShader : public BaseVideoFilterShader
+   {
+   public:
+-    BicubicFilterShader(float B=0.0f, float C=0.0f);
++    BicubicFilterShader(float B=-1.0f, float C=-1.0f);
+     void OnCompiledAndLinked();
+     bool OnEnabled();
+     void Free();
+@@ -55,6 +56,25 @@
+     float m_C;
+   };
+ 
++  class ConvolutionFilterShader : public BaseVideoFilterShader
++  {
++  public:
++    ConvolutionFilterShader(ESCALINGMETHOD method);
++    void OnCompiledAndLinked();
++    bool OnEnabled();
++    void Free();
++
++  protected:
++    // kernel textures
++    GLuint m_kernelTex1;
++
++    // shader handles to kernel textures
++    GLint m_hKernTex;
++
++    ESCALINGMETHOD m_method;
++    bool           m_floattex; //if float textures are supported
++  };
++
+ } // end namespace
+ 
+ #endif
+--- xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h
++++ xbmc/cores/VideoRenderers/VideoShaders/ConvolutionKernels.h
+@@ -0,0 +1,55 @@
++/*
++ *      Copyright (C) 2005-2008 Team XBMC
++ *      http://www.xbmc.org
++ *
++ *  This Program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2, or (at your option)
++ *  any later version.
++ *
++ *  This Program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with XBMC; see the file COPYING.  If not, write to
++ *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
++ *  http://www.gnu.org/copyleft/gpl.html
++ *
++ */
++
++#ifndef CONVOLUTIONKERNELS
++#define CONVOLUTIONKERNELS
++
++#include "system.h"
++#include "../../../settings/VideoSettings.h"
++
++class CConvolutionKernel
++{
++  public:
++    CConvolutionKernel(ESCALINGMETHOD method, int size);
++    ~CConvolutionKernel();
++
++    int      GetSize()           { return m_size; }
++    float*   GetFloatPixels()    { return m_floatpixels; }
++    uint8_t* GetIntFractPixels() { return m_intfractpixels; }
++
++  private:
++
++    void Lanczos2();
++    void Lanczos3Fast();
++    void Lanczos3();
++    void Bicubic(double B, double C);
++
++    double LanczosWeight(double x, double radius);
++    double BicubicWeight(double x, double B, double C);
++
++    void ToIntFract();
++
++    int      m_size;
++    float*   m_floatpixels;
++    uint8_t* m_intfractpixels;
++};
++
++#endif //CONVOLUTIONKERNELS
+--- xbmc/cores/VideoRenderers/VideoShaders/Makefile
++++ xbmc/cores/VideoRenderers/VideoShaders/Makefile
+@@ -1,5 +1,5 @@
+ INCLUDES=-I. -I.. -I../../ -I../../../ -I../../../linux -I../../../../guilib
+-SRCS=YUV2RGBShader.cpp VideoFilterShader.cpp
++SRCS=YUV2RGBShader.cpp VideoFilterShader.cpp ConvolutionKernels.cpp
+ 
+ LIB=VideoShaders.a
+ 
+--- xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
++++ xbmc/cores/VideoRenderers/LinuxRendererGL.cpp
+@@ -886,6 +886,19 @@
+ 
+   VerifyGLState();
+ 
++  if (m_scalingMethod == VS_SCALINGMETHOD_AUTO)
++  {
++    bool scaleSD = (int)m_sourceWidth < m_upscalingWidth && (int)m_sourceHeight < m_upscalingHeight &&
++                   m_sourceHeight < 720 && m_sourceWidth < 1280;
++
++    if (Supports(VS_SCALINGMETHOD_VDPAU_HARDWARE))
++      m_scalingMethod = VS_SCALINGMETHOD_VDPAU_HARDWARE;
++    else if (Supports(VS_SCALINGMETHOD_LANCZOS3_FAST) && scaleSD)
++      m_scalingMethod = VS_SCALINGMETHOD_LANCZOS3_FAST;
++    else
++      m_scalingMethod = VS_SCALINGMETHOD_LINEAR;
++  }
++
+   switch (m_scalingMethod)
+   {
+   case VS_SCALINGMETHOD_NEAREST:
+@@ -898,13 +911,10 @@
+     m_renderQuality = RQ_SINGLEPASS;
+     return;
+ 
++  case VS_SCALINGMETHOD_LANCZOS2:
++  case VS_SCALINGMETHOD_LANCZOS3_FAST:
++  case VS_SCALINGMETHOD_LANCZOS3:
+   case VS_SCALINGMETHOD_CUBIC:
+-    if(!glewIsSupported("GL_ARB_texture_float"))
+-    {
+-      CLog::Log(LOGERROR, "GL: hardware doesn't support GL_ARB_texture_float");
+-      break;
+-    }
+-
+     if (!m_fbo.Initialize())
+     {
+       CLog::Log(LOGERROR, "GL: Error initializing FBO");
+@@ -917,7 +927,7 @@
+       break;
+     }
+ 
+-    m_pVideoFilterShader = new BicubicFilterShader(0.3f, 0.3f);
++    m_pVideoFilterShader = new ConvolutionFilterShader(m_scalingMethod);
+     if (!m_pVideoFilterShader->CompileAndLink())
+     {
+       CLog::Log(LOGERROR, "GL: Error compiling and linking video filter shader");
+@@ -928,8 +938,6 @@
+     m_renderQuality = RQ_MULTIPASS;
+     return;
+ 
+-  case VS_SCALINGMETHOD_LANCZOS2:
+-  case VS_SCALINGMETHOD_LANCZOS3:
+   case VS_SCALINGMETHOD_SINC8:
+   case VS_SCALINGMETHOD_NEDI:
+     CLog::Log(LOGERROR, "GL: TODO: This scaler has not yet been implemented");
+@@ -1895,16 +1903,19 @@
+ bool CLinuxRendererGL::Supports(ESCALINGMETHOD method)
+ {
+   if(method == VS_SCALINGMETHOD_NEAREST
+-  || method == VS_SCALINGMETHOD_LINEAR)
++  || method == VS_SCALINGMETHOD_LINEAR
++  || method == VS_SCALINGMETHOD_AUTO)
+     return true;
+ 
+-
+-  if(method == VS_SCALINGMETHOD_CUBIC 
+-  && glewIsSupported("GL_ARB_texture_float")
+-  && glewIsSupported("GL_EXT_framebuffer_object")
+-  && m_renderMethod == RENDER_GLSL)
+-    return true;
+-
++  if(method == VS_SCALINGMETHOD_CUBIC
++  || method == VS_SCALINGMETHOD_LANCZOS2
++  || method == VS_SCALINGMETHOD_LANCZOS3_FAST
++  || method == VS_SCALINGMETHOD_LANCZOS3)
++  {
++    if (glewIsSupported("GL_EXT_framebuffer_object") && (m_renderMethod & RENDER_GLSL))
++      return true;
++  }
++ 
+   if (g_advancedSettings.m_videoHighQualityScaling != SOFTWARE_UPSCALING_DISABLED)
+   {
+     if(method == VS_SCALINGMETHOD_BICUBIC_SOFTWARE
+--- xbmc/GUIDialogVideoSettings.cpp
++++ xbmc/GUIDialogVideoSettings.cpp
+@@ -103,6 +103,7 @@
+     entries.push_back(make_pair(VS_SCALINGMETHOD_LINEAR           , 16302));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_CUBIC            , 16303));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_LANCZOS2         , 16304));
++    entries.push_back(make_pair(VS_SCALINGMETHOD_LANCZOS3_FAST    , 16315));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_LANCZOS3         , 16305));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_SINC8            , 16306));
+ //    entries.push_back(make_pair(VS_SCALINGMETHOD_NEDI             , ?????));
+@@ -110,6 +111,7 @@
+     entries.push_back(make_pair(VS_SCALINGMETHOD_LANCZOS_SOFTWARE , 16308));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_SINC_SOFTWARE    , 16309));
+     entries.push_back(make_pair(VS_SCALINGMETHOD_VDPAU_HARDWARE   , 13120));
++    entries.push_back(make_pair(VS_SCALINGMETHOD_AUTO             , 16316));
+ 
+     /* remove unsupported methods */
+     for(vector<pair<int, int> >::iterator it = entries.begin(); it != entries.end();)
+--- xbmc/Settings.cpp
++++ xbmc/Settings.cpp
+@@ -772,7 +772,7 @@
+     GetInteger(pElement, "interlacemethod", interlaceMethod, VS_INTERLACEMETHOD_NONE, VS_INTERLACEMETHOD_NONE, VS_INTERLACEMETHOD_INVERSE_TELECINE);
+     m_stSettings.m_defaultVideoSettings.m_InterlaceMethod = (EINTERLACEMETHOD)interlaceMethod;
+     int scalingMethod;
+-    GetInteger(pElement, "scalingmethod", scalingMethod, VS_SCALINGMETHOD_LINEAR, VS_SCALINGMETHOD_NEAREST, VS_SCALINGMETHOD_CUBIC);
++    GetInteger(pElement, "scalingmethod", scalingMethod, VS_SCALINGMETHOD_LINEAR, VS_SCALINGMETHOD_NEAREST, VS_SCALINGMETHOD_AUTO);
+     m_stSettings.m_defaultVideoSettings.m_ScalingMethod = (ESCALINGMETHOD)scalingMethod;
+ 
+     GetInteger(pElement, "viewmode", m_stSettings.m_defaultVideoSettings.m_ViewMode, VIEW_MODE_NORMAL, VIEW_MODE_NORMAL, VIEW_MODE_CUSTOM);
diff --git a/media-tv/xbmc/xbmc-9.11-r4.ebuild b/media-tv/xbmc/xbmc-9.11-r4.ebuild
new file mode 100644 (file)
index 0000000..0d567c9
--- /dev/null
@@ -0,0 +1,211 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-tv/xbmc/xbmc-9.11-r4.ebuild,v 1.1 2010/05/23 20:42:10 vapier Exp $
+
+EAPI="2"
+
+inherit eutils python
+
+# Use XBMC_ESVN_REPO_URI to track a different branch
+ESVN_REPO_URI=${XBMC_ESVN_REPO_URI:-http://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk}
+ESVN_PROJECT=${ESVN_REPO_URI##*/svnroot/}
+ESVN_PROJECT=${ESVN_PROJECT%/*}
+if [[ ${PV} == "9999" ]] ; then
+       inherit subversion autotools
+       KEYWORDS=""
+else
+       inherit autotools
+       MY_P=${P/_/-}
+       SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz"
+       KEYWORDS="~amd64 ~x86"
+       S=${WORKDIR}/${MY_P}
+fi
+
+DESCRIPTION="XBMC is a free and open source media-player and entertainment hub"
+HOMEPAGE="http://xbmc.org/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="aac alsa altivec avahi css debug joystick midi profile pulseaudio sse sse2 vdpau xrandr"
+
+RDEPEND="virtual/opengl
+       app-arch/bzip2
+       app-arch/unrar
+       app-arch/unzip
+       app-arch/zip
+       app-i18n/enca
+       dev-lang/python:2.4
+       dev-libs/boost
+       dev-libs/fribidi
+       dev-libs/libcdio
+       dev-libs/libpcre
+       dev-libs/lzo
+       >=dev-python/pysqlite-2
+       media-libs/a52dec
+       media-libs/alsa-lib
+       aac? ( media-libs/faac )
+       media-libs/faad2
+       media-libs/flac
+       media-libs/fontconfig
+       media-libs/freetype
+       media-libs/glew
+       media-libs/jasper
+       media-libs/jbigkit
+       media-libs/jpeg:0
+       >=media-libs/libass-0.9.7
+       media-libs/libdca
+       css? ( media-libs/libdvdcss )
+       media-libs/libmad
+       media-libs/libmms
+       media-libs/libmpeg2
+       media-libs/libogg
+       media-libs/libsamplerate
+       media-libs/libsdl[alsa,audio,video,X]
+       media-libs/libvorbis
+       media-libs/sdl-gfx
+       media-libs/sdl-image[gif,jpeg,png]
+       media-libs/sdl-mixer
+       media-libs/sdl-sound
+       media-libs/tiff
+       pulseaudio? ( media-sound/pulseaudio )
+       media-sound/wavpack
+       media-video/ffmpeg
+       avahi? ( net-dns/avahi )
+       net-misc/curl
+       || ( >=net-fs/samba-3.4.6[smbclient] <net-fs/samba-3.3 )
+       sys-apps/dbus
+       sys-apps/hal
+       sys-libs/zlib
+       virtual/mysql
+       x11-apps/xdpyinfo
+       x11-apps/mesa-progs
+       vdpau? (
+               || ( x11-libs/libvdpau >=x11-drivers/nvidia-drivers-180.51 )
+               media-video/ffmpeg[vdpau]
+       )
+       x11-libs/libXinerama
+       xrandr? ( x11-libs/libXrandr )
+       x11-libs/libXrender"
+DEPEND="${RDEPEND}
+       x11-proto/xineramaproto
+       dev-util/cmake
+       x86? ( dev-lang/nasm )"
+
+src_unpack() {
+       if [[ ${PV} == "9999" ]] ; then
+               subversion_src_unpack
+               cd "${S}"
+               rm -f configure
+       else
+               unpack ${A}
+               cd "${S}"
+       fi
+
+       # Fix case sensitivity
+       mv media/Fonts/{a,A}rial.ttf || die
+       mv media/{S,s}plash.png || die
+}
+
+src_prepare() {
+       has_version ">=media-libs/libpng-1.4" && \
+               epatch "${FILESDIR}"/${P}-libpng14.patch #319113
+
+       epatch "${FILESDIR}"/${P}-TexturePacker-parallel-build.patch
+       epatch "${FILESDIR}"/${P}-shader-upscalers.patch #306661
+       epatch "${FILESDIR}"/${P}-wavpack.patch
+       epatch "${FILESDIR}"/${P}-jpeg-speedup.patch #300909
+       epatch "${FILESDIR}"/${P}-use-cdio-system-headers-on-non-win32.patch #303030, upstream: #8026
+       # http://xbmc.org/trac/ticket/8218
+       sed -i \
+               -e 's: ftell64: dll_ftell64:' \
+               xbmc/cores/DllLoader/exports/wrapper.c || die
+       sed -i \
+               -e '1i#include <stdlib.h>\n#include <string.h>\n' \
+               xbmc/lib/libid3tag/libid3tag/metadata.c || die
+
+       # some dirs ship generated autotools, some dont
+       local d
+       for d in . xbmc/cores/dvdplayer/Codecs/libbdnav ; do
+               [[ -d ${d} ]] || continue
+               [[ -e ${d}/configure ]] && continue
+               pushd ${d} >/dev/null
+               einfo "Generating autotools in ${d}"
+               eautoreconf
+               popd >/dev/null
+       done
+
+       local squish #290564
+       use altivec && squish="-DSQUISH_USE_ALTIVEC=1 -maltivec"
+       use sse && squish="-DSQUISH_USE_SSE=1 -msse"
+       use sse2 && squish="-DSQUISH_USE_SSE=2 -msse2"
+       sed -i \
+               -e '/^CXXFLAGS/{s:-D[^=]*=.::;s:-m[[:alnum:]]*::}' \
+               -e "1iCXXFLAGS += ${squish}" \
+               xbmc/lib/libsquish/Makefile.in || die
+
+       # Fix XBMC's final version string showing as "exported"
+       # instead of the SVN revision number.
+       export SVN_REV=${ESVN_WC_REVISION:-exported}
+
+       # Avoid lsb-release dependency
+       sed -i \
+               -e 's:/usr/bin/lsb_release -d:cat /etc/gentoo-release:' \
+               xbmc/utils/SystemInfo.cpp
+
+       # Do not use termcap #262822
+       sed -i 's:-ltermcap::' xbmc/lib/libPython/Python/configure
+
+       epatch_user #293109
+
+       # Tweak autotool timestamps to avoid regeneration
+       find . -type f -print0 | xargs -0 touch -r configure
+
+}
+
+src_configure() {
+       # Disable documentation generation
+       export ac_cv_path_LATEX=no
+       # Avoid help2man
+       export HELP2MAN=$(type -P help2man || echo true)
+       # Force python-2.4 for now #304521
+       export ac_cv_lib_python2_{5,6}_main=no
+
+       econf \
+               --disable-ccache \
+               --disable-optimizations \
+               --enable-external-libraries \
+               --enable-goom \
+               --enable-gl \
+               $(use_enable avahi) \
+               $(use_enable css dvdcss) \
+               $(use_enable debug) \
+               $(use_enable aac faac) \
+               $(use_enable joystick) \
+               $(use_enable midi mid) \
+               $(use_enable profile profiling) \
+               $(use_enable pulseaudio pulse) \
+               $(use_enable vdpau) \
+               $(use_enable xrandr)
+}
+
+src_install() {
+       einstall || die "Install failed!"
+
+       insinto /usr/share/xbmc/web/styles/
+       doins -r "${S}"/web/*/styles/*/ || die
+
+       insinto /usr/share/applications
+       doins tools/Linux/xbmc.desktop
+       doicon tools/Linux/xbmc.png
+
+       dodoc README.linux
+       rm "${D}"/usr/share/xbmc/{README.linux,LICENSE.GPL,*.txt}
+
+       insinto "$(python_get_sitedir)" #309885
+       doins tools/EventClients/lib/python/xbmcclient.py || die
+       newbin "tools/EventClients/Clients/XBMC Send/xbmc-send.py" xbmc-send || die
+}
+
+pkg_postinst() {
+       elog "Visit http://xbmc.org/wiki/?title=XBMC_Online_Manual"
+}