Skip to content

Commit f14401c

Browse files
authored
[ecm] Force vcpkg filesystem, revise downstream (microsoft#34091)
1 parent 73aa144 commit f14401c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+460
-292
lines changed

ports/ecm/kde-clang-format.diff

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff --git a/kde-modules/KDEClangFormat.cmake b/kde-modules/KDEClangFormat.cmake
2+
index e278a63..3949bd2 100644
3+
--- a/kde-modules/KDEClangFormat.cmake
4+
+++ b/kde-modules/KDEClangFormat.cmake
5+
@@ -53,7 +53,7 @@ Since 5.64
6+
find_program(KDE_CLANG_FORMAT_EXECUTABLE clang-format)
7+
8+
# instantiate our clang-format file, must be in source directory for tooling if we have the tool
9+
-if(KDE_CLANG_FORMAT_EXECUTABLE)
10+
+if(KDE_CLANG_FORMAT_EXECUTABLE AND NOT "$ENV{VCPKG_DISABLE_KDE_CLANG_FORMAT}")
11+
set(CLANG_FORMAT_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format)
12+
if (EXISTS ${CLANG_FORMAT_FILE})
13+
file(READ ${CLANG_FORMAT_FILE} CLANG_FORMAT_CONTENTS LIMIT 1000)
14+
@@ -77,6 +77,9 @@ function(KDE_CLANG_FORMAT)
15+
16+
# add target without specific commands first, we add the real calls file-per-file to avoid command line length issues and enable parallelization
17+
add_custom_target(clang-format COMMENT "Formatting sources in ${CMAKE_CURRENT_SOURCE_DIR} with ${KDE_CLANG_FORMAT_EXECUTABLE}...")
18+
+ if("$ENV{VCPKG_DISABLE_KDE_CLANG_FORMAT}")
19+
+ return()
20+
+ endif()
21+
22+
# run clang-format only if available, else signal the user what is missing
23+
if(KDE_CLANG_FORMAT_EXECUTABLE)

ports/ecm/portfile.cmake

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# cmake-scripts only
2+
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
3+
set(VCPKG_BUILD_TYPE release)
4+
15
vcpkg_from_github(
26
OUT_SOURCE_PATH SOURCE_PATH
37
REPO KDE/extra-cmake-modules
@@ -7,6 +11,12 @@ vcpkg_from_github(
711
PATCHES
812
fix_generateqmltypes.patch # https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/201
913
fix-wrong-version.patch
14+
# Adjust default installation dirs to vcpkg layout, reduce cross-platform variation
15+
uniform-dataroot-dir.patch
16+
uniform-libexec-dir.patch
17+
uniform-plugin-dir.patch
18+
# Avoid race while configuring downstream ports
19+
kde-clang-format.diff
1020
)
1121

1222
vcpkg_cmake_configure(
@@ -19,15 +29,8 @@ vcpkg_cmake_configure(
1929
)
2030

2131
vcpkg_cmake_install()
22-
2332
vcpkg_cmake_config_fixup(CONFIG_PATH share/ECM/cmake)
2433

25-
# Remove debug files
26-
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
27-
34+
file(COPY "${CURRENT_PORT_DIR}/vcpkg-port-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
2835
file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
29-
# Handle copyright
3036
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS")
31-
32-
# Allow empty include directory
33-
set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/kde-modules/KDEInstallDirsCommon.cmake b/kde-modules/KDEInstallDirsCommon.cmake
2+
index aae70d6..623cee7 100644
3+
--- a/kde-modules/KDEInstallDirsCommon.cmake
4+
+++ b/kde-modules/KDEInstallDirsCommon.cmake
5+
@@ -265,7 +265,7 @@ _define_absolute(LOCALSTATEDIR "var"
6+
_define_absolute(SHAREDSTATEDIR "com"
7+
"modifiable architecture-independent data")
8+
9+
-if (WIN32)
10+
+if (0)
11+
_define_relative(DATAROOTDIR BINDIR "data"
12+
"read-only architecture-independent data root"
13+
SHARE_INSTALL_PREFIX)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
diff --git a/kde-modules/KDEInstallDirs5.cmake b/kde-modules/KDEInstallDirs5.cmake
2+
index 5f67759..24308ad 100644
3+
--- a/kde-modules/KDEInstallDirs5.cmake
4+
+++ b/kde-modules/KDEInstallDirs5.cmake
5+
@@ -222,7 +222,7 @@ for the prefix into a process.
6+
7+
include(${CMAKE_CURRENT_LIST_DIR}/KDEInstallDirsCommon.cmake)
8+
9+
-if(WIN32)
10+
+if(1)
11+
_define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}")
12+
else()
13+
_define_non_cache(LIBEXECDIR_KF5 "${CMAKE_INSTALL_LIBEXECDIR}/kf5")
14+
diff --git a/kde-modules/KDEInstallDirs6.cmake b/kde-modules/KDEInstallDirs6.cmake
15+
index 469997b..87c5cd4 100644
16+
--- a/kde-modules/KDEInstallDirs6.cmake
17+
+++ b/kde-modules/KDEInstallDirs6.cmake
18+
@@ -191,7 +191,7 @@ set(KDE_INSTALL_DIRS_NO_DEPRECATED TRUE)
19+
20+
include(${CMAKE_CURRENT_LIST_DIR}/KDEInstallDirsCommon.cmake)
21+
22+
-if(WIN32)
23+
+if(1)
24+
_define_non_cache(LIBEXECDIR_KF "${CMAKE_INSTALL_LIBEXECDIR}")
25+
else()
26+
_define_non_cache(LIBEXECDIR_KF "${CMAKE_INSTALL_LIBEXECDIR}/kf6")
27+
diff --git a/kde-modules/KDEInstallDirsCommon.cmake b/kde-modules/KDEInstallDirsCommon.cmake
28+
index aae70d6..6b39058 100644
29+
--- a/kde-modules/KDEInstallDirsCommon.cmake
30+
+++ b/kde-modules/KDEInstallDirsCommon.cmake
31+
@@ -241,7 +241,7 @@ _define_relative(LIBDIR EXECROOTDIR "${_LIBDIR_DEFAULT}"
32+
"object code libraries"
33+
LIB_INSTALL_DIR)
34+
35+
-if(WIN32)
36+
+if(1)
37+
_define_relative(LIBEXECDIR BINDIR ""
38+
"executables for internal use by programs and libraries"
39+
LIBEXEC_INSTALL_DIR)

ports/ecm/uniform-plugin-dir.patch

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/kde-modules/KDEInstallDirs5.cmake b/kde-modules/KDEInstallDirs5.cmake
2+
index 24308ad..c975b3c 100644
3+
--- a/kde-modules/KDEInstallDirs5.cmake
4+
+++ b/kde-modules/KDEInstallDirs5.cmake
5+
@@ -273,7 +273,7 @@ if(KDE_INSTALL_USE_QT_SYS_PATHS)
6+
"QtQuick2 imports"
7+
QML_INSTALL_DIR)
8+
else()
9+
- set(_pluginsDirParent LIBDIR)
10+
+ set(_pluginsDirParent "")
11+
if (ANDROID)
12+
set(_pluginsDirParent)
13+
#androiddeployqt wants plugins right in the prefix
14+
@@ -286,7 +286,7 @@ else()
15+
"QtQuick1 imports"
16+
IMPORTS_INSTALL_DIR)
17+
18+
- _define_relative(QMLDIR LIBDIR "qml"
19+
+ _define_relative(QMLDIR "" "qml"
20+
"QtQuick2 imports"
21+
QML_INSTALL_DIR)
22+
endif()

ports/ecm/usage

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
ecm provides CMake files:
22

3-
find_package(ECM CONFIG REQUIRED NO_MODULE)
4-
list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH})
3+
# Selecting particular find modules
4+
find_package(ECM CONFIG REQUIRED)
5+
ecm_use_find_modules(
6+
DIR "${CMAKE_BINARY_DIR}/cmake"
7+
MODULES FindEGL.cmake
8+
NO_OVERRIDE
9+
)
10+
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/cmake")
11+
12+
# Everything, via find_package() and include()
13+
find_package(ECM CONFIG REQUIRED)
14+
list(PREPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
515
include(KDEInstallDirs)
616
include(KDECompilerSettings)
717
include(KDECMakeSettings)
8-
9-
For more infomation, see https://api.kde.org/ecm/

ports/ecm/vcpkg-port-config.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# share/ECM/kde-modules/KDEClangFormat.cmake might write to the
2+
# source dir, breaking parallel configuration for release/debug.
3+
# This variables disables the undesired behaviour.
4+
set(ENV{VCPKG_DISABLE_KDE_CLANG_FORMAT} 1)

ports/ecm/vcpkg.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
{
22
"name": "ecm",
33
"version": "6.7.0",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "Extra CMake Modules (ECM), extra modules and scripts for CMake",
6-
"homepage": "https://github.com/KDE/extra-cmake-modules",
6+
"homepage": "https://invent.kde.org/frameworks/extra-cmake-modules",
7+
"documentation": "https://api.kde.org/ecm/",
78
"dependencies": [
89
{
910
"name": "vcpkg-cmake",

ports/kf5archive/control-dependencies.patch

Lines changed: 0 additions & 56 deletions
This file was deleted.

ports/kf5archive/portfile.cmake

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,19 @@ vcpkg_from_github(
55
SHA512 2423f6f99a610cf376f14f95fe8af9f9b66a7ce95d082773442cb27046a0bde9d0b80cb5e9798bb44147e27b6749b834034321b13f109482daef60634ee97a69
66
HEAD_REF master
77
PATCHES
8-
control-dependencies.patch
8+
zstd.diff
99
)
1010

1111
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
1212
FEATURES
13-
"bzip2" VCPKG_USE_BZIP2
14-
"lzma" VCPKG_USE_LIBLZMA
15-
"zstd" VCPKG_USE_ZSTD
13+
bzip2 VCPKG_LOCK_FIND_PACKAGE_BZip2
14+
lzma VCPKG_LOCK_FIND_PACKAGE_LibLZMA
15+
zstd VCPKG_LOCK_FIND_PACKAGE_LibZstd
1616
)
1717

18-
# Prevent KDEClangFormat from writing to source effectively blocking parallel configure
19-
file(WRITE "${SOURCE_PATH}/.clang-format" "DisableFormat: true\nSortIncludes: false\n")
20-
2118
vcpkg_cmake_configure(
2219
SOURCE_PATH "${SOURCE_PATH}"
2320
OPTIONS
24-
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON
2521
-DBUILD_TESTING=OFF
2622
${FEATURE_OPTIONS}
2723
)
@@ -30,10 +26,6 @@ vcpkg_cmake_install()
3026
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/KF5Archive)
3127
vcpkg_copy_pdbs()
3228

33-
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
34-
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
35-
endif()
36-
3729
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
3830
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
3931

0 commit comments

Comments
 (0)