Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libjxl] Fix Pkgconfig files are totally broken on x64-windows-static triplet #33422

Closed
wants to merge 16 commits into from
Closed
66 changes: 66 additions & 0 deletions ports/libjxl/fix_static_suffix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
diff --git a/lib/jxl.cmake b/lib/jxl.cmake
index a42b6f0..77e850b 100644
--- a/lib/jxl.cmake
+++ b/lib/jxl.cmake
@@ -627,6 +627,7 @@ foreach(target IN ITEMS jxl jxl_dec)
endif()
endforeach()

+set(JXL_STATIC_SUFFIX "")
# Only install libjxl shared library. The libjxl_dec is not installed since it
# contains symbols also in libjxl which would conflict if programs try to use
# both.
@@ -637,6 +638,7 @@ install(TARGETS jxl
else()
add_library(jxl ALIAS jxl-static)
add_library(jxl_dec ALIAS jxl_dec-static)
+set(JXL_STATIC_SUFFIX "-static")
endif() # BUILD_SHARED_LIBS

# Add a pkg-config file for libjxl.
diff --git a/lib/jxl/libjxl.pc.in b/lib/jxl/libjxl.pc.in
index 4a7af65..2d8d433 100644
--- a/lib/jxl/libjxl.pc.in
+++ b/lib/jxl/libjxl.pc.in
@@ -7,7 +7,7 @@ Name: libjxl
Description: Loads and saves JPEG XL files
Version: @JPEGXL_LIBRARY_VERSION@
Requires.private: @JPEGXL_LIBRARY_REQUIRES@
-Libs: -L${libdir} -ljxl
+Libs: -L${libdir} -ljxl@JXL_STATIC_SUFFIX@
Libs.private: -lm
Cflags: -I${includedir}
Cflags.private: -DJXL_STATIC_DEFINE
diff --git a/lib/jxl_threads.cmake b/lib/jxl_threads.cmake
index b8ce66b..1634280 100644
--- a/lib/jxl_threads.cmake
+++ b/lib/jxl_threads.cmake
@@ -100,6 +100,7 @@ target_compile_definitions(jxl_threads
generate_export_header(jxl_threads
BASE_NAME JXL_THREADS
EXPORT_FILE_NAME include/jxl/jxl_threads_export.h)
+set(THREAD_STATIC_SUFFIX "")
else()
add_library(jxl_threads ALIAS jxl_threads-static)
# When not building the shared library generate the jxl_threads_export.h header
@@ -107,6 +108,7 @@ add_library(jxl_threads ALIAS jxl_threads-static)
generate_export_header(jxl_threads-static
BASE_NAME JXL_THREADS
EXPORT_FILE_NAME include/jxl/jxl_threads_export.h)
+set(THREAD_STATIC_SUFFIX "-static")
endif() # BUILD_SHARED_LIBS


diff --git a/lib/threads/libjxl_threads.pc.in b/lib/threads/libjxl_threads.pc.in
index 50b937a..26cebbc 100644
--- a/lib/threads/libjxl_threads.pc.in
+++ b/lib/threads/libjxl_threads.pc.in
@@ -7,7 +7,7 @@ Name: libjxl_threads
Description: JPEG XL multi-thread runner using std::threads.
Version: @JPEGXL_LIBRARY_VERSION@
Requires.private: @JPEGXL_THREADS_LIBRARY_REQUIRES@
-Libs: -L${libdir} -ljxl_threads
+Libs: -L${libdir} -ljxl_threads@THREAD_STATIC_SUFFIX@
Libs.private: -lm
Cflags: -I${includedir}
Cflags.private: -DJXL_THREADS_STATIC_DEFINE
1 change: 1 addition & 0 deletions ports/libjxl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ vcpkg_from_github(
PATCHES
fix-dependencies.patch
trim-shared-build.patch
fix_static_suffix.patch #https://github.com/libjxl/libjxl/pull/2754
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
1 change: 1 addition & 0 deletions ports/libjxl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libjxl",
"version-semver": "0.8.2",
"port-version": 1,
"description": "JPEG XL image format reference implementation",
"homepage": "https://github.com/libjxl/libjxl",
"license": "BSD-3-Clause",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4258,7 +4258,7 @@
},
"libjxl": {
"baseline": "0.8.2",
"port-version": 0
"port-version": 1
},
"libkeyfinder": {
"baseline": "2.2.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libjxl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e99c7d6510e1417508c01729a93f001a87dce06e",
"version-semver": "0.8.2",
"port-version": 1
},
{
"git-tree": "f97d35060ccfc751fc3729988cef203437c5a0dc",
"version-semver": "0.8.2",
Expand Down