mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-23 11:07:10 +01:00
Port (cmake) for secp256k1 crypto project.
This commit is contained in:
parent
2b41ebc759
commit
fc80d72089
26
ports/secp256k1/CMakeLists.txt
Normal file
26
ports/secp256k1/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(secp256k1 C)
|
||||
|
||||
option(INSTALL_HEADERS "Install header files" ON)
|
||||
|
||||
add_definitions(
|
||||
-DENABLE_MODULE_ECDH
|
||||
-DENABLE_MODULE_RECOVERY
|
||||
-DHAVE_CONFIG_H
|
||||
)
|
||||
|
||||
file(GLOB SOURCES src/secp256k1.c)
|
||||
add_library(secp256k1 ${SOURCES})
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
install(TARGETS secp256k1
|
||||
RUNTIME DESTINATION bin
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
)
|
||||
|
||||
if(INSTALL_HEADERS)
|
||||
file(GLOB HEADERS include/*.h)
|
||||
install(FILES ${HEADERS} DESTINATION include)
|
||||
endif()
|
3
ports/secp256k1/CONTROL
Normal file
3
ports/secp256k1/CONTROL
Normal file
@ -0,0 +1,3 @@
|
||||
Source: secp256k1
|
||||
Version:
|
||||
Description: Optimized C library for EC operations on curve
|
29
ports/secp256k1/libsecp256k1-config.h
Normal file
29
ports/secp256k1/libsecp256k1-config.h
Normal file
@ -0,0 +1,29 @@
|
||||
/**********************************************************************
|
||||
* Copyright (c) 2013, 2014 Pieter Wuille *
|
||||
* Distributed under the MIT software license, see the accompanying *
|
||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.*
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef SECP256K1_BASIC_CONFIG_H
|
||||
#define SECP256K1_BASIC_CONFIG_H
|
||||
|
||||
#undef USE_ASM_X86_64
|
||||
#undef USE_ENDOMORPHISM
|
||||
#undef USE_FIELD_10X26
|
||||
#undef USE_FIELD_5X52
|
||||
#undef USE_FIELD_INV_BUILTIN
|
||||
#undef USE_FIELD_INV_NUM
|
||||
#undef USE_NUM_GMP
|
||||
#undef USE_NUM_NONE
|
||||
#undef USE_SCALAR_4X64
|
||||
#undef USE_SCALAR_8X32
|
||||
#undef USE_SCALAR_INV_BUILTIN
|
||||
#undef USE_SCALAR_INV_NUM
|
||||
|
||||
#define USE_NUM_NONE 1
|
||||
#define USE_FIELD_INV_BUILTIN 1
|
||||
#define USE_SCALAR_INV_BUILTIN 1
|
||||
#define USE_FIELD_10X26 1
|
||||
#define USE_SCALAR_8X32 1
|
||||
|
||||
#endif /* SECP256K1_BASIC_CONFIG_H */
|
31
ports/secp256k1/portfile.cmake
Normal file
31
ports/secp256k1/portfile.cmake
Normal file
@ -0,0 +1,31 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/secp256k1-0b7024185045a49a1a6a4c5615bf31c94f63d9c4/)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH "secp256k1"
|
||||
REPO "bitcoin-core/secp256k1"
|
||||
REF "0b7024185045a49a1a6a4c5615bf31c94f63d9c4"
|
||||
SHA512 54e0c446ae63105800dfaf23dc934734f196c91f275db0455e58a36926c29ecc51a13d9b1eb2e45bc86199120c3c472ec7b39086787a49ce388a4df462a870bc
|
||||
)
|
||||
|
||||
message("Copying config header to " ${SOURCE_PATH})
|
||||
|
||||
file(COPY ${CURRENT_PORT_DIR}/libsecp256k1-config.h DESTINATION ${SOURCE_PATH})
|
||||
|
||||
message(STATUS "Building")
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS_DEBUG
|
||||
-DINSTALL_HEADERS=OFF
|
||||
OPTIONS_DEBUG
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
# Handle copyright
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/secp256k1 RENAME copyright)
|
Loading…
x
Reference in New Issue
Block a user