Opened 5 years ago

Closed 5 years ago

#57908 closed defect (fixed)

harfbuzz @2.3.0: hb-coretext.cc:254: error: ‘kCTFontURLAttribute’ was not declared in this scope

Reported by: kencu (Ken) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: tiger leopard Cc:
Port: harfbuzz

Description

Building on Leopard i386:

hb-coretext.cc: In function ‘const __CTFont* create_ct_font(CGFont*, CGFloat)’:
hb-coretext.cc:254: error: ‘kCTFontURLAttribute’ was not declared in this scope

The block is beautifully guarded in the source:

#if TARGET_OS_OSX && MAC_OS_X_VERSION_MIN_REQUIRED < 1060
      atsFont = CTFontGetPlatformFont (new_ct_font, NULL);
      status = ATSFontGetFileReference (atsFont, &fsref);
      if (status == noErr)
        new_url = CFURLCreateFromFSRef (NULL, &fsref);
#else
      new_url = (CFURLRef) CTFontCopyAttribute (new_ct_font, kCTFontURLAttribute);
#endif

but I can't find anywhere that TARGET_OS_OSX is ever set or referred to elsewhere.

Cutting that out of the source, or setting -DTARGET_OS_OSX in the cppflags of Portfile both work to fix the build.

$ port -v installed harfbuzz
The following ports are currently installed:
  harfbuzz @2.3.0_0 (active) platform='darwin 9' archs='i386' date='2019-01-14T20:42:32-0800'

Change History (6)

comment:1 Changed 5 years ago by kencu (Ken)

If you decide to cut it out of the source file, there are two spots where that macro is used.

comment:2 Changed 5 years ago by kencu (Ken)

And the issue appears to be because harfbuzz switched from TARGET_OS_MAC to TARGET_OS_OSX due to collisions with IOS, and TARGET_OS_OSX is not defined on Leopard in:

/usr/include/TargetConditionals.h

comment:3 in reply to:  description Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Status: assignedaccepted

Right. We can work around this but it needs to be reported to the developers of harfbuzz.

comment:4 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

I think the fix that was originally suggested would have worked.

comment:6 Changed 5 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: acceptedclosed

In 49fecd209cde18cd6181b233aeb2bdfe8e32b6ec/macports-ports (master):

harfbuzz: Fix build on Mac OS X 10.5 and earlier

Closes: #57908

Note: See TracTickets for help on using tickets.