aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/ecm
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/ecm')
-rw-r--r--vcpkg/ports/ecm/fix-wrong-version.patch12
-rw-r--r--vcpkg/ports/ecm/fix_generateqmltypes.patch31
-rw-r--r--vcpkg/ports/ecm/portfile.cmake33
-rw-r--r--vcpkg/ports/ecm/usage9
-rw-r--r--vcpkg/ports/ecm/vcpkg.json17
5 files changed, 102 insertions, 0 deletions
diff --git a/vcpkg/ports/ecm/fix-wrong-version.patch b/vcpkg/ports/ecm/fix-wrong-version.patch
new file mode 100644
index 0000000..2d558f6
--- /dev/null
+++ b/vcpkg/ports/ecm/fix-wrong-version.patch
@@ -0,0 +1,12 @@
+diff --git a/modules/ECMSetupVersion.cmake b/modules/ECMSetupVersion.cmake
+index 7164c9a0bd..408ef33638 100644
+--- a/modules/ECMSetupVersion.cmake
++++ b/modules/ECMSetupVersion.cmake
+@@ -112,7 +112,6 @@ function(ecm_setup_version _version)
+ set(use_project_version FALSE)
+ cmake_policy(GET CMP0048 project_version_policy)
+ if(project_version_policy STREQUAL "NEW")
+- set(project_manages_version TRUE)
+ if(_version STREQUAL "PROJECT")
+ set(use_project_version TRUE)
+ endif()
diff --git a/vcpkg/ports/ecm/fix_generateqmltypes.patch b/vcpkg/ports/ecm/fix_generateqmltypes.patch
new file mode 100644
index 0000000..5ed5dc5
--- /dev/null
+++ b/vcpkg/ports/ecm/fix_generateqmltypes.patch
@@ -0,0 +1,31 @@
+diff --git a/modules/ECMGenerateQmlTypes.cmake b/modules/ECMGenerateQmlTypes.cmake
+index d6e124266308028b8533203da63f572f6e99b308..7d7cecb5201521019764102eba0da2abf8b4d911 100644
+--- a/modules/ECMGenerateQmlTypes.cmake
++++ b/modules/ECMGenerateQmlTypes.cmake
+@@ -1,4 +1,5 @@
+ # SPDX-FileCopyrightText: 2017 Aleix Pol Gonzalez <aleixpol@kde.org>
++# SPDX-FileCopyrightText: 2021 Dawid Wrobel <me@dawidwrobel.com>
+ #
+ # SPDX-License-Identifier: BSD-3-Clause
+
+@@ -18,10 +19,7 @@ our project offers. These files offer introspection upon our plugin and are
+ useful for integrating with IDE language support of our plugin. It offers
+ information about the objects its methods and their argument types.
+
+-The developer will be in charge of making sure that these files are up to date.
+-The plugin.qmltypes file will sit in the source directory. This function will
+-include the code that installs the file in the right place and a small unit
+-test named qmltypes-pluginname-version that makes sure that it doesn't need updating.
++This function installs the file in DESTINATION folder.
+
+
+ Since 5.33.0
+@@ -40,7 +38,7 @@ function(ecm_generate_qmltypes)
+ set(targetname "qmltypes-${ARG_UNPARSED_ARGUMENTS}")
+ string(REPLACE ";" - targetname "${targetname}")
+
+- set(generatedFile ${CMAKE_CURRENT_SOURCE_DIR}/plugins.qmltypes)
++ set(generatedFile plugins.qmltypes)
+ add_custom_target(${targetname}
+ BYPRODUCTS ${generatedFile}
+ COMMAND qmlplugindump -nonrelocatable ${ARG_UNPARSED_ARGUMENTS} ${KDE_INSTALL_QMLDIR} > ${generatedFile}
diff --git a/vcpkg/ports/ecm/portfile.cmake b/vcpkg/ports/ecm/portfile.cmake
new file mode 100644
index 0000000..2a82cf0
--- /dev/null
+++ b/vcpkg/ports/ecm/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO KDE/extra-cmake-modules
+ REF "v${VERSION}"
+ SHA512 d62091185c26c4eec83f7b2e06468c3c3691ae0e71f4d60aafaf32be262677affc686a4e54159f487005854bdf46c4c3a2214775daf850039b733ad02edc3936
+ HEAD_REF master
+ PATCHES
+ fix_generateqmltypes.patch # https://invent.kde.org/frameworks/extra-cmake-modules/-/merge_requests/201
+ fix-wrong-version.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DBUILD_HTML_DOCS=OFF
+ -DBUILD_MAN_DOCS=OFF
+ -DBUILD_QTHELP_DOCS=OFF
+ -DBUILD_TESTING=OFF
+)
+
+vcpkg_cmake_install()
+
+vcpkg_cmake_config_fixup(CONFIG_PATH share/ECM/cmake)
+
+# Remove debug files
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")
+
+file(COPY "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+# Handle copyright
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING-CMAKE-SCRIPTS")
+
+# Allow empty include directory
+set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
diff --git a/vcpkg/ports/ecm/usage b/vcpkg/ports/ecm/usage
new file mode 100644
index 0000000..4969750
--- /dev/null
+++ b/vcpkg/ports/ecm/usage
@@ -0,0 +1,9 @@
+ecm provides CMake files:
+
+ find_package(ECM CONFIG REQUIRED NO_MODULE)
+ list(INSERT CMAKE_MODULE_PATH 0 ${ECM_MODULE_PATH})
+ include(KDEInstallDirs)
+ include(KDECompilerSettings)
+ include(KDECMakeSettings)
+
+For more infomation, see https://api.kde.org/ecm/
diff --git a/vcpkg/ports/ecm/vcpkg.json b/vcpkg/ports/ecm/vcpkg.json
new file mode 100644
index 0000000..8f18c48
--- /dev/null
+++ b/vcpkg/ports/ecm/vcpkg.json
@@ -0,0 +1,17 @@
+{
+ "name": "ecm",
+ "version": "6.7.0",
+ "port-version": 1,
+ "description": "Extra CMake Modules (ECM), extra modules and scripts for CMake",
+ "homepage": "https://github.com/KDE/extra-cmake-modules",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}