Skip to content

Commit

Permalink
[itsy-bitsy,ztd-cuneicode,ztd-encoding-tables,ztd-idk,ztd-platform,zt…
Browse files Browse the repository at this point in the history
…d-static-containers] add new port (microsoft#34735)

* [itsy-bitsy] add new port

* [ztd-text] update

* update

* fix idk windows

* update single

* fix include cmake

* make them static,and fix ztd text dependency

* fix cuneicode linkage

* update to lastest

* fix ztd marco

* use upstream changes

* update to lastest

* Revert "update to lastest"

This reverts commit ee08876.

* fix comparison

* fix c32_state alignment

* fetch upstream lastest change

* CI [skip actions]

* add unofficial namespace

* ztd-text remove usage

* CI [skip actions]

* CI [skip actions]

* CI [skip actions]

* remove unofficial namespace

* remove target sources

* fix version

* fix static_containers deps

* fix deps

* dynamci libs

* Revert "dynamci libs"

This reverts commit c44e4c3.
  • Loading branch information
jiayuehua authored Nov 11, 2023
1 parent b633a46 commit 61f6108
Show file tree
Hide file tree
Showing 30 changed files with 988 additions and 33 deletions.
55 changes: 55 additions & 0 deletions ports/itsy-bitsy/fix-cmake-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c7b2e2a..9219be1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -31,6 +31,8 @@ project(itsy.bitsy
DESCRIPTION "Standard bit utilities to supplement the C and C++ standard libraries."
LANGUAGES C CXX)

+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
# # Pre-dependencies
# this is for all the deps we may or may not need before-hand to make things right
if(ITSY_BITSY_READTHEDOCS)
@@ -100,10 +102,7 @@ option(ITSY_BITSY_EXAMPLES "Enable build of examples" OFF)

# # Dependencies
# ztd.idk
-FetchContent_Declare(ztd.idk
- GIT_REPOSITORY https://github.com/soasis/idk.git
- GIT_TAG main)
-FetchContent_MakeAvailable(ztd.idk)
+find_package(ztd.idk CONFIG REQUIRED)

# # itsy.bitsy Target
# Build Target
@@ -136,6 +135,10 @@ export(TARGETS itsy.bitsy FILE "${CMAKE_CURRENT_BINARY_DIR}/cmake/itsy.bitsy-tar

install(TARGETS itsy.bitsy
EXPORT itsy.bitsy)
+install(EXPORT itsy.bitsy
+ FILE itsy.bitsy-targets.cmake
+ DESTINATION lib/cmake/itsy.bitsy
+)

install(DIRECTORY include/itsy
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
diff --git a/cmake/itsy.bitsy-config.cmake.in b/cmake/itsy.bitsy-config.cmake.in
index 9f87935..6e18425 100644
--- a/cmake/itsy.bitsy-config.cmake.in
+++ b/cmake/itsy.bitsy-config.cmake.in
@@ -9,10 +9,13 @@
# See https://github.com/ThePhD/itsy_bitsy#using-the-library for documentation.

@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
+find_dependency(ztd.idk CONFIG)
+include("${CMAKE_CURRENT_LIST_DIR}/itsy.bitsy-targets.cmake")

-include("${CMAKE_CURRENT_LIST_DIR}/sol2-targets.cmake")

MESSAGE(STATUS ${CMAKE_CURRENT_LIST_DIR})
+add_library(itsy::bitsy ALIAS itsy.bitsy)

if (TARGET sol2)
get_target_property(SOL2_INCLUDE_DIRS
27 changes: 27 additions & 0 deletions ports/itsy-bitsy/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO ThePhD/itsy_bitsy
REF d5b6bf9509bb2dff6235452d427f0b1c349d5f8b
SHA512 06489e46ad55a7fa55ddf88290509b157cf53518a8d9532d5a56e9907e5efaa298cb8946807e497461d322f62b4bad9b16864ef0def527edc8503f7a7884b8e1
HEAD_REF main
PATCHES fix-cmake-install.patch
)

set(VCPKG_BUILD_TYPE release) # header-only

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DFETCHCONTENT_FULLY_DISCONNECTED=ON
-DITSY_BITSY_SINGLE=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME itsy.bitsy CONFIG_PATH "lib/cmake/itsy.bitsy")

vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
18 changes: 18 additions & 0 deletions ports/itsy-bitsy/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "itsy-bitsy",
"version-date": "2022-08-02",
"description": "Bit containers, sequences, and views for everyone. ",
"homepage": "https://github.com/ThePhD/itsy_bitsy",
"license": "BSL-1.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"ztd-idk"
]
}
95 changes: 95 additions & 0 deletions ports/ztd-cuneicode/fix-cmake-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 00aa8b6..d49889b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,6 +39,12 @@ FetchContent_Declare(ztd.cmake
GIT_TAG main)
FetchContent_MakeAvailable(ztd.cmake)
set(CMAKE_PROJECT_INCLUDE ${ZTD_CMAKE_PROJECT_PRELUDE})
+include(FetchContent)
+FetchContent_Declare(ztd.cmake
+ GIT_REPOSITORY https://github.com/soasis/cmake
+ GIT_TAG main)
+FetchContent_MakeAvailable(ztd.cmake)
+set(CMAKE_PROJECT_INCLUDE ${ZTD_CMAKE_PROJECT_PRELUDE})

# # Project declaration
# informs about the project, gives a description, version and MOST IMPORTANTLY
@@ -49,6 +55,8 @@ project(ztd.cuneicode
HOMEPAGE_URL "https://ztdcuneicode.readthedocs.io/en/latest/"
LANGUAGES C CXX)

+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
if(ZTD_CUNEICODE_READTHEDOCS)
# ReadTheDocs seems unable to handle the include at the project level: something must be going wrong?
include(CheckCXXCompilerFlag)
@@ -132,15 +140,7 @@ option(ZTD_CUNEICODE_SIMDUTF_SHARED "Enable the simdutf shared target for cuneic

# # Dependencies
# ztd.idk
-FetchContent_Declare(ztd.idk
- GIT_REPOSITORY https://github.com/soasis/idk.git
- GIT_TAG main)
-FetchContent_MakeAvailable(ztd.idk)
-# ztd.encoding_tables
-FetchContent_Declare(ztd.encoding_tables
- GIT_REPOSITORY https://github.com/soasis/encoding_tables.git
- GIT_TAG main)
-FetchContent_MakeAvailable(ztd.encoding_tables)
+find_package(ztd.encoding_tables CONFIG REQUIRED)

# # Main Library
file(GLOB ztd.cuneicode.includes CONFIGURE_DEPENDS include/*.hpp)
@@ -187,15 +187,12 @@ target_compile_options(ztd.cuneicode PUBLIC
${--enable-conforming-preprocessor}
)

+install(TARGETS ztd.cuneicode
+ EXPORT ztd.cuneicode-targets
+ DESTINATION lib)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
-install(TARGETS ztd.cuneicode
- PUBLIC_HEADER
- RUNTIME
- ARCHIVE
- LIBRARY
-)

# # Config / Version packaging
# Version configurations
@@ -213,6 +210,15 @@ export(TARGETS ztd.cuneicode
FILE
"${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.cuneicode/ztd.cuneicode-targets.cmake")

+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.cuneicode/ztd.cuneicode-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.cuneicode/ztd.cuneicode-config-version.cmake
+ DESTINATION share/ztd.cuneicode
+ )
+install(EXPORT ztd.cuneicode-targets
+ FILE ztd.cuneicode-targets.cmake
+ DESTINATION share/ztd.cuneicode
+)
if(ZTD_CUNEICODE_GENERATE_SINGLE)
add_subdirectory(single)
endif()
diff --git a/cmake/ztd.cuneicode-config.cmake.in b/cmake/ztd.cuneicode-config.cmake.in
index 4bfb041..823d50b 100644
--- a/cmake/ztd.cuneicode-config.cmake.in
+++ b/cmake/ztd.cuneicode-config.cmake.in
@@ -1,6 +1,11 @@
@PACKAGE_INIT@
+include(CMakeFindDependencyMacro)
+find_dependency(ztd.encoding_tables CONFIG)

-if (TARGET ztd::cuneicode)
+include(${CMAKE_CURRENT_LIST_DIR}/ztd.cuneicode-targets.cmake)
+
+if (TARGET ztd.cuneicode)
+ add_library(ztd::cuneicode ALIAS ztd.cuneicode)
get_target_property(ZTD_CUNEICODE_INCLUDE_DIRS
ztd.cuneicode.single INTERFACE_INCLUDE_DIRECTORIES)
set_and_check(ZTD_CUNEICODE_INCLUDE_DIRS "${ZTD_CUNEICODE_INCLUDE_DIRS}")
22 changes: 22 additions & 0 deletions ports/ztd-cuneicode/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO soasis/cuneicode
REF 093041aa934b7b09e7ee7300abdc3f54bb57e389
SHA512 0066fee5cf75fa07dc97934153e4206e4add69f15602526c1953b0302d5a6f8b56256e837a73acee187b0e02e676fba1350ad39b162c4901c624b12fa4e0fb03
HEAD_REF main
PATCHES fix-cmake-install.patch
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_cmake_install()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
18 changes: 18 additions & 0 deletions ports/ztd-cuneicode/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "ztd-cuneicode",
"version-date": "2023-11-03",
"description": "Shared tables between C and C++ for encoding infrastructure",
"homepage": "http://ztdcuneicode.rtfd.io/",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"ztd-encoding-tables"
]
}
68 changes: 68 additions & 0 deletions ports/ztd-encoding-tables/fix-cmake-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7612c6c..8d2233d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -50,6 +50,8 @@ project(ztd.encoding_tables
HOMEPAGE_URL "https://ztdencoding_tables.rtfd.io/"
LANGUAGES CXX C)

+include(CMakePackageConfigHelpers)
+include(GNUInstallDirs)
if(ZTD_ENCODING_TABLES_READTHEDOCS)
# ReadTheDocs seems unable to handle the include at the project level: something must be going wrong?
include(CheckCXXCompilerFlag)
@@ -127,10 +129,7 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT)
endif()

# # Main Dependency
-FetchContent_Declare(ztd.idk
- GIT_REPOSITORY https://github.com/soasis/idk.git
- GIT_TAG main)
-FetchContent_MakeAvailable(ztd.idk)
+find_package(ztd.idk CONFIG REQUIRED)

# # Main library declarations
# ztd.encoding_tables
@@ -179,7 +178,9 @@ if(ZTD_ENCODING_TABLES_IS_TOP_LEVEL_PROJECT)
)
endif()

-install(TARGETS ztd.encoding_tables)
+install(TARGETS ztd.encoding_tables
+ EXPORT ztd.encoding_tables-targets
+ DESTINATION lib)
install(DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
@@ -199,9 +200,15 @@ export(TARGETS ztd.encoding_tables
"${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.encoding_tables/ztd.encoding_tables-targets.cmake"
)

-install(
- DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/cmake"
- TYPE DATA
+install(FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.encoding_tables/ztd.encoding_tables-config.cmake
+ ${CMAKE_CURRENT_BINARY_DIR}/cmake/ztd.encoding_tables/ztd.encoding_tables-config-version.cmake
+ DESTINATION share/ztd.encoding_tables
+ )
+
+install(EXPORT ztd.encoding_tables-targets
+ FILE ztd.encoding_tables-targets.cmake
+ DESTINATION share/ztd.encoding_tables
)

if(ZTD_ENCODING_TABLES_GENERATE_SINGLE)
diff --git a/cmake/ztd.encoding_tables-config.cmake.in b/cmake/ztd.encoding_tables-config.cmake.in
index 2b8db83..579f865 100644
--- a/cmake/ztd.encoding_tables-config.cmake.in
+++ b/cmake/ztd.encoding_tables-config.cmake.in
@@ -1,6 +1,7 @@
@PACKAGE_INIT@

-find_package(ztd.encoding_tables CONFIG REQUIRED)
+include(CMakeFindDependencyMacro)
+find_dependency(ztd.idk CONFIG)
include(${CMAKE_CURRENT_LIST_DIR}/ztd.encoding_tables-targets.cmake)

if (TARGET ztd.encoding_tables)
22 changes: 22 additions & 0 deletions ports/ztd-encoding-tables/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
if (VCPKG_TARGET_IS_WINDOWS)
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO soasis/encoding_tables
REF 2f4324b3d84db2300d0bf3d0e568a28992df2b55
SHA512 ec8684bca5673609c0b3014228b6b35647896f8288d6ef85778a7bb8a191c4c92985a11d625e7e5e306b738c16dce232f2604e7cf583ca5e9b76ff4a9f447732
HEAD_REF main
PATCHES fix-cmake-install.patch
)

vcpkg_cmake_configure(
SOURCE_PATH ${SOURCE_PATH}
)

vcpkg_cmake_install()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
18 changes: 18 additions & 0 deletions ports/ztd-encoding-tables/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "ztd-encoding-tables",
"version-date": "2023-06-10",
"description": "Shared tables between C and C++ for encoding infrastructure",
"homepage": "https://github.com/soasis/encoding_tables",
"license": "Apache-2.0",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
},
"ztd-idk"
]
}
Loading

0 comments on commit 61f6108

Please sign in to comment.