[MacPorts] #62177: mpv @0.33.0_2+audiocd+bluray+bundle+dvd+libarchive+network+opengl+osd+python39+rubberband: cannot convert value of type 'CALayerContentsFormat' to specified type 'String'

MacPorts noreply at macports.org
Mon Feb 1 02:41:37 UTC 2021


#62177: mpv
@0.33.0_2+audiocd+bluray+bundle+dvd+libarchive+network+opengl+osd+python39+rubberband:
cannot convert value of type 'CALayerContentsFormat' to specified type
'String'
---------------------+----------------------
  Reporter:  JDLH    |      Owner:  ionic@…
      Type:  defect  |     Status:  assigned
  Priority:  Normal  |  Milestone:
 Component:  ports   |    Version:  2.6.4
Resolution:          |   Keywords:
      Port:  mpv     |
---------------------+----------------------

Comment (by kencu):

 Xcode 10.1 comes with the MacOSX10.14.sdk.

 If MacPorts does not find the MacOS10.13.sdk on 10.13, it then drops back
 to use MacOS.sdk.

 In Xcode 10, MacOSX.sdk is a symlink to the MacOSX10.14.sdk.

 In mph, they have generated a "swift compatibility module, here:
 {{{
 osdep/macos/swift_compat.swift
 }}}

 In that file, there is this block
 {{{
 #if !HAVE_MACOS_10_14_FEATURES
 extension NSAppearance.Name {
     static let darkAqua: NSAppearance.Name = NSAppearance.Name(rawValue:
 "NSAppearanceNameDarkAqua")
     static let accessibilityHighContrastAqua: NSAppearance.Name =
 NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityAqua")
     static let accessibilityHighContrastDarkAqua: NSAppearance.Name =
 NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityDarkAqua")
     static let accessibilityHighContrastVibrantLight: NSAppearance.Name =
 NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantLight")
     static let accessibilityHighContrastVibrantDark: NSAppearance.Name =
 NSAppearance.Name(rawValue: "NSAppearanceNameAccessibilityVibrantDark")
 }

 @available(OSX 10.12, *)
 extension String {
     static let RGBA16Float: String = kCAContentsFormatRGBA16Float
     static let RGBA8Uint: String = kCAContentsFormatRGBA8Uint
     static let gray8Uint: String = kCAContentsFormatGray8Uint
 }
 #endif
 }}}

 this compatibility block seems to be what is generating the error. I don't
 see exactly where this MACRO gets defined during the build of mpv:
 {{{
 HAVE_MACOS_10_14_FEATURES
 }}}

 But disabling that by doing this:
 {{{
 - #if !HAVE_MACOS_10_14_FEATURES
 + #if false
 extension NSAppearance.Name {
 }}}

 and {{{mpv}}} builds through without trouble on 10.13 using the Xcode
 10.14 SDK.
 {{{
 $ port -v installed mpv
 The following ports are currently installed:
   mpv
 @0.33.0_2+audiocd+bluray+bundle+dvd+libarchive+network+opengl+osd+python39+rubberband
 (active) platform='darwin 17' archs='x86_64'
 date='2021-01-31T18:23:56-0800'
 }}}

 One solution to this (not the one I will use) would be to drop 10.13 back
 to Xcode 9, which came with the 10.13 SDK.

 Another solution is to make a very trivial patch to change that blocker
 the way I did.

 Another solution would be to find out how and why
 {{{HAVE_MACOS_10_14_FEATURES}}} is being defined, and decide if it should
 be defined if you are building with the MacOSX10.14.sdk, which I would
 hazard that it should, but I don't do a whole lot of swift.

 Another solution (the one I did on my other 10.13 system) is to get the
 MacOS10.13.sdk from Xcode 9, and put it next the the MacOS10.14.sdk in the
 proper location in Xcode, and in the similar proper location in the CLTs.
 You might have one copy of the MacOSX10.13.sdk in, say,
 {{{/Library/Developer/SavedSDKs/}}} and then put a symlink into Xcode 10.1
 and into the CLTs in the proper place.

 Any of these options should work for you. All of  them have their plusses
 and minuses. Please pick the one you like best.

 For the maintainer, I leave it to you to decide which, if any, of these
 you prefer to recommend.

-- 
Ticket URL: <https://trac.macports.org/ticket/62177#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list