Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@

Comment thread
bold84 marked this conversation as resolved.
Outdated
$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


266 changes: 266 additions & 0 deletions ports/zeroc-ice/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,266 @@

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

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

get_filename_component(SOURCE_PATH_SUFFIX "${SOURCE_PATH}" NAME)

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 "shared cpp11-shared")
if(${VCPKG_LIBRARY_LINKAGE} STREQUAL "static")
set(ICE_BUILD_CONFIG "static 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 LANGUAGES=cpp OPTIMIZE=no -j${VCPKG_CONCURRENCY} srcs
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(ICE_MAPPING_NAME "cpp98")
if("cpp11" IN_LIST FEATURES)
set(ICE_CPP11_MAPPING "On")
set(ICE_MAPPING_NAME "cpp11")
endif()

# Used as TARGET in vcpkg_install_msbuild()
set(ICE_MAIN_TARGET "C++98\\ice")
if(ICE_CPP11_MAPPING)
set(ICE_MAIN_TARGET "C++11\\ice++11")
endif()

# Certain executables implicitly cause the builds C++98 based libraries they
# depend on, regardless of selected C++ mapping.
# Generated header files will only be installed for the selected C++ mapping.

set(ICE_OPTIONAL_COMPONENTS "")

# IceSSL
if("icessl" IN_LIST FEATURES)
if(ICE_CPP11_MAPPING)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++11\\icessl++11")
else()
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++98\\icessl")
endif()
endif()

# Glacier2
if("glacier2" IN_LIST FEATURES)
if(ICE_CPP11_MAPPING)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++11\\glacier2++11")
else()
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++98\\glacier2")
endif()

endif()

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

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

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

# IceGrid
if("icegrid" IN_LIST FEATURES)
if(ICE_CPP11_MAPPING)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++11\\icegrid++11")
else()
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++98\\icegrid")
endif()
endif()

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

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

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

# IceStorm
if("icestorm" IN_LIST FEATURES)
if(ICE_CPP11_MAPPING)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++11\\icestorm++11")
else()
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++98\\icestorm")
endif()
endif()

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

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

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

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

# IceDiscovery
if("icediscovery" IN_LIST FEATURES)
if(ICE_CPP11_MAPPING)
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++11\\icediscovery++11")
else()
vcpkg_list(APPEND ICE_OPTIONAL_COMPONENTS "/t:C++98\\icediscovery")
endif()
endif()

# Build Ice
vcpkg_install_msbuild(
SOURCE_PATH ${SOURCE_PATH}
PROJECT_SUBPATH cpp/msbuild/ice.v142.sln
SKIP_CLEAN
TARGET ${ICE_MAIN_TARGET}
USE_VCPKG_INTEGRATION
OPTIONS
/p:UseVcpkg=yes
/p:IceBuildingSrc=yes
${ICE_OPTIONAL_COMPONENTS}
)

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}")

# Install generated header files (they depend on the selected C++ mapping)
set(INCLUDE_GEN_SUB_DIRECTORIES
"Glacier2"
"Ice"
"IceBox"
"IceSSL"
"IceStorm"
)
install_includes("${RELEASE_BUILD_DIR}/cpp/include/generated/${ICE_MAPPING_NAME}/${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)
Loading