Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#56994 closed defect (fixed)

vim-8.1.0280 does not build under OS X 10.5.8

Reported by: josephsacco Owned by: raimue (Rainer Müller)
Priority: Normal Milestone:
Component: ports Version: 2.5.3
Keywords: leopard legacy-os Cc: udbraumann
Port: vim

Description

The problem is with a macro used in ./src/os_macosx.m

#ifdef AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER
    NSArray *supportedTypes = [NSArray arrayWithObjects:VimPboardType,
            NSPasteboardTypeString, nil];
#else
    NSArray *supportedTypes = [NSArray arrayWithObjects:VimPboardType,
            NSStringPboardType, nil];
#endif

NSPasteboardTypeString exists for OSX10.6+. However, testing if the macro is defined is not sufficient. Under OSX 10.5.8 [Xcode 3.1.4] the macro is defined:

#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE

A better test for OS X version is required.

For expediency, I renamed the macro to something rude, and continued with the build / install, which completed without further incident.

-Joseph

Change History (12)

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Cc: raimue removed
Owner: set to raimue
Status: newassigned

comment:2 Changed 6 years ago by raimue (Rainer Müller)

Keywords: legacy-os added

Mac OS X 10.5 Leopard is a legacy system. I will not investigate this or actively work on a solution, but I would apply a patch or review a pull request if you can provide that. Alternatively, please submit such a patch upstream as it is not seem to be specific to the version distributed in MacPorts.

comment:3 Changed 6 years ago by udbraumann

Cc: udbraumann added

comment:4 in reply to:  description Changed 6 years ago by udbraumann

Replying to josephsacco:

... Under OSX 10.5.8 [Xcode 3.1.4] the macro is defined:

#define AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER WEAK_IMPORT_ATTRIBUTE

In which file of Xcode 3.1.4 did you find this line? I wonder if this line is being read by mistake, I mean, we are on 10.5, but the compiler is being informed we were on 10.6.

comment:5 Changed 6 years ago by josephsacco

ObjC tends to load every framework under the sun when AppKit is referenced. The header file where the macro is defined is

/System/Library/Frameworks/CoreVideo.famework/Headers/CVBase.h

whose contents matches those of the file of the same name found in the developer SDK for OSX 10.5.

Programming ancient Macs is akin to riding a dead horse. The prudent thing to do when you discover you are riding a dead horse is to dismount. Still, "we" persist.

-Joseph

comment:6 Changed 6 years ago by kencu (Ken)

The non-Apple GUI versions of vim do build (gtk2, gtk3, maybe others). Perhaps we can find something useful in there that is satisfying.

It may be possible to rescue the macOS SDK build for a version or two with patches to the newer SDK calls as others have suggested, and I've had fine luck with that in some cases. I'll take a look and see what I can come up with.

comment:7 Changed 6 years ago by kencu (Ken)

It was pretty simple, in the end. The correct macro would be

#if __MAC_OS_X_VERSION_MAX_ALLOWED > 1060

instead of the one they used. I'll make up a patch, and then see if it can be upstreamed.

comment:8 Changed 6 years ago by josephsacco

Thanks, Ken. Knowledge is power. You knew how to create the "better" test for OS X version and did so... :-)

Onwards,

-Joseph

comment:9 in reply to:  7 Changed 6 years ago by udbraumann

Replying to kencu:

It was pretty simple, in the end. The correct macro would be

#if __MAC_OS_X_VERSION_MAX_ALLOWED > 1060

instead of the one they used. I'll make up a patch, and then see if it can be upstreamed.

Thanks! I think the required relation symbol should be greater equal instead of greater, if comparing with 1060.

comment:10 Changed 6 years ago by kencu (Ken)

yes, right. thanks for the correction.

comment:11 Changed 6 years ago by kencu (Ken)

Resolution: fixed
Status: assignedclosed

In 12828a47e14958dc504061e5c4b40bc993ceb7aa/macports-ports (master):

vim: fix test for SDK newer than 10.6

closes: #56994

comment:12 Changed 6 years ago by udbraumann

You are great, Ken, thanks a lot! To be precise, your patch fixes the test for some SDK newer than 10.5.

Note: See TracTickets for help on using tickets.