[128036] trunk/dports/multimedia/mpv
ionic at macports.org
ionic at macports.org
Tue Nov 11 10:04:03 PST 2014
Revision: 128036
https://trac.macports.org/changeset/128036
Author: ionic at macports.org
Date: 2014-11-11 10:04:03 -0800 (Tue, 11 Nov 2014)
Log Message:
-----------
mpv: add patches required to build on 10.6. compiles, but doesn't yet work as intended at run time.
Modified Paths:
--------------
trunk/dports/multimedia/mpv/Portfile
trunk/dports/multimedia/mpv/files/patch-video_out_gl_common.h-use-OpenGL-legacy.diff
Added Paths:
-----------
trunk/dports/multimedia/mpv/files/patch-audio_out_ao_coreaudio_device.c-compile-fix.diff
trunk/dports/multimedia/mpv/files/patch-misc-add-strnlen.diff
trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.h-remove-NSDraggingDestination-protocol.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff
trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff
trunk/dports/multimedia/mpv/files/patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff
trunk/dports/multimedia/mpv/files/patch-waftools_checks_custom.py-disable-libarclite.diff
Modified: trunk/dports/multimedia/mpv/Portfile
===================================================================
--- trunk/dports/multimedia/mpv/Portfile 2014-11-11 12:16:41 UTC (rev 128035)
+++ trunk/dports/multimedia/mpv/Portfile 2014-11-11 18:04:03 UTC (rev 128036)
@@ -1,5 +1,5 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
-# $Id$
+# $Id: Portfile 125490 2014-09-18 20:46:07Z devans at macports.org $
PortSystem 1.0
PortGroup github 1.0
@@ -141,6 +141,33 @@
Consult ``man mpv'' for further information.
}
}
+
+ # Versions 10.6 and below don't support XCode 4, which is required for ARCLite.
+ # We will have to patch mpv for unofficial Cocoa support.
+ # Also fix some other minor compile issues only manifesting on 10.6 and below along the way.
+ if {${os.major} < 11} {
+ patchfiles-append patch-waftools_checks_custom.py-disable-libarclite.diff \
+ patch-misc-add-strnlen.diff \
+ patch-audio_out_ao_coreaudio_device.c-compile-fix.diff \
+ patch-video_out_cocoa_view.h-remove-NSDraggingDestination-protocol.diff \
+ patch-video_out_cocoa_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff \
+ patch-video_out_cocoa_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff \
+ patch-video_out_cocoa_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff \
+ patch-video_out_cocoa_window.m-fullscreen-fixes.diff \
+ patch-video_out_cocoa_common.m-define-constants.diff \
+ patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff \
+ patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff \
+ patch-osdep_macosx_compat.m-add-subscripting-implementation.diff
+
+ notes-append {
+ On systems older than Lion (10.7), Cocoa output support is currently
+ being patched by the MacPorts maintainer to make it work.
+
+ It is known to be broken.
+
+ Please do not expect it to work or be bug free.
+ }
+ }
}
Added: trunk/dports/multimedia/mpv/files/patch-audio_out_ao_coreaudio_device.c-compile-fix.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-audio_out_ao_coreaudio_device.c-compile-fix.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-audio_out_ao_coreaudio_device.c-compile-fix.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,11 @@
+--- audio/out/ao_coreaudio_device.c.old
++++ audio/out/ao_coreaudio_device.c
+@@ -35,6 +35,8 @@
+ * when you are wanting to do good buffering of audio).
+ */
+
++#include <unistd.h>
++
+ #include "config.h"
+ #include "ao.h"
+ #include "internal.h"
Added: trunk/dports/multimedia/mpv/files/patch-misc-add-strnlen.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-misc-add-strnlen.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-misc-add-strnlen.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,43 @@
+--- common/common.h.old
++++ common/common.h
+@@ -26,6 +26,7 @@
+
+ #include "osdep/compiler.h"
+ #include "talloc.h"
++#include "common/compat.h"
+
+ // double should be able to represent this exactly
+ #define MP_NOPTS_VALUE (-0x1p+63)
+--- common/compat.h.old
++++ common/compat.h
+@@ -0,0 +1,19 @@
++#ifndef COMPAT_H
++#define COMPAT_H
++
++#include <stddef.h>
++#include <errno.h>
++
++static inline size_t strnlen(const char *s, size_t maxlen) {
++ int result = 0;
++
++ if (s != NULL) {
++ const char *iter = s;
++ while ((result < maxlen) && ((*(iter++)) != 0))
++ ++result;
++ }
++
++ return (result);
++}
++
++#endif /* !defined (COMPAT_H) */
+--- ta/ta.h.old
++++ ta/ta.h
+@@ -18,6 +18,8 @@
+ #include <stdbool.h>
+ #include <stdarg.h>
+
++#include "common/compat.h"
++
+ #ifdef __GNUC__
+ #define TA_PRF(a1, a2) __attribute__ ((format(printf, a1, a2)))
+ #define TA_TYPEOF(t) __typeof__(t)
Added: trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-osdep_macosx_compat.m-add-subscripting-implementation.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,67 @@
+--- osdep/macosx_compat.m.old
++++ osdep/macosx_compat.m
+@@ -0,0 +1,54 @@
++/*
++ * This file is part of mpv.
++ *
++ * mpv 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 of the License, or
++ * (at your option) any later version.
++ *
++ * mpv 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 mpv; if not, write to the Free Software Foundation, Inc.,
++ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++ */
++
++#include "osdep/macosx_compat.h"
++
++#if (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8)
++
++ at implementation NSArray (SubscriptingAdditions)
++- (id)objectAtIndexedSubscript:(NSUInteger)index
++{
++ return [self objectAtIndex:index];
++}
++ at end
++
++ at implementation NSMutableArray (SubscriptingAdditions)
++- (void)setObject:(id)object atIndexedSubscript:(NSUInteger)index
++{
++ if (index == [self count])
++ [self addObject:object];
++ else
++ [self replaceObjectAtIndex:index withObject:object];
++}
++ at end
++
++ at implementation NSDictionary (SubscriptingAdditions)
++- (id)objectForKeyedSubscript:(id)key
++{
++ return [self objectForKey:key];
++}
++ at end
++
++ at implementation NSMutableDictionary (SubscriptingAdditions)
++- (void)setObject:(id)object forKeyedSubscript:(id)key
++{
++ [self setObject:object forKey:key];
++}
++ at end
++
++#endif
+--- wscript_build.py.old
++++ wscript_build.py
+@@ -385,6 +385,7 @@
+ ( "osdep/ar/HIDRemote.m", "cocoa" ),
+ ( "osdep/macosx_application.m", "cocoa-application" ),
+ ( "osdep/macosx_events.m", "cocoa" ),
++ ( "osdep/macosx_compat.m" ),
+ ( "osdep/semaphore_osx.c" ),
+ ( "osdep/path-macosx.m", "cocoa" ),
+ ( "osdep/path-win.c", "os-win32" ),
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-define-constants.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,17 @@
+--- video/out/cocoa_common.m.old
++++ video/out/cocoa_common.m
+@@ -48,6 +48,14 @@
+
+ #define CF_RELEASE(a) if ((a) != NULL) CFRelease(a)
+
++/* not used on OS X < 10.8 */
++#if !defined(MAC_OS_X_VERSION_10_8) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_8
++#define kIOPMAssertionTypePreventUserIdleDisplaySleep CFSTR("PreventUserIdleDisplaySleep")
++enum {
++ NSWindowCollectionBehaviorFullScreenPrimary = 0,
++};
++#endif
++
+ static void vo_cocoa_fullscreen(struct vo *vo);
+ static void vo_cocoa_ontop(struct vo *vo);
+ static void cocoa_change_profile(struct vo *vo, char **store, NSScreen *screen);
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_common.m-use-deprecated-ColorSync-functions.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,35 @@
+--- video/out/cocoa_common.m.old
++++ video/out/cocoa_common.m
+@@ -553,6 +553,8 @@
+ CGDirectDisplayID displayID = (CGDirectDisplayID)
+ [[screen deviceDescription][@"NSScreenNumber"] unsignedLongValue];
+
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++
+ CFUUIDRef uuid = CGDisplayCreateUUIDFromDisplayID(displayID);
+ if (CFGetTypeID(uuid) == CFNullGetTypeID()) {
+ MP_ERR(s, "cannot get display UUID.\n");
+@@ -617,6 +619,23 @@
+ if (!result)
+ MP_ERR(s, "cannot get display profile path.\n");
+
++#else // 10.6 and lower
++
++ CMProfileRef profile = 0;
++ CMProfileLocation location;
++ int error = CMGetProfileByAVID ((CMDisplayIDType) displayID, &profile);
++ if (!error) {
++ UInt32 size = sizeof (location);
++ error = NCMGetProfileLocation (profile, &location, &size);
++ result = talloc_strdup (vo, location.u.pathLoc.path);
++ CMCloseProfile (profile);
++ }
++ else {
++ result = talloc_strdup (vo, "/System/Library/ColorSync/Profiles/Generic RGB Profile.icc");
++ }
++
++#endif
++
+ get_icc_profile_path_err_out:
+ CF_RELEASE(device_info);
+ return result;
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.h-remove-NSDraggingDestination-protocol.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.h-remove-NSDraggingDestination-protocol.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.h-remove-NSDraggingDestination-protocol.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,11 @@
+--- video/out/cocoa/view.h.old
++++ video/out/cocoa/view.h
+@@ -18,7 +18,7 @@
+ #import <Cocoa/Cocoa.h>
+ #import "video/out/cocoa/mpvadapter.h"
+
+- at interface MpvVideoView : NSView <NSDraggingDestination> {
++ at interface MpvVideoView : NSView {
+ BOOL hasMouseDown;
+ }
+ @property(nonatomic, retain) MpvCocoaAdapter *adapter;
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertPointToBacking-with-userSpaceScaleFactor.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,13 @@
+--- video/out/cocoa/view.m.old
++++ video/out/cocoa/view.m
+@@ -165,7 +165,9 @@
+ - (NSPoint)convertPointToPixels:(NSPoint)point
+ {
+ point = [self convertPoint:point fromView:nil];
+- point = [self convertPointToBacking:point];
++ CGFloat scale_factor = [self.window userSpaceScaleFactor];
++ //point = [self convertPointToBacking:point];
++ point = NSMakePoint (point.x * scale_factor, point.y * scale_factor);
+ // flip y since isFlipped returning YES doesn't affect the backing
+ // coordinate system
+ point.y = -point.y;
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectFromScreen-with-convertScreenToBase.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,16 @@
+--- video/out/cocoa/view.m.old
++++ video/out/cocoa/view.m
+@@ -109,7 +109,12 @@
+ - (BOOL)containsMouseLocation
+ {
+ NSRect vF = [[self.window screen] visibleFrame];
+- NSRect vFW = [self.window convertRectFromScreen:vF];
++ NSPoint vFStart = vF.origin;
++ NSPoint vFEnd = NSMakePoint (vFStart.x + vF.size.width, vFStart.y + vF.size.height);
++ //NSRect vFW = [self.window convertRectFromScreen:vF];
++ NSPoint vFStartW = [self.window convertScreenToBase:vFStart];
++ NSPoint vFEndW = [self.window convertScreenToBase:vFEnd];
++ NSRect vFW = NSMakeRect (vFStartW.x, vFStartW.y, vFEndW.x - vFStartW.x, vFEndW.y - vFStartW.y);
+ NSRect vFV = [self convertRect:vFW fromView:nil];
+ NSPoint pt = [self convertPoint:[self mouseLocation] fromView:nil];
+
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_view.m-replace-convertRectToBacking-with-userSpaceScaleFactor.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,19 @@
+--- video/out/cocoa/view.m.old
++++ video/out/cocoa/view.m
+@@ -130,7 +130,15 @@
+
+ - (NSRect)frameInPixels
+ {
+- return [self convertRectToBacking:[self frame]];
++ NSRect cur_frame = self.frame;
++ NSPoint frame_point = cur_frame.origin;
++ NSSize frame_extents = cur_frame.size;
++ CGFloat scale_factor = [self.window userSpaceScaleFactor];
++ NSPoint conv_frame_point = NSMakePoint (frame_point.x * scale_factor, frame_point.y * scale_factor);
++ NSSize conv_frame_extents = NSMakeSize (frame_extents.width * scale_factor, frame_extents.height * scale_factor);
++ NSRect conv_frame = NSMakeRect (conv_frame_point.x, conv_frame_point.y, conv_frame_extents.width, conv_frame_extents.height);
++ //return [self.window convertRectToBacking:[self frame]];
++ return conv_frame;
+ }
+
+ - (BOOL)canHideCursor
Added: trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_cocoa_window.m-fullscreen-fixes.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,17 @@
+--- video/out/cocoa/window.m.old
++++ video/out/cocoa/window.m
+@@ -27,6 +27,14 @@
+
+ #include "window.h"
+
++#if !defined(MAC_OS_X_VERSION_10_7) || MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_7
++enum {
++ NSFullScreenWindowMask = 0,
++ NSApplicationPresentationFullScreen = 0,
++ NSApplicationPresentationAutoHideToolbar = 0,
++};
++#endif
++
+ @implementation MpvVideoWindow {
+ NSSize _queued_video_size;
+ }
Added: trunk/dports/multimedia/mpv/files/patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_gl_cocoa.c-hardcode-OpenGL-2.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,36 @@
+--- video/out/gl_cocoa.c.old
++++ video/out/gl_cocoa.c
+@@ -56,6 +56,8 @@
+ struct cgl_context *p = ctx->priv;
+ CGLError err;
+
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
++
+ CGLOpenGLProfile gl_vers_map[] = {
+ [2] = kCGLOGLPVersion_Legacy,
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_9
+@@ -66,15 +68,24 @@
+ #endif
+ };
+
++#endif
++
+ int gl_major = MPGL_VER_GET_MAJOR(ctx->requested_gl_version);
++
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ if (gl_major < 2 || gl_major >= MP_ARRAY_SIZE(gl_vers_map)) {
++#else
++ if (gl_major != 2) {
++#endif
+ MP_FATAL(ctx->vo, "OpenGL major version %d not supported", gl_major);
+ return false;
+ }
+
+ CGLPixelFormatAttribute attrs[] = {
++#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+ kCGLPFAOpenGLProfile,
+ (CGLPixelFormatAttribute) gl_vers_map[gl_major],
++#endif
+ kCGLPFADoubleBuffer,
+ kCGLPFAAccelerated,
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_8
Modified: trunk/dports/multimedia/mpv/files/patch-video_out_gl_common.h-use-OpenGL-legacy.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-video_out_gl_common.h-use-OpenGL-legacy.diff 2014-11-11 12:16:41 UTC (rev 128035)
+++ trunk/dports/multimedia/mpv/files/patch-video_out_gl_common.h-use-OpenGL-legacy.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -1,5 +1,5 @@
---- video/out/gl_common.h.old 2014-08-12 03:40:56.000000000 +0200
-+++ video/out/gl_common.h 2014-08-12 03:41:27.000000000 +0200
+--- video/out/gl_common.h.old
++++ video/out/gl_common.h
@@ -38,11 +38,11 @@
#include "video/mp_image.h"
Added: trunk/dports/multimedia/mpv/files/patch-waftools_checks_custom.py-disable-libarclite.diff
===================================================================
--- trunk/dports/multimedia/mpv/files/patch-waftools_checks_custom.py-disable-libarclite.diff (rev 0)
+++ trunk/dports/multimedia/mpv/files/patch-waftools_checks_custom.py-disable-libarclite.diff 2014-11-11 18:04:03 UTC (rev 128036)
@@ -0,0 +1,11 @@
+--- waftools/checks/custom.py.old
++++ waftools/checks/custom.py
+@@ -123,7 +123,6 @@
+ fragment = load_fragment('cocoa.m'),
+ compile_filename = 'test.m',
+ framework_name = ['Cocoa', 'IOKit', 'OpenGL'],
+- includes = ctx.srcnode.abspath(),
+- linkflags = '-fobjc-arc')
++ includes = ctx.srcnode.abspath())
+
+ return fn(ctx, dependency_identifier)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20141111/e8c67727/attachment-0001.html>
More information about the macports-changes
mailing list