aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/simonbrunel-qtpromise
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/simonbrunel-qtpromise
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/simonbrunel-qtpromise')
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/patches/install_headers.patch17
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch21
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/portfile.cmake25
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/unofficial-config.cmake.in19
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/usage4
-rw-r--r--vcpkg/ports/simonbrunel-qtpromise/vcpkg.json16
6 files changed, 102 insertions, 0 deletions
diff --git a/vcpkg/ports/simonbrunel-qtpromise/patches/install_headers.patch b/vcpkg/ports/simonbrunel-qtpromise/patches/install_headers.patch
new file mode 100644
index 0000000..6bbbd98
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/patches/install_headers.patch
@@ -0,0 +1,17 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -21,6 +21,14 @@ add_library(qtpromise::qtpromise ALIAS qtpromise)
+ target_link_libraries(qtpromise INTERFACE Qt${QT_VERSION_MAJOR}::Core)
+ target_include_directories(qtpromise INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include")
+
++if(QTPROMISE_HEADER_INSTALL_DESTINATION)
++ install(
++ DIRECTORY "include" "src"
++ DESTINATION "${QTPROMISE_HEADER_INSTALL_DESTINATION}"
++ CONFIGURATIONS "${QTPROMISE_HEADER_INSTALL_COMPONENTS}"
++ )
++endif()
++
+ add_definitions(
+ -DQT_DEPRECATED_WARNINGS
+ -DQT_NO_KEYWORDS
diff --git a/vcpkg/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch b/vcpkg/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch
new file mode 100644
index 0000000..8499cbc
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/patches/remove_error_flags.patch
@@ -0,0 +1,21 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -34,6 +34,7 @@ add_definitions(
+ -DQT_NO_KEYWORDS
+ )
+
++#[[ remove error flags
+ # https://github.com/simonbrunel/qtpromise/issues/10
+ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU")
+ # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
+@@ -83,8 +84,10 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
+ /WX
+ )
+ endif()
++]]
+
+ if(NOT SUBPROJECT)
+ enable_testing()
+ add_subdirectory(tests)
+ endif()
++
diff --git a/vcpkg/ports/simonbrunel-qtpromise/portfile.cmake b/vcpkg/ports/simonbrunel-qtpromise/portfile.cmake
new file mode 100644
index 0000000..0c60b1a
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/portfile.cmake
@@ -0,0 +1,25 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO simonbrunel/qtpromise
+ REF "v${VERSION}"
+ SHA512 0d6316ec9503a7781b4d9e615e6d538b21b6282a76e5e28e3f323bcdb740e6f66e6c55944e31fc62cec7cc25a90b0f7318277f044a630500202971ca6e2e85b6
+ HEAD_REF master
+ PATCHES
+ patches/install_headers.patch
+ patches/remove_error_flags.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DQTPROMISE_HEADER_INSTALL_DESTINATION="${CURRENT_PACKAGES_DIR}/include/${PORT}"
+ -DQTPROMISE_HEADER_INSTALL_COMPONENTS="Release"
+ -DSUBPROJECT=ON # do not build tests
+)
+vcpkg_cmake_install()
+
+set(USE_QT_VERSION "6") # for Qt5, replace this number with 5, and replace the dependency on port qtbase in vcpkg.json with port qt5-base
+configure_file("${CMAKE_CURRENT_LIST_DIR}/unofficial-config.cmake.in" "${CURRENT_PACKAGES_DIR}/share/unofficial-${PORT}/unofficial-${PORT}-config.cmake" @ONLY)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
+configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
diff --git a/vcpkg/ports/simonbrunel-qtpromise/unofficial-config.cmake.in b/vcpkg/ports/simonbrunel-qtpromise/unofficial-config.cmake.in
new file mode 100644
index 0000000..2458704
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/unofficial-config.cmake.in
@@ -0,0 +1,19 @@
+
+set(@PORT@_VERSION "@VERSION@")
+
+if(TARGET unofficial-@PORT@)
+ set(unofficial-@PORT@_FOUND TRUE)
+ return()
+endif()
+
+include(CMakeFindDependencyMacro)
+
+find_dependency(Qt@USE_QT_VERSION@ REQUIRED COMPONENTS Core)
+
+add_library(unofficial-@PORT@ INTERFACE)
+
+target_link_libraries(unofficial-@PORT@ INTERFACE Qt::Core)
+target_include_directories(unofficial-@PORT@ INTERFACE "${CMAKE_CURRENT_LIST_DIR}/../../include/@PORT@/include")
+
+set(unofficial-@PORT@_FOUND TRUE)
+
diff --git a/vcpkg/ports/simonbrunel-qtpromise/usage b/vcpkg/ports/simonbrunel-qtpromise/usage
new file mode 100644
index 0000000..ed536b1
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/usage
@@ -0,0 +1,4 @@
+simonbrunel-qtpromise provides CMake targets:
+
+find_package(unofficial-simonbrunel-qtpromise CONFIG REQUIRED)
+target_link_libraries(main PRIVATE unofficial-simonbrunel-qtpromise) \ No newline at end of file
diff --git a/vcpkg/ports/simonbrunel-qtpromise/vcpkg.json b/vcpkg/ports/simonbrunel-qtpromise/vcpkg.json
new file mode 100644
index 0000000..e0396de
--- /dev/null
+++ b/vcpkg/ports/simonbrunel-qtpromise/vcpkg.json
@@ -0,0 +1,16 @@
+{
+ "name": "simonbrunel-qtpromise",
+ "version": "0.7.0",
+ "port-version": 1,
+ "maintainers": "Simon Brunel",
+ "description": "Promises/A+ implementation for Qt/C++",
+ "homepage": "https://qtpromise.netlify.app/",
+ "license": "MIT",
+ "dependencies": [
+ "qtbase",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ }
+ ]
+}