git: afbd51f05283 - main - graphics/libjxl: unbreak pkg-config support

From: Jan Beich <jbeich_at_FreeBSD.org>
Date: Sat, 08 Jan 2022 18:13:44 UTC
The branch main has been updated by jbeich:

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

commit afbd51f052833f7a152390a6a7b80af14e14fe53
Author:     Jan Beich <jbeich@FreeBSD.org>
AuthorDate: 2022-01-08 17:57:59 +0000
Commit:     Jan Beich <jbeich@FreeBSD.org>
CommitDate: 2022-01-08 18:13:31 +0000

    graphics/libjxl: unbreak pkg-config support
    
    Convert static libhwy from package to LDFLAGS, so pkgconf doesn't try
    to expand missing package in Requires.private outside of --static.
    
    $ pkg-config --cflags libjxl
    Package libhwy was not found in the pkg-config search path.
    Perhaps you should add the directory containing `libhwy.pc'
    to the PKG_CONFIG_PATH environment variable
    Package 'libhwy', required by 'libjxl', not found
    
    PR:             261003
    Reported by:    Greg V
---
 graphics/libjxl/Makefile                 |  1 +
 graphics/libjxl/files/patch-private-libs | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/graphics/libjxl/Makefile b/graphics/libjxl/Makefile
index 7c2405e2faaf..2bc9513c9222 100644
--- a/graphics/libjxl/Makefile
+++ b/graphics/libjxl/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	libjxl
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.6.1
+PORTREVISION=	1
 CATEGORIES=	graphics
 
 PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
diff --git a/graphics/libjxl/files/patch-private-libs b/graphics/libjxl/files/patch-private-libs
index 4da786d74277..b1b13b911f85 100644
--- a/graphics/libjxl/files/patch-private-libs
+++ b/graphics/libjxl/files/patch-private-libs
@@ -1,6 +1,26 @@
 highway is untagged and have no other consumers. Keep it private to
 libjxl package for now.
 
+--- lib/jxl.cmake.orig	2021-10-04 18:02:44 UTC
++++ lib/jxl.cmake
+@@ -557,7 +557,7 @@ endif()  # TARGET_SUPPORTS_SHARED_LIBS AND NOT JPEGXL_
+ 
+ # Add a pkg-config file for libjxl.
+ set(JPEGXL_LIBRARY_REQUIRES
+-    "libhwy libbrotlicommon libbrotlienc libbrotlidec")
++    "libbrotlicommon libbrotlienc libbrotlidec")
+ if(NOT JPEGXL_ENABLE_SKCMS)
+   set(JPEGXL_LIBRARY_REQUIRES "${JPEGXL_LIBRARY_REQUIRES} lcms2")
+ endif()
+--- lib/jxl/libjxl.pc.in.orig	2021-10-04 18:02:44 UTC
++++ lib/jxl/libjxl.pc.in
+@@ -8,5 +8,5 @@ Description: Loads and saves JPEG XL files
+ Version: @JPEGXL_LIBRARY_VERSION@
+ Requires.private: @JPEGXL_LIBRARY_REQUIRES@
+ Libs: -L${libdir} -ljxl
+-Libs.private: -lm
++Libs.private: -lhwy -lm
+ Cflags: -I${includedir}
 --- third_party/CMakeLists.txt.orig	2020-11-14 00:52:03 UTC
 +++ third_party/CMakeLists.txt
 @@ -83,7 +83,7 @@ endif()  # BUILD_TESTING