Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Cross-Platform Development => Topic started by: chief1983 on February 06, 2020, 03:09:17 pm

Title: Freetype on macOS
Post by: chief1983 on February 06, 2020, 03:09:17 pm
Been trying to run more recent mac builds for some time, upgraded to Catalina but none of them have been working.  When trying to run the most recent build in Knossos or just doubleclicking it in the folder, a debug log doesn't even get created.  Running the binary manually in terminal though, I see this:

Code: [Select]
cliff.gordon:~  $ ~/Knossos/bin/FSO-20.1.0-20200206/macosx/fs2_open_20_1_0_20200206_aa0a1ae_x64.app/Contents/MacOS/fs2_open_20_1_0_20200206_aa0a1ae_x64
dyld: Library not loaded: /usr/local/opt/freetype/lib/libfreetype.6.dylib
  Referenced from: /Users/cliff.gordon/Knossos/bin/FSO-20.1.0-20200206/macosx/fs2_open_20_1_0_20200206_aa0a1ae_x64.app/Contents/MacOS/fs2_open_20_1_0_20200206_aa0a1ae_x64
  Reason: image not found
Abort trap: 6

The error goes away when I install freetype with Homebrew, but I feel like there is probably something misconfigured in the cmake setup that is not bringing this library into the app somehow, either by static linking or copying the library into the .app?
Title: Re: Freetype on macOS
Post by: m!m on February 07, 2020, 01:11:17 am
When I did my research into FreeType it said that the runtime libraries would be included in the OS by default. Is this a recent incompatibility?
Title: Re: Freetype on macOS
Post by: chief1983 on February 07, 2020, 06:51:49 am
It is possible that Catalina is the first to remove them, but the location it is looking for them is not the usual directory for things that come with macOS.  But I assume they are present in the build server somehow?
Title: Re: Freetype on macOS
Post by: chief1983 on February 07, 2020, 09:50:16 am
Looks like it was removed not explicitly, but due to the path it was installed being locked down now.  I don't know what was responsible for them being installed before, whether it was there on the OS by default, or just installed by a previous Xcode version, but now when I look across the filesystem for 'freetype', I only find these, besides those bundled with specific apps:

Code: [Select]
/Users/Shared/Relocated Items/Security/usr/X11/bin/freetype-config
/Users/Shared/Relocated Items/Security/usr/X11/lib/libfreetype.6.dylib

Many other libs and such were moved as well.  I don't know if there's a simple process to get these libs back somehow, I have recently installed an Xcode update that doesn't seem to have done anything for me.  Gimp, VLC, PyCharm, and DbVisualizer all seem to bundle the dylib inside the app, wondering if it would be smarter to just do that ourselves now.  Would then also be nice if we included that in the prebuilt libs I think, so devs wouldn't need to install it from Brew either.
Title: Re: Freetype on macOS
Post by: mercuriot on December 25, 2020, 10:37:13 am
 :) Hi! this works for me:

brew install freetype
brew link --overwrite freetype


I have mac os big sur and free space build 19.

Good luck!
Title: Re: Freetype on macOS
Post by: chief1983 on December 25, 2020, 10:53:00 am
:) Hi! this works for me:

brew install freetype
brew link --overwrite freetype


I have mac os big sur and free space build 19.

Good luck!

Yeah, having freetype installed via Homebrew works.  But we would prefer to get it so the app includes it like with other libraries, and doesn't have to be instilled by the user.
Title: Re: Freetype on macOS
Post by: jg18 on December 28, 2020, 03:46:33 pm
chief, I thought this was fixed by PR #2863 (https://github.com/scp-fs2open/fs2open.github.com/pull/2863)? Isn't that change included in 20.1.0-RC1?
Title: Re: Freetype on macOS
Post by: m!m on December 28, 2020, 03:47:50 pm
It should be in the master branch but since we do not have Mac builds at the moment it is not technically in the RC for Mac.