aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/duilib
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/duilib
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/duilib')
-rw-r--r--vcpkg/ports/duilib/enable-static.patch20
-rw-r--r--vcpkg/ports/duilib/fix-arm-build.patch11
-rw-r--r--vcpkg/ports/duilib/fix-encoding.patch16
-rw-r--r--vcpkg/ports/duilib/fix-include-path.patch30
-rw-r--r--vcpkg/ports/duilib/portfile.cmake27
-rw-r--r--vcpkg/ports/duilib/vcpkg.json18
6 files changed, 122 insertions, 0 deletions
diff --git a/vcpkg/ports/duilib/enable-static.patch b/vcpkg/ports/duilib/enable-static.patch
new file mode 100644
index 0000000..6f069d4
--- /dev/null
+++ b/vcpkg/ports/duilib/enable-static.patch
@@ -0,0 +1,20 @@
+diff --git a/DuiLib/CMakeLists.txt b/DuiLib/CMakeLists.txt
+index 96b8fe4..99dc314 100644
+--- a/DuiLib/CMakeLists.txt
++++ b/DuiLib/CMakeLists.txt
+@@ -19,8 +19,14 @@ if (MSVC)
+ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /source-charset:.936")
+ endif()
+
++if (BUILD_SHARED_LIBS STREQUAL ON)
++ SET(LINKAGE SHARED)
++else()
++ SET(LINKAGE STATIC)
++endif()
++
+ set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
+-add_library(duilib SHARED ${Control_src} ${Core_src} ${Layout_src} ${Utils_src} ${Root_src})
++add_library(duilib ${LINKAGE} ${Control_src} ${Core_src} ${Layout_src} ${Utils_src} ${Root_src})
+
+ add_definitions(-DUILIB_EXPORTS)
+ target_link_libraries(duilib comctl32 gdi32 user32)
diff --git a/vcpkg/ports/duilib/fix-arm-build.patch b/vcpkg/ports/duilib/fix-arm-build.patch
new file mode 100644
index 0000000..0d967d9
--- /dev/null
+++ b/vcpkg/ports/duilib/fix-arm-build.patch
@@ -0,0 +1,11 @@
+diff --git a/DuiLib/CMakeLists.txt b/DuiLib/CMakeLists.txt
+index 6a4da5a..4961174 100644
+--- a/DuiLib/CMakeLists.txt
++++ b/DuiLib/CMakeLists.txt
+@@ -18,5 +18,5 @@ set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
+ add_library(duilib SHARED ${Control_src} ${Core_src} ${Layout_src} ${Utils_src} ${Root_src})
+
+ add_definitions(-DUILIB_EXPORTS)
+-target_link_libraries(duilib comctl32)
++target_link_libraries(duilib comctl32 gdi32 user32)
+ target_include_directories(duilib PUBLIC $<INSTALL_INTERFACE:include>)
diff --git a/vcpkg/ports/duilib/fix-encoding.patch b/vcpkg/ports/duilib/fix-encoding.patch
new file mode 100644
index 0000000..526f43f
--- /dev/null
+++ b/vcpkg/ports/duilib/fix-encoding.patch
@@ -0,0 +1,16 @@
+diff --git a/DuiLib/CMakeLists.txt b/DuiLib/CMakeLists.txt
+index 4961174..96b8fe4 100644
+--- a/DuiLib/CMakeLists.txt
++++ b/DuiLib/CMakeLists.txt
+@@ -14,6 +14,11 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Core)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Layout)
+ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Utils)
+
++if (MSVC)
++ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /source-charset:.936")
++ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /source-charset:.936")
++endif()
++
+ set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
+ add_library(duilib SHARED ${Control_src} ${Core_src} ${Layout_src} ${Utils_src} ${Root_src})
+
diff --git a/vcpkg/ports/duilib/fix-include-path.patch b/vcpkg/ports/duilib/fix-include-path.patch
new file mode 100644
index 0000000..66405f6
--- /dev/null
+++ b/vcpkg/ports/duilib/fix-include-path.patch
@@ -0,0 +1,30 @@
+diff --git a/DuiLib/CMakeLists.txt b/DuiLib/CMakeLists.txt
+index 188f36f..5c706fb 100644
+--- a/DuiLib/CMakeLists.txt
++++ b/DuiLib/CMakeLists.txt
+@@ -30,7 +30,7 @@ add_library(duilib ${LINKAGE} ${Control_src} ${Core_src} ${Layout_src} ${Utils_s
+
+ add_definitions(-DUILIB_EXPORTS)
+ target_link_libraries(duilib comctl32 gdi32 user32)
+-target_include_directories(duilib PUBLIC $<INSTALL_INTERFACE:include>)
++target_include_directories(duilib PUBLIC $<INSTALL_INTERFACE:include/duilib>)
+ target_compile_definitions(duilib PRIVATE UILIB_EXPORTS)
+ set_target_properties(duilib PROPERTIES OUTPUT_NAME "duilib")
+
+@@ -41,11 +41,11 @@ file(GLOB DUILIB_UTILS_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/Utils/*.h")
+ file(GLOB DUILIB_CONTROL_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/Control/*.h")
+ file(GLOB DUILIB_LAYOUT_HDRS "${CMAKE_CURRENT_SOURCE_DIR}/Layout/*.h")
+
+-install(FILES ${DUILIB_PUBLIC_HDRS} DESTINATION include)
+-install(FILES ${DUILIB_CORE_HDRS} DESTINATION include/Core)
+-install(FILES ${DUILIB_UTILS_HDRS} DESTINATION include/Utils)
+-install(FILES ${DUILIB_CONTROL_HDRS} DESTINATION include/Control)
+-install(FILES ${DUILIB_LAYOUT_HDRS} DESTINATION include/Layout)
++install(FILES ${DUILIB_PUBLIC_HDRS} DESTINATION include/duilib)
++install(FILES ${DUILIB_CORE_HDRS} DESTINATION include/duilib/Core)
++install(FILES ${DUILIB_UTILS_HDRS} DESTINATION include/duilib/Utils)
++install(FILES ${DUILIB_CONTROL_HDRS} DESTINATION include/duilib/Control)
++install(FILES ${DUILIB_LAYOUT_HDRS} DESTINATION include/duilib/Layout)
+
+ # Install binaries
+ install(
diff --git a/vcpkg/ports/duilib/portfile.cmake b/vcpkg/ports/duilib/portfile.cmake
new file mode 100644
index 0000000..3a89953
--- /dev/null
+++ b/vcpkg/ports/duilib/portfile.cmake
@@ -0,0 +1,27 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO duilib/duilib
+ REF 502ac62be82c2bc33cf0e8635782fb370c68b1e7
+ SHA512 249d2b7ab5b830a4b7a69e52e2e141f14e59d6bad610c48c7c2e4a8a974e45ace94d5106ea9583053d8a8ce389854ccea7c62e32c3685d2f07fe26225ece5e5a
+ HEAD_REF master
+ PATCHES
+ "fix-arm-build.patch"
+ "fix-encoding.patch"
+ "enable-static.patch"
+ "fix-include-path.patch"
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ NO_CHARSET_FLAG
+ OPTIONS
+ -DDUILIB_BUILD_EXAMPLES=OFF
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup()
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/duilib/vcpkg.json b/vcpkg/ports/duilib/vcpkg.json
new file mode 100644
index 0000000..f1a1f2a
--- /dev/null
+++ b/vcpkg/ports/duilib/vcpkg.json
@@ -0,0 +1,18 @@
+{
+ "name": "duilib",
+ "version-date": "2024-12-23",
+ "port-version": 1,
+ "description": "Duilib is a free open source DirectUI interface library under Windows. It is widely accepted by major Internet companies due to its simple and easy to expand design and stable and efficient implementation. It is widely used in IM, video client, stock market software, navigation software, and mobile phone assistive software. Duilib is still evolving, and will continue to improve in many aspects such as documentation, examples, animations, and rendering engines.",
+ "homepage": "https://github.com/duilib/duilib",
+ "supports": "windows & !uwp",
+ "dependencies": [
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}