Discussion:
[MacPorts] #52210: libsdl2 can build on 10.6, but instructions a bit vague
MacPorts
2016-09-11 18:14:00 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
------------------------------------+--------------------------------
Reporter: kenneth.f.cunningham@… | Owner: macports-tickets@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Keywords: libsdl2 | Port:
------------------------------------+--------------------------------
This one might be nitpicky I suppose, but it stuck me for while.

libsdl2 does build and run nicely on 10.6, but indeed, as the instructions
say "Building $name requires OS X 10.7 SDK or later"

At first, I thought this was a no-go on 10.6, and it wasn't initially
obvious to me that what was needed was to copy the MacOSX10.7.sdk from
another machine to ${developer_dir}/SDKs/MacOSX10.7.sdk, and that only
this exact SDK would work. Then the build on 10.6 goes fine.

How about something like:

error "Building $name on MacOSX 10.6 requires the MacOSX10.7.sdk to be
present in ${developer_dir}/SDKs/"
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-09-11 21:52:44 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+-------------------
Reporter: kenneth.f.cunningham@… | Owner: jmr@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+-------------------
Changes (by ryandesign@…):

* owner: macports-tickets@… => jmr@…
* keywords: libsdl2 =>
* port: => libsdl2
* cc: jmr@… (removed)


Comment:

You observations sound correct, but I'm not thrilled about asking users to
modify the contents of /Developer/SDKs. As far as I know, Apple does not
provide a sanctioned way of having the 10.7 SDK on 10.6, and MacPorts
currently doesn't do anything to advocate circumventing that.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:1>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-09-12 02:08:39 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+-------------------
Reporter: kenneth.f.cunningham@… | Owner: jmr@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+-------------------

Comment (by kenneth.f.cunningham@…):

I know -- I find this "build to an SDK for another OS version" business
still a little magical.

I think if the 10.7 SDK is sitting there but isn't specifically referenced
by the software being built, it is just ignored, but of course as I'm sure
you know better than most, one never really knows how it might move into
the mix. You could add it, build libSDL2 universal, and then delete it or
archive it. That would keep it out of sight for the unforeseen other
unknowns.

I'm not certain how much new software libSDL2 would allow to run on 10.6
that might otherwise not be able to run -- probably quite a bit, I would
imagine.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-09-12 06:55:47 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+-------------------
Reporter: kenneth.f.cunningham@… | Owner: jmr@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+-------------------

Comment (by jmr@…):

SDL upstream doesn't really support this either, the extent of the 10.6
compatibility offered is that you can build on 10.7 or later with
MACOSX_DEPLOYMENT_TARGET=10.6 and get a binary that will run on 10.6.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:3>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-09-12 07:26:37 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+-------------------
Reporter: kenneth.f.cunningham@… | Owner: jmr@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+-------------------

Comment (by kenneth.f.cunningham@…):

I guess my only point with this ticket was that I saw you had already done
the work in the portfile to screen for 10.6, and then to file check for
the 10.7SDK to see if libSDL2 should build -- and I thought you were
trying to tell people what they had to do to make it work, but figured you
might make the message a little more direct for us slower folk. -- K
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-09-12 14:14:05 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+-------------------
Reporter: kenneth.f.cunningham@… | Owner: jmr@…
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+-------------------

Comment (by kenneth.f.cunningham@…):

I was curious whether libSDL2 linked to or depended in any way on the
10.7SDK once built, but it doesn't appear to -- I have to read more about
how this works. I guess it just uses the headers and other information in
the 10.7SDK to run the build correctly...I wonder if this approach might
work for any other software on 10.6 too (like qt5, for example...).

{{{
$ otool -L /opt/local/lib/libSDL2-2.0.0.dylib
/opt/local/lib/libSDL2-2.0.0.dylib:
/opt/local/lib/libSDL2-2.0.0.dylib (compatibility version 5.0.0,
current version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current
version 159.1.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current
version 228.0.0)
/System/Library/Frameworks/ForceFeedback.framework/Versions/A/ForceFeedback
(compatibility version 1.0.0, current version 1.0.2)
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
(compatibility version 1.2.0, current version 1.7.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
(compatibility version 1.0.0, current version 17.0.0)
/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
(compatibility version 2.0.0, current version 153.0.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
(compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
(compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
(compatibility version 45.0.0, current version 1138.47.0)
/System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
(compatibility version 1.0.0, current version 41.0.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
(compatibility version 150.0.0, current version 635.21.0)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
(compatibility version 1.0.0, current version 53.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
(compatibility version 300.0.0, current version 833.25.0)

}}}
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-10-30 15:10:39 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Changes (by ryandesign):

* cc: ryandesign (added)
Post by MacPorts
You observations sound correct, but I'm not thrilled about asking users
to modify the contents of /Developer/SDKs. As far as I know, Apple does
not provide a sanctioned way of having the 10.7 SDK on 10.6, and MacPorts
currently doesn't do anything to advocate circumventing that.

I'm changing my mind on this. There should be no harm to copying a 10.7
SDK into /DeveloperSDKs on Snow Leopard. I'll try it out and if that
works, then I'll add that SDK to the 10.6 buildbot workers.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:6>
MacPorts <https://www.macports.org/>
Ports system for OS X
MacPorts
2016-11-02 09:14:37 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version: 2.3.4
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by jmroot):

If we need to add a compiler blacklist here as per
[https://github.com/macports/macports-ports/pull/5 PR#5], I imagine it
would be needed when actually building on 10.7 as well. Might need some
more testing to find out exactly which compiler versions work.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:7>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 10:27:21 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Changes (by mojca):

* cc: jeremyhu (added)
* version: 2.3.4 =>


Comment:

Jeremy asked why the port could not be built without 10.7 SDK. Here's the
very first problem one hits:
{{{
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/SDL_error.c:120:
warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/SDL_error.c:224:
warning: expected [error|warning|ignored] after '#pragma GCC diagnostic'
CC build/SDL_hints.lo
CC build/SDL_log.lo
CC build/SDL_atomic.lo
CC build/SDL_spinlock.lo
CC build/SDL_audio.lo
CC build/SDL_audiocvt.lo
CC build/SDL_audiodev.lo
CC build/SDL_audiotypecvt.lo
CC build/SDL_mixer.lo
CC build/SDL_wave.lo
CC build/SDL_cpuinfo.lo
CC build/SDL_dynapi.lo
In file included from
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/dynapi/SDL_dynapi.c:31:
include/SDL_syswm.h:230:65: error: missing binary operator before token
"("
make: *** [build/SDL_dynapi.lo] Error 1
make: Leaving directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5'
Command failed: cd
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5"
&& /usr/bin/make -w all
Exit code: 2
}}}

After blacklisting the old compiler with
{{{
compiler.blacklist *gcc* { clang < 211 }
}}}
(I took the list from Ken Cunningham, I don't know whether also the latest
gcc versions are bad.)

the following problem pops up:
{{{
CC build/SDL_cocoaevents.lo
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaevents.m:332:40:
error: use of undeclared identifier 'NSAppKitVersionNumber10_6'; did you
mean 'NSAppKitVersionNumber'?
if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_6) {
^~~~~~~~~~~~~~~~~~~~~~~~~
NSAppKitVersionNumber
/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:21:28:
note: 'NSAppKitVersionNumber' declared here
APPKIT_EXTERN const double NSAppKitVersionNumber;
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaevents.m:445:9:
warning: implicit declaration of function
'IOPMAssertionCreateWithDescription' is invalid in C99 [-Wimplicit-
function-declaration]
IOPMAssertionCreateWithDescription(kIOPMAssertPreventUserIdleDisplaySleep,
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaevents.m:445:44:
error: use of undeclared identifier
'kIOPMAssertionTypePreventUserIdleDisplaySleep'
IOPMAssertionCreateWithDescription(kIOPMAssertPreventUserIdleDisplaySleep,
^
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.5/src/video/cocoa/SDL_cocoaevents.m:33:48:
note: expanded from macro 'kIOPMAssertPreventUserIdleDisplaySleep'
#define kIOPMAssertPreventUserIdleDisplaySleep
kIOPMAssertionTypePreventUserIdleDisplaySleep
^
1 warning and 2 errors generated.
make: *** [build/SDL_cocoaevents.lo] Error 1
}}}

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:9>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 19:39:21 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Post by MacPorts
If we need to add a compiler blacklist here as per
[https://github.com/macports/macports-ports/pull/5 PR#5], I imagine it
would be needed when actually building on 10.7 as well. Might need some
more testing to find out exactly which compiler versions work.

I didn't try on 10.7 - but the libsdl2 docs indicate it will build on a
stock 10.7 system, so whatever clang version that represents would appear
to be good enough. I suppose we might just check if the 10.7 buildbot
built it, and that would answer the question.

As to which clang -- I set the bar at 211, and that pulled in clang-3.4,
which worked. As per other macports documentation, that test would appear
to be sufficient, and plumbing the bottom didn't seem to be worth the time
it would take to explicitly figure it out.

To be honest, I would personally be inclined to set the bar such that
clang-3.7 was pulled in (I think all 10.6 users should be using that, if
they are going to pull in anything at all), but here I'm deferring to
other admins who felt that wasn't the right thing to do.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:11>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 19:47:37 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by ken-cunningham-webuse):

Oh - Mojca -- what a great effort! Thanks.

Re: gcc -- I can't see any newer gcc working - the last one that spoke
"Apple" even half-decently was 4.2, and that doesn't work. -- Best, Ken

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:12>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 20:08:20 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Post by MacPorts
I didn't try on 10.7 - but the libsdl2 docs indicate it will build on a
stock 10.7 system, so whatever clang version that represents would appear
to be good enough.

Is that a stock 10.7 system with Xcode 4.1 or one with Xcode 4.6.3? The
former uses llvm-gcc-4.2.
Post by MacPorts
To be honest, I would personally be inclined to set the bar such that
clang-3.7 was pulled in (I think all 10.6 users should be using that, if
they are going to pull in anything at all), but here I'm deferring to
other admins who felt that wasn't the right thing to do.

That isn't how compiler selection works. You get the first compiler in the
fallback list that is available and not blacklisted.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:13>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 20:19:40 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Post by MacPorts
Is that a stock 10.7 system with Xcode 4.1 or one with Xcode 4.6.3? The
former uses llvm-gcc-4.2.


I wish I knew how to quickly check the buildbot for you and answer that. I
haven't spent much time with 10.7, although I do have it installed and
could go there (once about 36 hours of Jeremy's compiler updates finish
building on 10.6!)
Post by MacPorts
That isn't how compiler selection works. You get the first compiler in
the fallback list that is available and not blacklisted.


I think I see -- I meant that I personally would have blacklisted { clang
< `whatever-clang-3.7-is` } and skipped pulling in clang-3.4, if it were
up to me.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:14>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 20:26:27 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Post by MacPorts
Post by MacPorts
Is that a stock 10.7 system with Xcode 4.1 or one with Xcode 4.6.3?
The former uses llvm-gcc-4.2.
Post by MacPorts
I wish I knew how to quickly check the buildbot for you and answer that.
I haven't spent much time with 10.7, although I do have it installed and
could go there (once about 36 hours of Jeremy's compiler updates finish
building on 10.6!)

The point is we don't write Portfiles to run only on the buildbot.
Post by MacPorts
Post by MacPorts
That isn't how compiler selection works. You get the first compiler in
the fallback list that is available and not blacklisted.
Post by MacPorts
I think I see -- I meant that I personally would have blacklisted {
clang < `whatever-clang-3.7-is` } and skipped pulling in clang-3.4, if it
were up to me.

'clang' means the system clang. It's either used or not. If not, the next
compiler in the fallback list is used. That is macports-clang-3.4 because
clang 3.5+ requires libc++.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:15>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-02 20:45:42 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
That is macports-clang-3.4 because clang 3.5+ requires libc++.
Ah, thanks, of course - now I fully understand why it has to fallback to
clang-3.4 and no higher on stock (i.e. not upgraded with
[wiki:LibcxxOnOlderSystems]) systems. I appreciate your taking the time to
explain that.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:16>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 03:28:09 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by jeremyhu):

include/SDL_syswm.h:230 does
{{{
#if defined(__OBJC__) && defined(__has_feature) && __has_feature(objc_arc)
}}}

That's clearly a bug in libsdl that has nothing to do with the 10.7 SDK.
They need to check if __has_feature is defined *BEFORE* using it, not in
the same line. This should be:

{{{
#if defined(__OBJC__) && defined(__has_feature)
# if __has_feature(objc_arc)
# endif
#endif
}}}

---

Your NSAppKitVersionNumber10_6 fix looks good. It can also be defined
locally if it isn't available. Upstream should probably do:

{{{
#ifndef NSAppKitVersionNumber10_6
#define NSAppKitVersionNumber10_6 1038
#endif
}}}

I suggest just we just do:

{{{
platform darwin {
if {${os.major} < 11} {
configure.cppflags-append -DNSAppKitVersionNumber10_6=1038
}
}
}}}

---

For the IOPMAssertionCreateWithDescription issue, you can do:
{{{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
#if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070
if (& IOPMAssertionCreateWithDescription)
#endif
IOPMAssertionCreateWithDescription(...);
#endif
}}}

---

Your `-convertRectToScreen` fix looks good.

---

I'll check the others later.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:17>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 04:22:42 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by ryandesign):

The MacOSX10.7 SDK from Xcode 4.6.3 is on the 10.6 buildbot workers now.
The [https://build.macports.org/builders/ports-10.6_i386_legacy-
builder/builds/9811 build still fails], perhaps because gcc and old clang
haven't been blacklisted as [https://github.com/macports/macports-
ports/pull/10/commits/dda75feb52b2c20d56976c7a60daf144fc416b39 suggested
in this PR].

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:18>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 06:59:55 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by ken-cunningham-webuse):

In [changeset:"f944d47a301854179ef1830bb66fe71a5058a3b8/macports-ports"
f944d47a/macports-ports]:
{{{
#!ConfigurableCommitTicketReference repository="macports-ports"
revision="f944d47a301854179ef1830bb66fe71a5058a3b8"
libsdl2: minor edits to allow building on 10.6

* Blacklist compilers that are too old
* Be more specific about the problem and suggest that
installing 10.7 SDK might solve the problem
* Remove the Id line

See: https://trac.macports.org/ticket/52210
Closes: #10
}}}

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:19>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 07:15:13 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by mojca):

I committed the patch that blacklists the compilers and the two builds on
10.6 seem to have succeeded:

* [https://build.macports.org/builders/ports-10.6_i386_legacy-
builder/builds/9813 10.6_i386]
* [https://build.macports.org/builders/ports-10.6_x86_64_legacy-
builder/builds/9605 10.6_x86_64]

Thanks.

I would suggest to rename this particular ticket into something like "an
attempt to make the port build without the 10.7 SDK".
Post by MacPorts
Your `-convertRectToScreen` fix looks good.
It's not a fix. It's part of the code that throws an error and had to be
commented out :)

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:20>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 09:14:56 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------
Post by MacPorts
It's not a fix. It's part of the code that throws an error and had to be
commented out :)

Oh, I just assumed you added the respondsToSelector:bits.

You'll want to do something like:
{{{
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
if ([window respondsToSelector:@selector(convertRectToScreen:)]) {
rect = [window convertRectToScreen:rect];
} else {
rect.origin = [window convertBaseToScreen:rect.origin];
}
#else
rect.origin = [window convertBaseToScreen:rect.origin];
#endif
}}}

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:21>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 09:30:23 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by mojca):

Thank you. I believe I should be able to fix all problems now, but the
number of issues with `SDL_cocoawindow.m` is still pretty high (and lower
on the priority list).

Btw: we now have `#!objc` syntax working. If you put this on top, you get
proper syntax highlighting :)

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:22>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 12:24:08 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by jmroot):

The reporter's issue has been resolved by merging the PR. These fixes
should be sent upstream, but I'm not sure there's a lot of value in
patching the port further at this stage.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:23>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 13:11:49 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by mojca):

Which fixes (for sending upstream) do you mean? We should either provide a
full patch that would allow building against 10.6 SDK or no patch at all.
The patch that complicates the source code without allowing to build
against 10.6 SDK doesn't really serve anyone.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:24>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 13:16:26 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by jmroot):

Yes, I agree entirely. I thought you were close to a full patch.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:25>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 13:30:06 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by mojca):

I fixed (or know how to fix) approximately 9 errors in 4 files, but there
are 19 more in the last file that I didn't yet look into. They are
probably straightforward to fix though.

I just didn't get the "fixes should be sent upstream" vs. "there's no
value in patching any further" because those two statements seem to
conflict with each other. I don't know if upstream would accept patches.
It's slightly less relevant for us now that Ryan fixed the issue on the
buildbot, but it might still be valuable if users could build from source
out-of-the-box. What is not clear to me is how much maintenance burden
patching might introduce in the future in case upstream rejects the
patches. I would say that it might be worth trying with to get the patches
upstream (with some low priority) or at least ask them for opinion
upfront.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:26>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 13:36:22 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by jmroot):

Let me put it this way: Try to get the patches accepted upstream. If they
are, we can just remove the workarounds next release. If upstream isn't
interested, we can look at whether we want to maintain a patch set.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:27>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 14:34:58 UTC
Permalink
#52210: libsdl2 can build on 10.6, but instructions a bit vague
-------------------------------------+--------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords:
Port: libsdl2 |
-------------------------------------+--------------------

Comment (by mojca):

They answered that accepting patches
would be fine as long as it doesn't introduce any regressions or
significant code complexity
I would say that's a good sign to proceed.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:28>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 14:36:18 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by mojca):

* keywords: => snowleopard


--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:29>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 14:38:18 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Post by MacPorts
This one might be nitpicky I suppose, but it stuck me for while.
libsdl2 does build and run nicely on 10.6, but indeed, as the
instructions say "Building $name requires OS X 10.7 SDK or later"
At first, I thought this was a no-go on 10.6, and it wasn't initially
obvious to me that what was needed was to copy the MacOSX10.7.sdk from
another machine to ${developer_dir}/SDKs/MacOSX10.7.sdk, and that only
this exact SDK would work. Then the build on 10.6 goes fine.
error "Building $name on MacOSX 10.6 requires the MacOSX10.7.sdk to be
present in ${developer_dir}/SDKs/"
New description:

This one might be nitpicky I suppose, but it stuck me for while.

libsdl2 does build and run nicely on 10.6, but indeed, as the instructions
say "Building $name requires OS X 10.7 SDK or later"

At first, I thought this was a no-go on 10.6, and it wasn't initially
obvious to me that what was needed was to copy the MacOSX10.7.sdk from
another machine to ${developer_dir}/SDKs/MacOSX10.7.sdk, and that only
this exact SDK would work. Then the build on 10.6 goes fine.

How about something like:

{{{
error "Building $name on Mac OS X 10.6 requires the MacOSX10.7.sdk to be
present in ${developer_dir}/SDKs/"
}}}

Addendum my mojca: the above mentioned issue has been addressed, but let's
turn this ticket into an effort to make the software build natively
against 10.6 SDK.

--

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:30>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-03 17:38:55 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by jeremyhu):

mojca, can you push what you've got later today? If I have time this
weekend, I'll take a closer look as well.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:31>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-07 21:10:14 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by udbraumann):

Though presently the focus is on building `libsdl2` on 10.6.8, is it
likely that 10.5.8 will never get it?

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:33>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-11-07 21:19:59 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Post by MacPorts
Though presently the focus is on building `libsdl2` on 10.6.8, is it
likely that 10.5.8 will never get it?
Unclear. The official binaries say they're built with a 10.5 deployment
target, but there would likely be more fixes needed to build there due to
SDK differences.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:34>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-12-10 23:59:35 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Here is something interesting along these lines, perhaps.

'''patch to compile SDL2 on Mac OS X 10.5 Leopard'''

this version was written against SLD2 2.0.3 it appears.

<https://gist.github.com/miniupnp/a8f474c504eaa3ad9135>

also, ''this project'' has a downloadable framework version of libsdl2
(between 2.0 and 2.1, says the info) is a fat binary with x86_64, i386,
and PPC code that is apparently compatible back to 10.4. patches are also
included in a directory.

<https://github.com/bitfighter/bitfighter>

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:35>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2016-12-11 09:40:26 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by mojca):

I almost forgot about this ticket. I didn't check the patches for
`include/SDL_config.h` yet, but the rest seems like completely reasonable
patching.

The patch uses
{{{
#!c
#if MAC_OS_X_VERSION_MIN_REQUIRED
}}}
while Jeremy suggested
{{{
#!c
#if __MAC_OS_X_VERSION_MAX_ALLOWED
}}}
I always mix up the difference between the two (the idea is mostly the
same, just different use case) and I guess Jeremy knows better.

Thanks a lot for the good news. It probably makes sense to test that patch
(and perhaps look at my observations above), first on 10.6, then on 10.5,
and submit it upstream.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:36>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-07-02 21:37:10 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

I have libsdl2 working now, on 10.5 PPC, using the patches referenced
above. 10.4 PPC can be next - there is a patch for that too.

It is version 2.0.3 - not sure how practical it is to try for 2.0.4.
Version 2.0.5 seems difficult to enable for 10.5 PPC, although I haven't
tried it using the guidance of this patch for reference.

I'm not sure the (smallish) changes required to the portfile would be
acceptable for the general macports repo. I'll put it in my LeopardPorts
repo until we see what jmr thinks about the whole situation.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:37>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-07-02 21:44:35 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by kencu):

* Attachment "Portfile" added.

libsdl2 2.0.3 Portfile - for 10.4 and 10.5 PPC

--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-07-02 21:44:55 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by kencu):

* Attachment "patch-SDL2-2.0.3_OSX_104.diff" added.


--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-07-02 21:45:12 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by kencu):

* Attachment "patch-SDL2-2.0.3_OSX_105.diff" added.


--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-10-13 13:39:24 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by snigel):

@kencu tried to install the Portfile and diff file manually:

{{{
Error: No checksum set for patch-SDL2-2.0.3_OSX_105.diff
Error: No checksum set for SDL2-2.0.3.tar.gz
}}}


Can I ignore checksum with a flag to ports?
Or should it be added to the ports file?

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:38>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2017-10-13 16:36:03 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@… | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Hi. A fully fixed-up version of this for Leopard is available in this
repo: <https://github.com/kencu/LeopardPorts> and a similar one in
<https://github.com/kencu/TigerPorts> for Tiger. Other Leopard and Tiger
fixes are in there too, mostly focused on PPC.

So far, libsdl2 2.0.3 is as far as we've come, but it's not impossible
that some newer version might become available some day.

If you're not quite sure how to use a local repository, see
<https://guide.macports.org/chunked/development.local-repositories.html>.

Make sure you clone it somewhere usable, like `/opt/LeopardPorts` or
`/Users/Shared/LeopardPorts`, otherwise you'll probably get permissions
issues.

--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:39>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-23 12:52:38 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.4_OSX_105.patch" added.

patch to compile SDL2-2.0.4 under OS X 10.5.8 Leopard
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-23 15:04:14 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.5_OSX_105.patch" added.

patch to compile SDL2.0.5 on OS X 10.5 Leopard
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 01:35:10 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Hey, way to go, Thomas. Thanks!
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:40>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 09:16:33 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by miniupnp):

the patch need more testing, but that a good base ;)
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:41>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 09:27:17 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.6_OSX_105.patch" added.

Patch to build SDL 2.0.6 on OS X 10.5.8 leopard
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 10:09:57 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.7_OSX_105.patch" added.

Patch to build SDL 2.0.7 on OS X 10.5.8 leopard
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 10:36:49 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.8_OSX_105.patch" added.

Patch to build SDL 2.0.8 on OS X 10.5.8 leopard
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-24 13:20:17 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by miniupnp):

https://gist.github.com/miniupnp/6de808a8939711fcb856eaa049c18883
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:42>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-25 20:33:35 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2-2.0.6_OSX_104.patch" added.

Patch to build SDL 2.0.6 on Tiget 10.4.11 - tested to work !
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-25 20:34:13 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by miniupnp):

* Attachment "SDL2_image-2.0.2_OSX_104.patch" added.

bonus : patch for SDL2_image to build under Tiger
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-25 20:36:03 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by miniupnp):

@kencu I spent too much time on this one, but now I have a working SDL
2.0.6 on my Tiger PPC Mac !
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:43>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-05-25 22:04:37 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Thomas, that's great! With any luck, having this version of libsdl2 will
keep the PPC machines in action for many years to come -- one day the
power supplies will all dry up and die, and parts will be too scarce to
find. In the meantime, WooHoo! Thanks.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:44>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-06-19 14:31:59 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by diabzzz):

How do I download the patch? What's the full command to apply it??
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:45>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-06 00:52:44 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by Raptor007):

Are any tricks required for 10.6.8 now other than installing
MacOSX10.7.sdk? Mine is still failing to build:

{{{
:info:build libtool: compile: /opt/local/bin/clang-mp-3.4 -Os
-isysroot/Developer/SDKs/MacOSX10.7.sdk -arch x86_64 -arch i386
-I/opt/local/include -isysroot/Developer/SDKs/MacOSX10.7.sdk
-DUSING_GENERATED_CONFIG_H -Iinclude
-I/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/include
-idirafter
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/src/video/khronos
-mmmx -msse -msse2 -msse3 -Wall -DTARGET_API_MAC_CARBON
-DTARGET_API_MAC_OSX -fvisibility=hidden -Wdeclaration-after-statement
-Werror=declaration-after-statement -D_THREAD_SAFE -c
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/src/video/cocoa/SDL_cocoavideo.m
-o build/SDL_cocoavideo.o >/dev/null 2>&1
:info:build
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/src/video/cocoa/SDL_cocoawindow.m:317:93:
error: use of undeclared identifier
'NSWindowDidChangeBackingPropertiesNotification'; did you mean
'NSWindowDidChangeScreenProfileNotification'?
:info:build [center addObserver:self
selector:@selector(windowDidChangeBackingProperties:)
name:NSWindowDidChangeBackingPropertiesNotification object:window];
:info:build
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build
NSWindowDidChangeScreenProfileNotification
:info:build
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:786:25:
note: 'NSWindowDidChangeScreenProfileNotification' declared here
:info:build APPKIT_EXTERN NSString
*NSWindowDidChangeScreenProfileNotification ;
:info:build ^
:info:build
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/src/video/cocoa/SDL_cocoawindow.m:448:42:
error: use of undeclared identifier
'NSWindowDidChangeBackingPropertiesNotification'; did you mean
'NSWindowDidChangeScreenProfileNotification'?
:info:build [center removeObserver:self
name:NSWindowDidChangeBackingPropertiesNotification object:window];
:info:build
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:info:build
NSWindowDidChangeScreenProfileNotification
:info:build
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h:786:25:
note: 'NSWindowDidChangeScreenProfileNotification' declared here
:info:build APPKIT_EXTERN NSString
*NSWindowDidChangeScreenProfileNotification ;
:info:build ^
:info:build
/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_libsdl2/libsdl2/work/SDL2-2.0.8/src/video/cocoa/SDL_cocoawindow.m:661:65:
error: use of undeclared identifier 'NSBackingPropertyOldScaleFactorKey'
:info:build NSNumber *oldscale = [[aNotification userInfo]
objectForKey:NSBackingPropertyOldScaleFactorKey];
:info:build
^
:info:build 3 errors generated.
:info:build make: *** [build/SDL_cocoawindow.lo] Error 1
}}}
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:46>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-06 02:49:42 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

I just built it on 10.6.8 without any trouble, and I see the buildbots
have built every version. So, we have a puzzle. I would clean and rebuild,
and submit the full log if it fails. Must be something.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:47>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-06 03:04:27 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Just out of curiosity, you have a real MacOSX10.7.sdk, right? Not just a
symlink to the 10.6 sdk or something similar? I know, stupid question.
Anyway, I'll put up my last build log FYI.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:48>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-06 03:04:53 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by kencu):

* Attachment "libsdl2.0.8-10.6.8-success.log.zip" added.
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-09 01:37:56 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Changes (by Raptor007):

* Attachment "main.log" added.

sudo port install libsdl2 +universal configure.compiler=macports-clang-3.9
--
Ticket URL: <https://trac.macports.org/ticket/52210>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-09 01:46:12 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by Raptor007):

It's not a stupid question; I had to check because it's been a while since
I set that up. It's not a symlink and the contents differ from the 10.6
SDK, so I think it's the real thing. For example:

{{{
$ diff
/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h
| head -4
4c4
< Copyright (c) 1994-2009, Apple Inc.
---
Copyright (c) 1994-2011, Apple Inc.
}}}

I notice in your log that you have Xcode 4.2 where I have 4.0.2, but I'm
not sure if that's relevant since it isn't where the 10.7 SDK comes from,
and we're both using MacPorts Clang 3.9.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:49>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-09 02:46:04 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

My working theory here is that you don't have the most up to date
MacOS10.7.sdk. Perhaps yours is not the 10.7.5 version. Just trying now to
confirm if that is true, but I don't have a better explanation at the
moment.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:51>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-09 03:00:36 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

I think that's it -- your 10.7 SDK is not the last. I have this in my
{{{
/Developer/SDKs/MacOSX10.7.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSWindow.h
}}}
{{{
/* NSWindowDidChangeBackingPropertiesNotification is posted on 10.7.3 and
later, when a window's backingScaleFactor and/or its colorSpace changes.
When runing on a system version where this new notification is available,
applications should use it instead of
NSWindowDidChangeScreenProfileNotification to watch for changes to either
of these backing store properties. Many applications won't have any need
to watch for this notification, but those that perform sophisticated color
handling or manually manage their own caches of window-resolution-and/or
/colorspace-appropriate bitmapped images will find this notification
useful, as a prompt to invalidate their caches or schedule other
reassessment for the new resolution and/or color space as needed. The
notification's userInfo dictionary specifies the window's previous
backingScaleFactor and colorSpace. You can compare these with the
window's new backingScaleFactor and colorSpace at the time of the
notification, to determine which of these two properties (potentially
both) changed.
*/
APPKIT_EXTERN NSString * const
NSWindowDidChangeBackingPropertiesNotification NS_AVAILABLE_MAC(10_7); //
added in 10.7.3; userInfo keys: NSBackingPropertyOldScaleFactorKey,
NSBackingPropertyOldColorSpaceKey

APPKIT_EXTERN NSString * const NSBackingPropertyOldScaleFactorKey
NS_AVAILABLE_MAC(10_7); // added in 10.7.3; an NSNumber
APPKIT_EXTERN NSString * const NSBackingPropertyOldColorSpaceKey
NS_AVAILABLE_MAC(10_7); // added in 10.7.3; an NSColorSpace
}}}
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:52>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-09 22:48:12 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by Raptor007):

I think you're right. My copy of NSWindow.h doesn't have those lines.
Perhaps the warning should be more specific about requiring SDK version
10.7.3 or later.

Where would you get a proper 10.7.5 SDK today? One of my many gripes
about the App Store is that as new versions are released old ones are no
longer available, and one of my many gripes about Xcode is that it's only
released through limited channels such as the App Store.

I tried these sources, but neither has the new definitions in NSWindow.h
required by libsdl2:
https://github.com/phracker/MacOSX-SDKs
https://github.com/AaronWallace/MacOSX_SDKs

I could get a little farther in the build process by adding those lines
from your comment to my NSWindow.h, but unsurprisingly it failed to find
those symbols when linking.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:53>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-11 02:48:35 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by Raptor007):

I found it! You need an Apple account, but you do NOT paid App Store
developer credentials:

https://developer.apple.com/download/more/

Download "Xcode 4.3.3 for Lion", then right-click that Xcode.app and Show
Package Contents, then browse to
Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs and you'll
find a copy of MacOSX10.7.sdk that's new enough to build libsdl2.

Thanks for pointing me in the right direction Ken.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:54>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-10-11 06:41:51 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by kencu):

Excellent! Thanks for the link and the info.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:55>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-22 19:24:41 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by mrkapqa):

Hello , i have done today

"sudo port upgrade outdated"

and run into error


sudo port upgrade outdated
---> Computing dependencies for libsdl2
---> Fetching distfiles for libsdl2
Error: Failed to fetch libsdl2: Building libsdl2 @2.0.9 on Mac OS X 10.6
requires the MacOSX10.7.sdk to be present in /Developer/SDKs/
Error: See
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_libsdl2/libsdl2/main.log
for details.
Error: Problem while installing libsdl2



Am i right in assuming that this error can be overcome by downloading the
above SDK for Lion 10.7.5?
I am running latest MacPorts on Snow Leopard 10.6.8

Thank you
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:56>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-22 19:48:17 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------
Post by MacPorts
Am i right in assuming that this error can be overcome by downloading
the above SDK for Lion 10.7.5?
Post by MacPorts
I am running latest MacPorts on Snow Leopard 10.6.8
Yes. See [ticket:52210#comment:54] above for the link.
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:57>
MacPorts <https://www.macports.org/>
Ports system for macOS
MacPorts
2018-11-22 20:01:46 UTC
Permalink
#52210: libsdl2: make it build on 10.6 (against 10.6 SDK)
-------------------------------------+-------------------------
Reporter: kenneth.f.cunningham@
 | Owner: jmroot
Type: defect | Status: new
Priority: Low | Milestone:
Component: ports | Version:
Resolution: | Keywords: snowleopard
Port: libsdl2 |
-------------------------------------+-------------------------

Comment (by mrkapqa):

Thanks, copied this folder MacOSX10.7.sdk over into the Directory
/Developer/SDKs/, now it is continuing
--
Ticket URL: <https://trac.macports.org/ticket/52210#comment:58>
MacPorts <https://www.macports.org/>
Ports system for macOS
Loading...