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

[ECM] fix FindCanberra for static builds #20213

Merged
merged 4 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions ports/ecm/do-not-override-custom-clang-format-files.patch

This file was deleted.

39 changes: 39 additions & 0 deletions ports/ecm/fix_canberra.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
From 203c65c562453385e3ffc4485844b15e80b93107 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dawid=20Wro=CC=81bel?= <me@dawidwrobel.com>
Date: Fri, 17 Sep 2021 00:07:08 +0200
Subject: [PATCH] FindCanberra: link against target provided by pkgconfig

target_link_libraries() against the target generated by
pkg_check_modules() so that the additional linker options are not
lost, such as the additional libraries to link against when
building statically.

BUG: 442555
---
find-modules/FindCanberra.cmake | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/find-modules/FindCanberra.cmake b/find-modules/FindCanberra.cmake
index c54adf99..f9561118 100644
--- a/find-modules/FindCanberra.cmake
+++ b/find-modules/FindCanberra.cmake
@@ -34,7 +34,7 @@ Since 5.56.0.
#]=======================================================================]

find_package(PkgConfig QUIET)
-pkg_check_modules(PC_Canberra libcanberra QUIET)
+pkg_check_modules(PC_Canberra REQUIRED IMPORTED_TARGET libcanberra QUIET)

find_library(Canberra_LIBRARIES
NAMES canberra
@@ -66,6 +66,7 @@ if(Canberra_FOUND AND NOT TARGET Canberra::Canberra)
INTERFACE_COMPILE_OPTIONS "${PC_Canberra_CFLAGS}"
INTERFACE_INCLUDE_DIRECTORIES "${Canberra_INCLUDE_DIRS}"
)
+ target_link_libraries(Canberra::Canberra INTERFACE PkgConfig::PC_Canberra)
endif()

mark_as_advanced(Canberra_LIBRARIES Canberra_INCLUDE_DIRS Canberra_VERSION)
--
GitLab

15 changes: 8 additions & 7 deletions ports/ecm/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,27 @@ vcpkg_from_github(
REF v5.84.0
SHA512 d49397bcf0d49a95c86c9d9a4e653015ee8b3ef1261b2842439bba7ff3363ac06351fa2df4035c2cb36397d2fc64375a14966ada29f231df51ba26d8e196d6ef
HEAD_REF master
PATCHES
fix_canberra.patch
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_HTML_DOCS=OFF
-DBUILD_MAN_DOCS=OFF
-DBUILD_QTHELP_DOCS=OFF
-DBUILD_TESTING=OFF
)

vcpkg_install_cmake()
vcpkg_cmake_install()

# Remove debug files
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

file(COPY ${CURRENT_PORT_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
# Handle copyright
file(INSTALL ${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

# Allow empty include directory
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
13 changes: 12 additions & 1 deletion ports/ecm/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
{
"name": "ecm",
"version": "5.84.0",
"port-version": 1,
"description": "Extra CMake Modules (ECM), extra modules and scripts for CMake",
"homepage": "https://github.com/KDE/extra-cmake-modules"
"homepage": "https://github.com/KDE/extra-cmake-modules",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@
},
"ecm": {
"baseline": "5.84.0",
"port-version": 0
"port-version": 1
},
"ecos": {
"baseline": "2.0.8",
Expand Down
5 changes: 5 additions & 0 deletions versions/e-/ecm.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5832b19b778f60eb0fb24654e0c8b665f0f8fb20",
"version": "5.84.0",
"port-version": 1
},
{
"git-tree": "9cd1bc0ab97889acb8839e22ec43d13bc7c97ed0",
"version": "5.84.0",
Expand Down