Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[zeroc-ice] New port #23764

Merged
merged 35 commits into from
Apr 13, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
89aa4ab
Initial commit
bold84 Mar 25, 2022
0833b30
clean up
bold84 Mar 25, 2022
4912e18
updated manifest and version
bold84 Mar 25, 2022
a5b61cb
Removed C++11 mapping option (feature) and made C++11 the default map…
bold84 Mar 25, 2022
897bbff
updated version
bold84 Mar 25, 2022
39c27d0
added main target
bold84 Mar 25, 2022
b031d7e
corrected ci.baseline.txt entries
bold84 Mar 25, 2022
45efd8c
updated version
bold84 Mar 25, 2022
6963f50
fixed generated header path
bold84 Mar 25, 2022
6c72220
Updated version
bold84 Mar 25, 2022
c659211
fixed include paths
bold84 Mar 25, 2022
75c052d
updated version
bold84 Mar 25, 2022
f60f20c
expect x64-windows-static to fail
bold84 Mar 25, 2022
371847c
added patches for clang 13
bold84 Mar 25, 2022
ecb126b
update version
bold84 Mar 25, 2022
85dc81f
Update ports/zeroc-ice/portfile.cmake
bold84 Mar 29, 2022
ac20f97
2->4 spaces
bold84 Mar 29, 2022
2f17cee
Removed v144/5 stuff
bold84 Mar 29, 2022
d3f92f1
check for .DS_Store file before deletion
bold84 Mar 29, 2022
9e8efb0
several changes
bold84 Mar 29, 2022
861f696
format vcpkg.json
bold84 Mar 29, 2022
0cd4319
update version
bold84 Mar 29, 2022
d3e1aa3
remove typo
bold84 Mar 29, 2022
2573470
updated version
bold84 Mar 29, 2022
5d8f703
Merge branch 'microsoft:master' into zeroc_ice_port
bold84 Mar 29, 2022
208338d
reformatting
bold84 Mar 29, 2022
65cc943
resolve review issues
bold84 Mar 31, 2022
a00fbb9
regex
bold84 Mar 31, 2022
f2ac64a
updated version
bold84 Mar 31, 2022
facd40f
windows-static
bold84 Mar 31, 2022
9829f9d
allow static builds on windows and added maintainer
bold84 Mar 31, 2022
2881e55
updated version
bold84 Mar 31, 2022
8da6d02
added openssl as a dependency for Ice core library
bold84 Mar 31, 2022
daab983
updated version
bold84 Mar 31, 2022
a4a58ae
minor updates
strega-nil Apr 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions ports/zeroc-ice/fixProjFiles.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

$rootPath=$args[0]

$cppSrcPath = "$rootPath/cpp/src"
if($cppSrcPath)
{
Write-Output "Processing $cppSrcPath"
$projectFiles = Get-ChildItem -Path $cppSrcPath -Filter *.vcxproj -Recurse -ErrorAction SilentlyContinue -Force

foreach($proj in $projectFiles)
{
Write-Output $proj.FullName
$content = Get-Content -Path $proj.FullName
$content = $content -replace '<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">', '<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild" Condition="''$(UseVcpkg)'' != ''yes''">'
$content = $content -replace '<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>',''
$content = $content -replace '<RuntimeLibrary>MultiThreaded</RuntimeLibrary>',''
$content | Set-Content -Path $proj.FullName
}
}
else
{
Write-Error "Error: No path defined!"
}

# Download nuget file with .zip extention to temporary folder
$tmpPath = [System.IO.Path]::GetTempPath()
$msbuilderDlPath = "$tmpPath/zeroc.icebuilder.msbuild.5.0.7.zip"
Invoke-WebRequest -Uri "https://globalcdn.nuget.org/packages/zeroc.icebuilder.msbuild.5.0.7.nupkg" -OutFile $msbuilderDlPath

# Ensure destination folder exists.
$msBuilderPath = "$rootPath/cpp/msbuild/packages/zeroc.icebuilder.msbuild.5.0.7"
if(-Not (Test-Path -Path $msBuilderPath))
{
New-Item -Path $msBuilderPath -ItemType Directory -Force
}

# Extract nuget archive to $msBuilderPath and remove the downloaded file
Expand-Archive -Path $msbuilderDlPath -DestinationPath $msBuilderPath
Remove-Item -Path $msbuilderDlPath


13 changes: 13 additions & 0 deletions ports/zeroc-ice/md5i_fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/cpp/src/Slice/MD5I.cpp b/cpp/src/Slice/MD5I.cpp
index 66f4de545b..2430b1fd1b 100644
--- a/cpp/src/Slice/MD5I.cpp
+++ b/cpp/src/Slice/MD5I.cpp
@@ -172,7 +172,7 @@ md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
* On little-endian machines, we can process properly aligned
* data without copying it.
*/
- if (!((data - (const md5_byte_t *)0) & 3)) {
+ if (!((reinterpret_cast<uintptr_t>(data)) & 3)) {
/* data are properly aligned */
X = (const md5_word_t *)data;
} else {
239 changes: 239 additions & 0 deletions ports/zeroc-ice/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO zeroc-ice/ice
REF v3.7.7
SHA512 73c3a2bb14c9e145383e4026206edd3e03b29c60a33af628611bfdab71d69a3aed108ce4e6cbfd67eb852560110e3495b4bd238c8cdf0de9d1f8e2f1088513ee
PATCHES md5i_fix.patch slice2swift.patch
)

set(RELEASE_TRIPLET ${TARGET_TRIPLET}-rel)
set(DEBUG_TRIPLET ${TARGET_TRIPLET}-dbg)

get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME)
set(RELEASE_BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${RELEASE_TRIPLET}/${SOURCE_PATH_SUFFIX})
set(DEBUG_BUILD_DIR ${CURRENT_BUILDTREES_DIR}/${DEBUG_TRIPLET}/${SOURCE_PATH_SUFFIX})


set(ICE_OPTIONAL_COMPONENTS_MSBUILD "")
set(ICE_OPTIONAL_COMPONENTS_MAKE "")

# IceSSL
if("icessl" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\icessl++11")
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MAKE "src/IceSSL")
endif()

# Glacier2
if("glacier2" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\glacier2++11")
endif()

# Glacier2Router
if("glacier2router" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\glacier2router")
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\glacier2cryptpermissionsverifier")
endif()

# IceBox
if("icebox" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\iceboxlib++11")
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\icebox++11")
endif()

# IceBoxAdmin executable
if("iceboxadmin" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\iceboxadmin")
endif()

# IceGrid
if("icegrid" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\icegrid++11")
endif()

# IceGridAdmin
if("icegridadmin" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icegridadmin")
endif()

# IceGridRegistry
if("icegridregistry" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icegridregistry")
endif()

# IceGridNode
if("icegridnode" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icegridnode")
endif()

# IceStorm
if("icestorm" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\icestorm++11")
endif()

# IceStormAdmin
if("icestormadmin" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icestormadmin")
endif()

# IceStormService
if("icestormservice" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icestormservice")
endif()

# IceStormDB
if("icestormdb" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icestormdb")
endif()

# IceBridge executable
if("icebridge" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++98\\icebridge")
endif()

# IceDiscovery
if("icediscovery" IN_LIST FEATURES)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS_MSBUILD "/t:C++11\\icediscovery++11")
endif()



if(NOT VCPKG_TARGET_IS_WINDOWS)

# Setting these as environment variables, as .d files aren't generated the first time passing them to make.
set(ENV{MCPP_HOME} ${CURRENT_INSTALLED_DIR})
set(ENV{EXPAT_HOME} ${CURRENT_INSTALLED_DIR})
set(ENV{BZ2_HOME} ${CURRENT_INSTALLED_DIR})
set(ENV{LMDB_HOME} ${CURRENT_INSTALLED_DIR})
set(ENV{CPPFLAGS} "-I${CURRENT_INSTALLED_DIR}/include")
set(ENV{LDFLAGS} "-L${CURRENT_INSTALLED_DIR}/debug/lib")

set(ICE_BUILD_CONFIG "cpp11-shared")
if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
set(ICE_BUILD_CONFIG "cpp11-static")
endif()

message(STATUS "Building ${TARGET_TRIPLET}-dbg")
vcpkg_execute_build_process(
COMMAND make install V=1 prefix=${CURRENT_PACKAGES_DIR}/debug linux_id=vcpkg CONFIGS=${ICE_BUILD_CONFIG} USR_DIR_INSTALL=yes OPTIMIZE=no ${ICE_OPTIONAL_COMPONENTS_MAKE} -j${VCPKG_CONCURRENCY}
WORKING_DIRECTORY ${SOURCE_PATH}/cpp
LOGNAME make-${TARGET_TRIPLET}-dbg
)

# Clean up for the next round
vcpkg_execute_build_process(
COMMAND make distclean
WORKING_DIRECTORY ${SOURCE_PATH}/cpp
LOGNAME make-clean-${TARGET_TRIPLET}
)

# Release build
set(ENV{LDFLAGS} "-L${CURRENT_INSTALLED_DIR}/lib")
message(STATUS "Building ${TARGET_TRIPLET}-rel")
vcpkg_execute_build_process(
COMMAND make install V=1 prefix=${CURRENT_PACKAGES_DIR} linux_id=vcpkg CONFIGS=${ICE_BUILD_CONFIG} LANGUAGES=cpp USR_DIR_INSTALL=yes OPTIMIZE=yes -j${VCPKG_CONCURRENCY} srcs
WORKING_DIRECTORY ${SOURCE_PATH}/cpp
LOGNAME make-${TARGET_TRIPLET}-rel
)

if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib64")
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib64 ${CURRENT_PACKAGES_DIR}/debug/lib)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib64 ${CURRENT_PACKAGES_DIR}/lib)
endif()

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

else(NOT VCPKG_TARGET_IS_WINDOWS)

# Fix project files to prevent nuget restore of dependencies and
# remove hard coded runtime linkage
vcpkg_execute_required_process(
COMMAND powershell ${CURRENT_PORT_DIR}/fixProjFiles.ps1 "${SOURCE_PATH}"
LOGNAME fixProjFiles-${TARGET_TRIPLET}
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}
)




set(MSVC_TOOLSET_VER ${VCPKG_PLATFORM_TOOLSET})
if(${VCPKG_PLATFORM_TOOLSET} STREQUAL "v144" OR ${VCPKG_PLATFORM_TOOLSET} STREQUAL "v145")
set(MSVC_TOOLSET_VER "v143")
endif()

# Build Ice
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH "cpp/msbuild/ice.${VCPKG_PLATFORM_TOOLSET}.sln"
SKIP_CLEAN
TARGET "C++11\\ice++11"
USE_VCPKG_INTEGRATION
OPTIONS
/p:UseVcpkg=yes
/p:IceBuildingSrc=yes
${ICE_OPTIONAL_COMPONENTS_MSBUILD}
)

if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/zeroc.icebuilder.msbuild.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/zeroc.icebuilder.msbuild.dll")
endif()
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/zeroc.icebuilder.msbuild.dll")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/bin/zeroc.icebuilder.msbuild.dll")
endif()

# install_includes
function(install_includes ORIGINAL_PATH RELATIVE_PATHS)
foreach(RELATIVE_PATH ${RELATIVE_PATHS})
file(
GLOB
HEADER_FILES
${ORIGINAL_PATH}/${RELATIVE_PATH}/*.h)
file(COPY ${HEADER_FILES}
DESTINATION ${CURRENT_PACKAGES_DIR}/include/${RELATIVE_PATH})
endforeach()
endfunction()

# Install header files
set(INCLUDE_SUB_DIRECTORIES
"Glacier2"
"Ice"
"IceBox"
"IceGrid"
"IcePatch2"
"IceSSL"
"IceStorm"
"IceUtil"
)

install_includes("${RELEASE_BUILD_DIR}/cpp/include" "${INCLUDE_SUB_DIRECTORIES}")

set(INCLUDE_GEN_SUB_DIRECTORIES
"Glacier2"
"Ice"
"IceBox"
"IceSSL"
"IceStorm"
)
install_includes("${RELEASE_BUILD_DIR}/cpp/include/generated/cpp11/${TRIPLET_SYSTEM_ARCH}/Release" "${INCLUDE_GEN_SUB_DIRECTORIES}")

vcpkg_clean_msbuild()

endif(NOT VCPKG_TARGET_IS_WINDOWS)

file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools)

if(NOT VCPKG_TARGET_IS_WINDOWS)
file(RENAME ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/tools/${PORT})
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

if(VCPKG_TARGET_IS_OSX)
file(REMOVE "${CURRENT_PACKAGES_DIR}/.DS_Store")
endif()

# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/zeroc-ice RENAME copyright)
25 changes: 25 additions & 0 deletions ports/zeroc-ice/slice2swift.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
diff --git a/cpp/src/slice2swift/SwiftUtil.cpp b/cpp/src/slice2swift/SwiftUtil.cpp
index 404dee7670..01e144de90 100644
--- a/cpp/src/slice2swift/SwiftUtil.cpp
+++ b/cpp/src/slice2swift/SwiftUtil.cpp
@@ -1523,7 +1523,7 @@ SwiftGenerator::writeMemberwiseInitializer(IceUtilInternal::Output& out,
const DataMemberList& baseMembers,
const DataMemberList& allMembers,
const ContainedPtr& p,
- bool local,
+ bool /*local*/,
bool rootClass,
const StringPairList& extraParams)
{
@@ -1531,11 +1531,6 @@ SwiftGenerator::writeMemberwiseInitializer(IceUtilInternal::Output& out,
{
out << sp;
out << nl;
- int typeCtx = TypeContextInParam;
- if(local)
- {
- typeCtx |= TypeContextLocal;
- }
out << "public init" << spar;
for(DataMemberList::const_iterator i = allMembers.begin(); i != allMembers.end(); ++i)
{
Loading