Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Jun 2023 16:17:33 GMT
From:      Dimitry Andric <dim@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 7393af6f4fba - main - graphics/qt5-imageformats: fix build with clang 16
Message-ID:  <202306111617.35BGHXvI056291@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dim:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7393af6f4fbab56776eac34830eb81dd7d391f07

commit 7393af6f4fbab56776eac34830eb81dd7d391f07
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2023-06-08 17:48:04 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2023-06-11 16:15:58 +0000

    graphics/qt5-imageformats: fix build with clang 16
    
    Since clang 16 (and gcc 11) the default C++ standard is now gnu++17.
    Because graphics/qt5-imageformats 's build infrastructure does not
    explicitly set its C++ standard, this leads to an issue detecting libmng
    in the configure stage:
    
      Configure summary:
    
      Further Image Formats:
        JasPer ................................. yes
        MNG .................................... no
        TIFF ................................... yes
          Using system libtiff ................. yes
        WEBP ................................... yes
          Using system libwebp ................. yes
    
    This is because the small configure test program for libmng includes
    libmng.h, which transitively includes lcms.h, and the latter fails due
    to 'register' keywords in the header. With lcms2.h there is a special
    define CMS_NO_REGISTER_KEYWORD to avoid usage of the register keyword,
    but lcms.h is very old and does not support that.
    
    As a workaround, define the register keyword away via a "head" object in
    src/imageformats/configure.json, and via CXXFLAGS for the rest of the
    build.
    
    PR:             271914
    Approved by:    tcberner (maintainer)
    MFH:            2023Q2
---
 graphics/qt5-imageformats/Makefile                           |  4 +++-
 .../files/patch-src_imageformats_configure.json              | 12 +++++++++++-
 2 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/graphics/qt5-imageformats/Makefile b/graphics/qt5-imageformats/Makefile
index 9ed2948a12a9..1b4c57bca0d8 100644
--- a/graphics/qt5-imageformats/Makefile
+++ b/graphics/qt5-imageformats/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	imageformats
 PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	graphics
 PKGNAMEPREFIX=	qt5-
 
@@ -15,4 +15,6 @@ LIB_DEPENDS=	libjasper.so:graphics/jasper \
 USES=		compiler:c++11-lang localbase qmake qt-dist:5,imageformats
 USE_QT=		core gui buildtools:build
 
+CXXFLAGS+=	-Dregister=
+
 .include <bsd.port.mk>
diff --git a/graphics/qt5-imageformats/files/patch-src_imageformats_configure.json b/graphics/qt5-imageformats/files/patch-src_imageformats_configure.json
index d88962cfe129..3617b167d5b4 100644
--- a/graphics/qt5-imageformats/files/patch-src_imageformats_configure.json
+++ b/graphics/qt5-imageformats/files/patch-src_imageformats_configure.json
@@ -1,4 +1,4 @@
---- src/imageformats/configure.json.orig	2022-03-02 19:21:52 UTC
+--- src/imageformats/configure.json.orig	2023-01-03 22:24:44 UTC
 +++ src/imageformats/configure.json
 @@ -19,6 +19,7 @@
              "headers": "jasper/jasper.h",
@@ -8,3 +8,13 @@
                      "string.h",
                      "jasper/jasper.h"
                  ],
+@@ -41,6 +42,9 @@
+         "mng": {
+             "headers": "libmng.h",
+             "test": {
++                "head": [
++                    "#define register"
++                ],
+                 "include": [
+                     "stdio.h",
+                     "libmng.h"



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306111617.35BGHXvI056291>