Skip to content

Commit

Permalink
vcpkg pkg lists format migration part 1
Browse files Browse the repository at this point in the history
because we cannot atomically change the format of the VCPKG lists in our
repo and in the dependencies (OSS Fuzz), the lists format migration has to
be done in 5 steps:
- make a copy of old format lists in our repo (we are here)
- switch all the dependencies to that copy
- change the format of main files in our repo
- switch all the dependencies to the new format
- remove the old format copies from our repo

Signed-off-by: Mikhail Boldyrev <miboldyrev@gmail.com>
  • Loading branch information
MBoldyrev committed Oct 29, 2019
1 parent 94ffdd6 commit 850b9a3
Show file tree
Hide file tree
Showing 10 changed files with 201 additions and 0 deletions.
15 changes: 15 additions & 0 deletions vcpkg_old/VCPKG_BOOST_LOCALE_DEPS_LIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
boost-assert:
boost-build:
boost-config:
boost-function:
boost-integer:
boost-iterator:
boost-modular-build-helper:
boost-smart-ptr:
boost-static-assert:
boost-system:
boost-thread:
boost-type-traits:
boost-unordered:
boost-vcpkg-helpers:
libiconv:
1 change: 1 addition & 0 deletions vcpkg_old/VCPKG_COMMIT_SHA
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f3db66b403840b24ea2612d09cca30a5285f5ea3
23 changes: 23 additions & 0 deletions vcpkg_old/VCPKG_DEPS_LIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
protobuf:
grpc:
tbb:
gtest:
gflags:
soci[boost,postgresql]:
rapidjson:
fmt:
spdlog:
boost-filesystem:
boost-system:
boost-thread:
boost-variant:
boost-multiprecision:
boost-bimap:
boost-format:
boost-circular-buffer:
boost-assign:
boost-uuid:
boost-accumulators:
boost-property-tree:
boost-process:
iroha-ed25519:
1 change: 1 addition & 0 deletions vcpkg_old/VCPKG_HEAD_DEPS_LIST
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rxcpp:
12 changes: 12 additions & 0 deletions vcpkg_old/build_iroha_deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e

vcpkg_path="${1:-$(pwd)/vcpkg}"
iroha_vcpkg_path="${2:-$(pwd)/iroha/vcpkg_old}"

git clone https://github.com/microsoft/vcpkg $vcpkg_path
git -C $vcpkg_path checkout $(cat "$iroha_vcpkg_path"/VCPKG_COMMIT_SHA)
for i in "$iroha_vcpkg_path"/patches/*.patch; do git -C $vcpkg_path apply $i; done;
$vcpkg_path/bootstrap-vcpkg.sh
$vcpkg_path/vcpkg install $(cat "$iroha_vcpkg_path"/VCPKG_DEPS_LIST | cut -d':' -f1 | tr '\n' ' ')
$vcpkg_path/vcpkg install --head $(cat "$iroha_vcpkg_path"/VCPKG_HEAD_DEPS_LIST | cut -d':' -f1 | tr '\n' ' ')
Empty file added vcpkg_old/patches/.gitkeep
Empty file.
98 changes: 98 additions & 0 deletions vcpkg_old/patches/0001-iroha-ed25519-Initial-port.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
From 0ff426a760fbb749f5d59aca029b2f74a45857ad Mon Sep 17 00:00:00 2001
From: Andrei Lebedev <lebdron@gmail.com>
Date: Sat, 22 Jun 2019 07:45:34 +0000
Subject: [PATCH] [iroha-ed25519] Initial port

Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
---
...001-Add-check-for-amd64-64-24k-pic-target.patch | 27 +++++++++++++++++++
ports/iroha-ed25519/CONTROL | 4 +++
ports/iroha-ed25519/portfile.cmake | 31 ++++++++++++++++++++++
3 files changed, 62 insertions(+)
create mode 100644 ports/iroha-ed25519/0001-Add-check-for-amd64-64-24k-pic-target.patch
create mode 100644 ports/iroha-ed25519/CONTROL
create mode 100644 ports/iroha-ed25519/portfile.cmake

diff --git a/ports/iroha-ed25519/0001-Add-check-for-amd64-64-24k-pic-target.patch b/ports/iroha-ed25519/0001-Add-check-for-amd64-64-24k-pic-target.patch
new file mode 100644
index 0000000..1051437
--- /dev/null
+++ b/ports/iroha-ed25519/0001-Add-check-for-amd64-64-24k-pic-target.patch
@@ -0,0 +1,27 @@
+From 3ce523b1f003d074d29f21674fdd1bee8c0a884f Mon Sep 17 00:00:00 2001
+From: Andrei Lebedev <lebdron@gmail.com>
+Date: Wed, 12 Jun 2019 16:18:45 +0300
+Subject: [PATCH] Add check for amd64-64-24k-pic target
+
+Signed-off-by: Andrei Lebedev <lebdron@gmail.com>
+---
+ cmake/ed25519_merge_libraries.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cmake/ed25519_merge_libraries.cmake b/cmake/ed25519_merge_libraries.cmake
+index f6ad14b..f2a61cd 100644
+--- a/cmake/ed25519_merge_libraries.cmake
++++ b/cmake/ed25519_merge_libraries.cmake
+@@ -46,7 +46,7 @@ function(ed25519_merge_libraries TARGET LIBTYPE)
+
+ else()
+ # it is shared library
+- if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
++ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" AND TARGET amd64-64-24k-pic)
+ ed25519_target_link_libraries(amd64-64-24k-pic
+ "-Wl,--version-script=${CMAKE_SOURCE_DIR}/linker_exportmap"
+ )
+--
+2.20.1.windows.1
+
+
diff --git a/ports/iroha-ed25519/CONTROL b/ports/iroha-ed25519/CONTROL
new file mode 100644
index 0000000..b7a3d23
--- /dev/null
+++ b/ports/iroha-ed25519/CONTROL
@@ -0,0 +1,4 @@
+Source: iroha-ed25519
+Version: 2.0.1
+Description: RFC8032 compatible Ed25519 implementation with pluggable hash (sha2-512, sha3-512).
+
diff --git a/ports/iroha-ed25519/portfile.cmake b/ports/iroha-ed25519/portfile.cmake
new file mode 100644
index 0000000..9158510
--- /dev/null
+++ b/ports/iroha-ed25519/portfile.cmake
@@ -0,0 +1,31 @@
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO hyperledger/iroha-ed25519
+ REF 2.0.1
+ SHA512 dd873b5d13d9665ae0d97204a4769f744e7d35d3e6739c1a515ea5c1a9ed6ca27c570f118e5aa009b469ae4a8574515bfced4a3ece82113439630b28e8cbfac8
+ HEAD_REF master
+ PATCHES 0001-Add-check-for-amd64-64-24k-pic-target.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DEDIMPL=ref10
+ -DHASH=sha3_brainhub
+ -DHUNTER_ENABLED=OFF
+)
+
+vcpkg_install_cmake()
+
+vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/ed25519 TARGET_PATH share/ed25519)
+
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
+
+#vcpkg_copy_pdbs()
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/iroha-ed25519 RENAME copyright)
+
--
2.7.4

22 changes: 22 additions & 0 deletions vcpkg_old/patches/oss/0001-vcpkg-fs-linking.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/toolsrc/CMakeLists.txt b/toolsrc/CMakeLists.txt
index fccf2b7a..ed2baece 100644
--- a/toolsrc/CMakeLists.txt
+++ b/toolsrc/CMakeLists.txt
@@ -55,10 +55,14 @@ if(CLANG)
endif()
endif()

-if(GCC OR (CLANG AND USES_LIBSTDCXX))
+if(GCC)
target_link_libraries(vcpkg PRIVATE stdc++fs)
-elseif(CLANG)
- target_link_libraries(vcpkg PRIVATE c++fs)
+elseif(CLANG AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9")
+ if (USES_LIBSTDCXX)
+ target_link_libraries(vcpkg PRIVATE stdc++fs)
+ else()
+ target_link_libraries(vcpkg PRIVATE c++fs)
+ endif()
endif()

if(MSVC)
14 changes: 14 additions & 0 deletions vcpkg_old/patches/oss/0002-vcpkg-dependencies-flags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake
index 70f224da..68d90470 100644
--- a/scripts/toolchains/linux.cmake
+++ b/scripts/toolchains/linux.cmake
@@ -17,6 +17,9 @@ if(NOT _CMAKE_IN_TRY_COMPILE)
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")

+ string(APPEND CMAKE_C_FLAGS_INIT " ${CMAKE_C_FLAGS} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " ${CMAKE_CXX_FLAGS} ")
+
string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
if(VCPKG_CRT_LINKAGE STREQUAL "static")
15 changes: 15 additions & 0 deletions vcpkg_old/patches/oss/0003-vcpkg-dependencies-sanitizer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake
index 68d90470..7508cd46 100644
--- a/scripts/toolchains/linux.cmake
+++ b/scripts/toolchains/linux.cmake
@@ -17,8 +17,8 @@ if(NOT _CMAKE_IN_TRY_COMPILE)
string(APPEND CMAKE_C_FLAGS_RELEASE_INIT " ${VCPKG_C_FLAGS_RELEASE} ")
string(APPEND CMAKE_CXX_FLAGS_RELEASE_INIT " ${VCPKG_CXX_FLAGS_RELEASE} ")

- string(APPEND CMAKE_C_FLAGS_INIT " ${CMAKE_C_FLAGS} ")
- string(APPEND CMAKE_CXX_FLAGS_INIT " ${CMAKE_CXX_FLAGS} ")
+ string(APPEND CMAKE_C_FLAGS_INIT " ${CMAKE_C_FLAGS} -fsanitize=$ENV{SANITIZER} ")
+ string(APPEND CMAKE_CXX_FLAGS_INIT " ${CMAKE_CXX_FLAGS} -fsanitize=$ENV{SANITIZER} ")

string(APPEND CMAKE_SHARED_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")
string(APPEND CMAKE_EXE_LINKER_FLAGS_INIT " ${VCPKG_LINKER_FLAGS} ")

0 comments on commit 850b9a3

Please sign in to comment.