Bug 233888

Summary: graphics/opencolorio: fix build with GCC-based architectures
Product: Ports & Packages Reporter: Piotr Kubaj <pkubaj>
Component: Individual Port(s)Assignee: Piotr Kubaj <pkubaj>
Status: Closed FIXED    
Severity: Affects Only Me CC: FreeBSD, linimon
Priority: --- Flags: FreeBSD: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
See Also: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=233671
Attachments:
Description Flags
patch
none
v2
none
maintainer update for graphics/opencolorio FreeBSD: maintainer-approval+

Description Piotr Kubaj freebsd_committer 2018-12-09 13:44:01 UTC
Created attachment 199980 [details]
patch

GCC needs -Wno-unused-function in CXXFLAGS to build this port.

While here, add USES=localbase:ldflags.

Tested on powerpc64 and amd64.

Hardware sponsored by IntegriCloud.
Comment 1 Piotr Kubaj freebsd_committer 2018-12-09 18:32:31 UTC
@linimon
After update to 1.1.0, USES alone is not enough.
Comment 2 Shane 2018-12-10 04:37:29 UTC
I don't see an issue, though maybe a cleaner approach can be used, there is momentum to use variables rather than conditional tests.

Currently we can use CXXFLAGS_${ARCH}, which might be enough in this situation. Maybe using CXXFLAGS_${CHOSEN_COMPILER_TYPE} is something that could also be added to the infrastructure.

You could manually be arch/compiler specific - based on usage from devel/godot -

CXXFLAGS_powerpc64=	${CXXFLAGS_powerpc64_${CHOSEN_COMPILER_TYPE}}
CXXFLAGS_powerpc64_gcc=	-Wno-unused-function
Comment 3 Piotr Kubaj freebsd_committer 2018-12-14 12:30:26 UTC
Created attachment 200114 [details]
v2

After upgrade to GCC 8, there are additional errors and -Wno-error for GCC builds is necessary.
Comment 4 Shane 2018-12-16 09:19:52 UTC
Created attachment 200144 [details]
maintainer update for graphics/opencolorio

Testing the existence of libstdc++.so installed by the base system isn't foolproof, a user can configure to use GCC for building ports (FAVORITE_COMPILER=gcc). Not sure how popular this is, or reliable, I found the need to manually set CC/CXX to get gcc used on amd64.

Does setting CXXFLAGS this way work on gcc built ARCHs?

I doubt that any of these flags need adjusting based on ARCH or base compiler, it is really about chosen compiler at build time.

If this fails, I think testing chosen compiler in place of the lib test would be better.
Comment 5 commit-hook freebsd_committer 2019-04-30 14:25:10 UTC
A commit references this bug:

Author: pkubaj
Date: Tue Apr 30 14:24:33 UTC 2019
New revision: 500495
URL: https://svnweb.freebsd.org/changeset/ports/500495

Log:
  graphics/opencolorio: fix build with GCC-based architectures

  Add -Wno-unused-function -Wno-error to CXXFLAGS when using GCC.

  While here, add USES=localbase:ldflags.

  PR:		233888
  Approved by:	FreeBSD@ShaneWare.Biz (maintainer), mat (mentor)
  Differential Revision:	https://reviews.freebsd.org/D20089

Changes:
  head/graphics/opencolorio/Makefile