Bug 217514

Summary: games/flightgear fails to build looking for ft2build.h
Product: Ports & Packages Reporter: russo
Component: Individual Port(s)Assignee: Ganael LAPLANCHE <martymac>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (martymac)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
This patch replaces bad hard-coded path with the appropriate one for FreeBSD none

Description russo 2017-03-03 06:06:35 UTC
Created attachment 180455 [details]
This patch replaces bad hard-coded path with the appropriate one for FreeBSD

Trying to portupgrade flightgear from 2016.4.4_1 to 2017.1.1 I got a build failure saying it failed to find ft2build.h.

On investigation, I found that one of FlightGear's CMakeLists.txt files has a hard-coded path of "/usr/include/freetype2", so it's looking in the wrong place.

My system:
FreeBSD bogodyn.org 10.3-STABLE FreeBSD 10.3-STABLE #0 r312435: Thu Jan 19 13:55:14 MST 2017     russo@bogodyn.org:/usr/obj/usr/src/sys/GENERIC  amd64

The error:
--- utils/fgpanel/CMakeFiles/fgpanel.dir/FGFontCache.cxx.o ---
In file included from /usr/ports/games/flightgear/work/flightgear-2017.1.1/utils/fgpanel/FGFontCache.cxx:28:
/usr/ports/games/flightgear/work/flightgear-2017.1.1/utils/fgpanel/FGFontCache.hxx:21:10: fatal error: 'ft2build.h' file not found
#include <ft2build.h>
When I edit flightgear-2017.1.1/utils/fgpanel and change the offending path in CMakeLists.txt from /usr/include/freetype2 to /usr/local/include/freetype2, then force a reconfigure and rebuild, it all works.

The attached patch will do that, but seems the wrong approach.  This CMakeLists.txt clearly has a "FindPackage(Freetype)" at the top, and then instead of using the path found there hard-codes the Linux-style location.

This mistake in CMakeLists.txt should ideally be fixed upstream, but at least this patch will make it work for now.
Comment 1 commit-hook freebsd_committer 2017-03-03 21:16:56 UTC
A commit references this bug:

Author: martymac
Date: Fri Mar  3 21:16:41 UTC 2017
New revision: 435367
URL: https://svnweb.freebsd.org/changeset/ports/435367

  - Update Simgear & Flightgear ports to 2017.1.2
  - Fix fgpanel build [1]

  PR:		217514 [1]
  Submitted by:	russo@bogodyn.org [1]

Comment 2 Ganael LAPLANCHE freebsd_committer 2017-03-03 21:19:19 UTC

Thanks a lot for your report.

That update should fix your build problems. Can you confirm everything is OK by now ?
Comment 3 russo 2017-03-03 22:03:05 UTC
Yes, I can now build flightgear with make in /usr/ports/games/flightgear.

I see that the version number is also changed (2017.1.2) but the ports index has not been changed to reflect that, so portupgrade doesn't just update it, but it'll work with a portupgrade -f flightgear.  I had to do the same with flightgear-data.
Comment 4 Ganael LAPLANCHE freebsd_committer 2017-03-04 11:49:23 UTC

The INDEX should be up-to-date now (you can fetch it with a 'make fetchindex' within the ports' root dir).

Thanks again for your feedback.

Best regards,