[MacPorts] #55404: mpv @0.26.0: You manually enabled the feature 'cocoa', but the autodetection check failed

MacPorts noreply at macports.org
Thu Nov 30 07:02:35 UTC 2017


#55404: mpv @0.26.0: You manually enabled the feature 'cocoa', but the
autodetection check failed
----------------------+--------------------
  Reporter:  mrkapqa  |      Owner:  Ionic
      Type:  defect   |     Status:  closed
  Priority:  Normal   |  Milestone:
 Component:  ports    |    Version:  2.4.2
Resolution:  fixed    |   Keywords:  lion
      Port:  mpv      |
----------------------+--------------------

Comment (by ryandesign):

 Suppose Apple introduces a new feature in macOS. For example, in Sierra
 they introduced
 [https://developer.apple.com/library/content/releasenotes/AppKit/RN-
 AppKitOlderNotes/index.html#10_12Window%20Tabbing automatic window
 tabbing]. An app may wish to do something with that feature if it is
 available. For example, the web browser QupZilla implements its own tab
 system, so it wants to
 [https://github.com/QupZilla/qupzilla/commit/9af542aa03402eaa8b595b356871ae61c47522c7
 opt out of automatic window tabbing] if running on a system with that
 feature.

 The way Apple wants you to do that is to test whether an object responds
 to a particular selector, and if so, then you know that the new OS feature
 is available and you can run the code that requires it. For example, if
 `NSWindow` responds to the `allowsAutomaticWindowTabbing` selector, that
 tells you that `NSWindow` has an `allowsAutomaticWindowTabbing` property
 that you can set. But a selector is a runtime check. At compile time, the
 compiler still has to be able to understand all the code inside that
 conditional block, and if you're using an old SDK created before automatic
 window tabbing was invented, then the `NSWindow` object described in the
 SDK won't have an `allowsAutomaticWindowTabbing` property and the
 [https://github.com/QupZilla/qupzilla/issues/2473 build will fail]. So you
 need to use a newer SDK (or use `#ifdef`s to hide the new code when
 compiling on older SDKs, as QupZilla did.)

 libsdl2 had already been coded to produce a working binary for 10.6 if
 compiled with the 10.7 or later SDK (and `MACOSX_DEPLOYMENT_TARGET=10.6`
 of course). Mojca did an [comment:ticket:52210:9 extensive analysis] of
 all the reasons why libsdl2 needed the 10.7 SDK.

 In the case of mpv it's not a new selector they're using but some other
 new behavior that is apparently coupled with the 10.8 SDK. I don't claim
 to understand it all, I can only say that I confirmed the build failure on
 10.7 when using the system SDK, and the build failure was resolved by
 using the 10.8 SDK.

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


More information about the macports-tickets mailing list