Skip to content

Commit

Permalink
Bump deps versions (Speedb 2.8.0, Secp256k1 0.4.1, Ethash 1.0.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Lessa committed Feb 9, 2024
1 parent 14d2b81 commit 95a9cbd
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 54 deletions.
5 changes: 3 additions & 2 deletions cmake/ProjectBoostCertify.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include(ExternalProject)

if (MSVC)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
endif()

set(prefix "${CMAKE_BINARY_DIR}/deps")
Expand Down Expand Up @@ -37,3 +37,4 @@ set_property(TARGET Certify PROPERTY IMPORTED_CONFIGURATIONS Release)
set_property(TARGET Certify PROPERTY IMPORTED_LOCATION_RELEASE "${CERTIFY_LIBRARY}")
set_property(TARGET Certify PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CERTIFY_INCLUDE_DIR}")
add_dependencies(Certify certify ${CERTIFY_BYPRODUCTS})

51 changes: 26 additions & 25 deletions cmake/ProjectEthash.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
include(ExternalProject)

if (MSVC)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
endif()

set(prefix "${CMAKE_BINARY_DIR}/deps")
set(ETHASH_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}ethash${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(ETHASH_INCLUDE_DIR "${prefix}/include")
set(ETHASH_BYPRODUCTS "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}keccak${CMAKE_STATIC_LIBRARY_SUFFIX}")

set(ETHASH_VERSION "1.0.1")

ExternalProject_Add(
ethash
PREFIX "${prefix}"
DOWNLOAD_NAME ethash-v1.0.0.tar.gz
DOWNLOAD_NO_PROGRESS 1
URL https://github.com/chfast/ethash/archive/refs/tags/v1.0.0.tar.gz
URL_HASH SHA256=36071d9c4aaf3fd9e43155d7c2604404d6ab70613e6978cff964c5814f461a1a
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DETHASH_BUILD_TESTS=OFF
-DETHASH_BUILD_ETHASH=ON
-DCMAKE_INSTALL_LIBDIR=lib
${_only_release_configuration}
LOG_CONFIGURE 1
${_overwrite_install_command}
LOG_INSTALL 1
BUILD_BYPRODUCTS "${ETHASH_LIBRARY}"
BUILD_BYPRODUCTS "${ETHASH_BYPRODUCTS}"
ethash
PREFIX "${prefix}"
GIT_REPOSITORY https://github.com/chfast/ethash
GIT_TAG "v${ETHASH_VERSION}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
-DETHASH_BUILD_TESTS=OFF
-DETHASH_BUILD_ETHASH=ON
-DCMAKE_INSTALL_LIBDIR=lib
${_only_release_configuration}
LOG_CONFIGURE 1
${_overwrite_install_command}
LOG_INSTALL 1
BUILD_BYPRODUCTS "${ETHASH_LIBRARY}"
BUILD_BYPRODUCTS "${ETHASH_BYPRODUCTS}"
)

# Create imported library
add_library(Ethash STATIC IMPORTED)
file(MAKE_DIRECTORY "${ETHASH_INCLUDE_DIR}") # Must exist.
set_property(TARGET Ethash PROPERTY IMPORTED_CONFIGURATIONS Release)
set_property(TARGET Ethash PROPERTY IMPORTED_LOCATION_RELEASE "${ETHASH_LIBRARY}")
set_property(TARGET Ethash PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${ETHASH_INCLUDE_DIR}")
add_dependencies(Ethash ethash ${ETHASH_LIBRARY} ${ETHASH_BYPRODUCTS})

42 changes: 21 additions & 21 deletions cmake/ProjectSecp256k1.cmake
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
include(ExternalProject)

if (MSVC)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
set(_only_release_configuration -DCMAKE_CONFIGURATION_TYPES=Release)
set(_overwrite_install_command INSTALL_COMMAND cmake --build <BINARY_DIR> --config Release --target install)
endif()

set(prefix "${CMAKE_BINARY_DIR}/deps")
set(SECP256K1_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}secp256k1${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(SECP256K1_INCLUDE_DIR "${prefix}/include")

set(SECP256K1_VERSION "0.4.1")

ExternalProject_Add(
secp256k1
PREFIX "${prefix}"
DOWNLOAD_NAME secp256k1-ac8ccf29.tar.gz
DOWNLOAD_NO_PROGRESS 1
GIT_REPOSITORY https://github.com/bitcoin-core/secp256k1
GIT_TAG "bdf39000b9c6a0818e7149ccb500873d079e6e85"
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_LIST_DIR}/secp256k1/CMakeLists.txt <SOURCE_DIR>
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
${_only_release_configuration}
-DCMAKE_INSTALL_LIBDIR=lib
LOG_CONFIGURE 1
${_overwrite_install_command}
LOG_INSTALL 1
BUILD_BYPRODUCTS "${SECP256K1_LIBRARY}"
secp256k1
PREFIX "${prefix}"
GIT_REPOSITORY https://github.com/bitcoin-core/secp256k1
GIT_TAG "v${SECP256K1_VERSION}"
PATCH_COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_LIST_DIR}/secp256k1/CMakeLists.txt <SOURCE_DIR>
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}
${_only_release_configuration}
-DCMAKE_INSTALL_LIBDIR=lib
LOG_CONFIGURE 1
${_overwrite_install_command}
LOG_INSTALL 1
BUILD_BYPRODUCTS "${SECP256K1_LIBRARY}"
)

# Create imported library
Expand All @@ -38,3 +37,4 @@ set_property(TARGET Secp256k1 PROPERTY IMPORTED_CONFIGURATIONS Release)
set_property(TARGET Secp256k1 PROPERTY IMPORTED_LOCATION_RELEASE "${SECP256K1_LIBRARY}")
set_property(TARGET Secp256k1 PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SECP256K1_INCLUDE_DIR}")
add_dependencies(Secp256k1 secp256k1)

27 changes: 21 additions & 6 deletions cmake/ProjectSpeedb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,29 @@ set(prefix "${CMAKE_BINARY_DIR}/deps")
set(SPEEDB_LIBRARY "${prefix}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}speedb${CMAKE_STATIC_LIBRARY_SUFFIX}")
set(SPEEDB_INCLUDE_DIR "${prefix}/include")

set(SPEEDB_VERSION "2.8.0")

# Top: precompiled binary, bottom: compiled from source
# (Uncomment) either depending on the necessity

# TODO: doesn't work, fails compile with -fPIE related errors, try to fix this someday
#ExternalProject_Add(
# speedb
# PREFIX "${prefix}"
# URL https://github.com/speedb-io/speedb/releases/download/speedb/v${SPEEDB_VERSION}/speedb-${SPEEDB_VERSION}.tar.gz
# URL_HASH SHA256=b1d4ce4ec4d4f30e0d525c704a2079bfc15684043faf29e907eba519a7d7f930
# DOWNLOAD_NAME speedb-${SPEEDB_VERSION}.tar.gz
# DOWNLOAD_NO_PROGRESS 1
# CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E copy_directory "${prefix}/src/speedb/include/rocksdb" "${SPEEDB_INCLUDE_DIR}/rocksdb"
# BUILD_COMMAND ""
# INSTALL_COMMAND "${CMAKE_COMMAND}" -E copy "${prefix}/src/speedb/lib64/libspeedb.a" "${SPEEDB_LIBRARY}"
#)

ExternalProject_Add(
speedb
PREFIX "${prefix}"
DOWNLOAD_NAME speedb-2.4.1.tar.gz
DOWNLOAD_NO_PROGRESS 1
GIT_REPOSITORY https://github.com/speedb-io/speedb
GIT_TAG "speedb/v2.4.1"
#URL https://github.com/speedb-io/speedb/releases/download/speedb/v2.4.1/speedb-2.4.1.tar.gz
#URL_HASH SHA256=4e984515bbed0942d4ba22d8a219c752b0679d261a4baf7ac72c206f5ab1cd04
GIT_TAG "speedb/v${SPEEDB_VERSION}"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${prefix}
-DCMAKE_POSITION_INDEPENDENT_CODE=${BUILD_SHARED_LIBS}
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
Expand All @@ -37,7 +51,7 @@ ExternalProject_Add(
-DWITH_TRACE_TOOLS=OFF
${_overwrite_install_command}
BUILD_BYPRODUCTS "${SPEEDB_LIBRARY}"
UPDATE_COMMAND ""
UPDATE_COMMAND ""
)

# Create imported library
Expand All @@ -46,3 +60,4 @@ set_property(TARGET Speedb PROPERTY IMPORTED_CONFIGURATIONS Release)
set_property(TARGET Speedb PROPERTY IMPORTED_LOCATION_RELEASE "${SPEEDB_LIBRARY}")
set_property(TARGET Speedb PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SPEEDB_INCLUDE_DIR}")
add_dependencies(Speedb speedb SPEEDB_LIBRARY)

0 comments on commit 95a9cbd

Please sign in to comment.