summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Tumaykin <itumaykin@gmail.com>2017-02-02 18:05:49 +0300
committerDavid Seifert <soap@gentoo.org>2017-02-04 22:24:52 +0100
commit7ebdf748b6c4e9869c6c984093153e14614ba19d (patch)
tree78e1519858518c7bad1424a348011147dbffccc7 /media-video/mpv/files
parentprofiles: fix media-video/mpv[cuda] mask (diff)
downloadgentoo-7ebdf748b6c4e9869c6c984093153e14614ba19d.tar.gz
gentoo-7ebdf748b6c4e9869c6c984093153e14614ba19d.tar.bz2
gentoo-7ebdf748b6c4e9869c6c984093153e14614ba19d.zip
media-video/mpv: revbump to 0.23.0-r1 to sync with 9999
Among other things this brings cuda support to non-live ebuilds. Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'media-video/mpv/files')
-rw-r--r--media-video/mpv/files/mpv-rely-on-pkgconfig-for-raspberrypi-compiler-flags.patch97
1 files changed, 97 insertions, 0 deletions
diff --git a/media-video/mpv/files/mpv-rely-on-pkgconfig-for-raspberrypi-compiler-flags.patch b/media-video/mpv/files/mpv-rely-on-pkgconfig-for-raspberrypi-compiler-flags.patch
new file mode 100644
index 000000000000..1545743beb25
--- /dev/null
+++ b/media-video/mpv/files/mpv-rely-on-pkgconfig-for-raspberrypi-compiler-flags.patch
@@ -0,0 +1,97 @@
+commit ea40fa36eef15384b4c0218fb102f92f5cd1cdff
+Author: Ilya Tumaykin <itumaykin@gmail.com>
+Date: Fri Jan 27 21:20:29 2017 +0300
+
+build: rpi: rely on pkgconfig for compiler flags
+
+Upstream provides pkgconfig files for quite some time now [1,2].
+Use them to determine the required flags instead of hard coding.
+
+This makes cross-compilation easy, which I dare to say is important for
+many raspberry-pi users. This also prevents picking libEGL and libGLESv2
+from mesa when they are present, which can happen with the current code.
+
+Good distros should put these pkgconfig files into default pkg-config
+search path or populate PKG_CONFIG_PATH for users. However, be nice to
+everybody and manually look into '/opt/vc/lib/pkgconfig' just in case.
+Hence the PKG_CONFIG_PATH mangling.
+
+[1]: https://github.com/raspberrypi/userland/issues/245
+[2]: https://github.com/raspberrypi/userland/commit/05d60a01d53dca363bb4286594db1826ffff8762
+
+diff --git a/waftools/checks/custom.py b/waftools/checks/custom.py
+index 50a16ce26..bf8e5a0b0 100644
+--- a/waftools/checks/custom.py
++++ b/waftools/checks/custom.py
+@@ -4,7 +4,7 @@ from waflib import Utils
+ import os
+
+ __all__ = ["check_pthreads", "check_iconv", "check_lua", "check_oss_4front",
+- "check_cocoa", "check_openal"]
++ "check_cocoa", "check_openal", "check_rpi"]
+
+ pthreads_program = load_fragment('pthreads.c')
+
+@@ -127,3 +127,29 @@ def check_openal(ctx, dependency_identifier):
+ if fn(ctx, dependency_identifier):
+ return True
+ return False
++
++def check_rpi(ctx, dependency_identifier):
++ # We need MMAL/bcm_host/dispmanx APIs.
++ # Upstream keeps pkgconfig files in '/opt/vc/lib/pkgconfig'.
++ # See https://github.com/raspberrypi/userland/issues/245
++ # PKG_CONFIG_SYSROOT_DIR helps with cross compilation.
++ prev_pkg_path = os.getenv('PKG_CONFIG_PATH', '')
++ os.environ['PKG_CONFIG_PATH'] = os.pathsep.join(
++ filter(None, [os.path.join(os.getenv('PKG_CONFIG_SYSROOT_DIR', '/'),
++ 'opt/vc/lib/pkgconfig'),
++ prev_pkg_path]))
++
++ checks = [
++ check_pkg_config('bcm_host', uselib_store='bcm_host'),
++ check_pkg_config('egl'),
++ check_pkg_config('glesv2'),
++ check_cc(lib=['mmal_core', 'mmal_util', 'mmal_vc_client'], use=['bcm_host']),
++ # We still need all OpenGL symbols, because the vo_opengl code is
++ # generic and supports anything from GLES2/OpenGL 2.1 to OpenGL 4 core.
++ check_statement('GL/gl.h', '(void)GL_RGB32F'), # arbitrary OpenGL 3.0 symbol
++ check_statement('GL/gl.h', '(void)GL_LUMINANCE16') # arbitrary OpenGL legacy-only symbol
++ ]
++
++ ret = all((fn(ctx, dependency_identifier) for fn in checks))
++ os.environ['PKG_CONFIG_PATH'] = prev_pkg_path
++ return ret
+diff --git a/wscript b/wscript
+index 81a048df5..ab853e7ad 100644
+--- a/wscript
++++ b/wscript
+@@ -738,27 +738,9 @@ video_output_features = [
+ 'desc': 'Android support',
+ 'func': check_statement('android/api-level.h', '(void)__ANDROID__'), # arbitrary android-specific header
+ }, {
+- # We need MMAL/bcm_host/dispmanx APIs. Also, most RPI distros require
+- # every project to hardcode the paths to the include directories. Also,
+- # these headers are so broken that they spam tons of warnings by merely
+- # including them (compensate with -isystem and -fgnu89-inline).
+ 'name': '--rpi',
+ 'desc': 'Raspberry Pi support',
+- 'func': compose_checks(
+- check_cc(cflags="-isystem/opt/vc/include/ "+
+- "-isystem/opt/vc/include/interface/vcos/pthreads " +
+- "-isystem/opt/vc/include/interface/vmcs_host/linux " +
+- "-fgnu89-inline",
+- linkflags="-L/opt/vc/lib",
+- header_name="bcm_host.h",
+- lib=['mmal_core', 'mmal_util', 'mmal_vc_client', 'bcm_host']),
+- # We still need all OpenGL symbols, because the vo_opengl code is
+- # generic and supports anything from GLES2/OpenGL 2.1 to OpenGL 4 core.
+- check_cc(lib="EGL"),
+- check_cc(lib="GLESv2"),
+- check_statement('GL/gl.h', '(void)GL_RGB32F'), # arbitrary OpenGL 3.0 symbol
+- check_statement('GL/gl.h', '(void)GL_LUMINANCE16') # arbitrary OpenGL legacy-only symbol
+- ),
++ 'func': check_rpi,
+ }, {
+ 'name': '--standard-gl',
+ 'desc': 'Desktop standard OpenGL support',