early-access version 2853
This commit is contained in:
45
externals/vcpkg/ports/pbc/linux.patch
vendored
Executable file
45
externals/vcpkg/ports/pbc/linux.patch
vendored
Executable file
@@ -0,0 +1,45 @@
|
||||
--- configure.ac 2018-11-29 13:51:14.495012138 +0100
|
||||
+++ configure.ac 2018-11-29 13:51:45.308095312 +0100
|
||||
@@ -10,7 +10,6 @@
|
||||
LT_INIT
|
||||
#AC_CANONICAL_HOST
|
||||
|
||||
-CFLAGS=
|
||||
default_fink_path=/sw
|
||||
case $host_os in
|
||||
darwin*)
|
||||
@@ -78,20 +77,7 @@
|
||||
AC_PROG_MAKE_SET
|
||||
|
||||
AC_PROG_LEX
|
||||
-if test "x$LEX" != xflex; then
|
||||
- echo "************************"
|
||||
- echo "flex not found"
|
||||
- echo "************************"
|
||||
- exit -1
|
||||
-fi
|
||||
-
|
||||
AC_PROG_YACC
|
||||
-if test "x$YACC" != "xbison -y"; then
|
||||
- echo "************************"
|
||||
- echo "bison not found"
|
||||
- echo "************************"
|
||||
- exit -1
|
||||
-fi
|
||||
|
||||
# Checks for libraries.
|
||||
lib_err_msg="add its path to LDFLAGS\nsee ./configure --help"
|
||||
@@ -121,13 +134,6 @@
|
||||
|
||||
CFLAGS="$CFLAGS -Wall -W -Wfloat-equal -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wredundant-decls \
|
||||
-Wendif-labels -Wshadow -pipe -ffast-math -U__STRICT_ANSI__ -std=gnu99"
|
||||
-if test "$with_debug" == "y"; then
|
||||
- CFLAGS="$CFLAGS -g3 -O0"
|
||||
-elif test "$with_enable_optimized" != "no"; then
|
||||
- CFLAGS="$CFLAGS -g -O2"
|
||||
-else
|
||||
- CFLAGS="$CFLAGS -fomit-frame-pointer -O3"
|
||||
-fi
|
||||
|
||||
if test "$with_safe_clean" != "n"; then
|
||||
CFLAGS="$CFLAGS -DSAFE_CLEAN"
|
||||
113
externals/vcpkg/ports/pbc/portfile.cmake
vendored
Executable file
113
externals/vcpkg/ports/pbc/portfile.cmake
vendored
Executable file
@@ -0,0 +1,113 @@
|
||||
set(PBC_VERSION 0.5.14)
|
||||
|
||||
if(NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_download_distfile(
|
||||
ARCHIVE
|
||||
URLS "https://crypto.stanford.edu/pbc/files/pbc-${PBC_VERSION}.tar.gz"
|
||||
FILENAME pbc-${PBC_VERSION}.tar.gz
|
||||
SHA512 d75d4ceb3f67ee62c7ca41e2a91ee914fbffaeb70256675aed6734d586950ea8e64e2f16dc069d71481eddb703624df8d46497005fb58e75cf098dd7e7961333
|
||||
)
|
||||
|
||||
vcpkg_extract_source_archive_ex(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
ARCHIVE ${ARCHIVE}
|
||||
REF ${PBC_VERSION}
|
||||
PATCHES linux.patch
|
||||
)
|
||||
|
||||
vcpkg_find_acquire_program(BISON)
|
||||
vcpkg_find_acquire_program(FLEX)
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(SHARED_STATIC --enable-static --disable-shared)
|
||||
else()
|
||||
set(SHARED_STATIC --disable-static --enable-shared)
|
||||
endif()
|
||||
|
||||
set(OPTIONS ${SHARED_STATIC} LEX=${FLEX} YACC=${BISON}\ -y)
|
||||
|
||||
vcpkg_configure_make(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
AUTOCONFIG
|
||||
COPY_SOURCE
|
||||
OPTIONS
|
||||
${OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_install_make()
|
||||
|
||||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info)
|
||||
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
|
||||
else()
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO blynn/pbc
|
||||
REF fbf4589036ce4f662e2d06905862c9e816cf9d08
|
||||
SHA512 9348afd3866090b9fca189ae3a6bbb86c842b5f6ee7e1972f1a579993e589952c5926cb0795d4db1e647e3af263827e22c7602314c39bd97e03ffe9ad0fb48ab
|
||||
HEAD_REF master
|
||||
PATCHES windows.patch
|
||||
)
|
||||
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES "")
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES "")
|
||||
|
||||
find_path(MPIR_INCLUDE_DIR "gmp.h" HINTS ${CURRENT_INSTALLED_DIR} PATH_SUFFIXES include)
|
||||
if(NOT MPIR_INCLUDE_DIR)
|
||||
message(FATAL_ERROR "GMP includes not found")
|
||||
endif()
|
||||
|
||||
find_library(MPIR_LIBRARIES_REL NAMES "mpir.lib" HINTS ${CURRENT_INSTALLED_DIR} PATH_SUFFIXES lib)
|
||||
if(NOT MPIR_LIBRARIES_REL)
|
||||
message(FATAL_ERROR "mpir library not found")
|
||||
endif()
|
||||
|
||||
find_library(MPIR_LIBRARIES_DBG NAMES "mpir.lib" HINTS ${CURRENT_INSTALLED_DIR} PATH_SUFFIXES debug/lib)
|
||||
if(NOT MPIR_LIBRARIES_DBG)
|
||||
message(FATAL_ERROR "mpir debug library not found")
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(LibrarySuffix "lib")
|
||||
set(ConfigurationSuffix "")
|
||||
else()
|
||||
set(LibrarySuffix "dll")
|
||||
set(ConfigurationSuffix " DLL")
|
||||
endif()
|
||||
|
||||
if(VCPKG_CRT_LINKAGE STREQUAL "static")
|
||||
set(RuntimeLibraryExt "")
|
||||
else()
|
||||
set(RuntimeLibraryExt "DLL")
|
||||
endif()
|
||||
|
||||
if(TRIPLET_SYSTEM_ARCH STREQUAL "x86")
|
||||
set(Platform "Win32")
|
||||
else()
|
||||
set(Platform ${TRIPLET_SYSTEM_ARCH})
|
||||
endif()
|
||||
|
||||
# PBC expects mpir directory in build root
|
||||
get_filename_component(SOURCE_PATH_PARENT ${SOURCE_PATH} DIRECTORY)
|
||||
file(REMOVE_RECURSE ${SOURCE_PATH_PARENT}/mpir)
|
||||
file(MAKE_DIRECTORY ${SOURCE_PATH_PARENT}/mpir)
|
||||
file(GLOB FILES ${MPIR_INCLUDE_DIR}/gmp*.h)
|
||||
file(COPY ${FILES} ${MPIR_LIBRARIES_REL} DESTINATION "${SOURCE_PATH_PARENT}/mpir/${LibrarySuffix}/${Platform}/Release")
|
||||
file(COPY ${FILES} ${MPIR_LIBRARIES_DBG} DESTINATION "${SOURCE_PATH_PARENT}/mpir/${LibrarySuffix}/${Platform}/Debug")
|
||||
|
||||
get_filename_component(SOURCE_PATH_SUFFIX ${SOURCE_PATH} NAME)
|
||||
vcpkg_install_msbuild(SOURCE_PATH ${SOURCE_PATH_PARENT}
|
||||
PROJECT_SUBPATH ${SOURCE_PATH_SUFFIX}/pbcwin/projects/pbclib.vcxproj
|
||||
INCLUDES_SUBPATH ${SOURCE_PATH_SUFFIX}/include
|
||||
LICENSE_SUBPATH ${SOURCE_PATH_SUFFIX}/COPYING
|
||||
RELEASE_CONFIGURATION "Release${ConfigurationSuffix}"
|
||||
DEBUG_CONFIGURATION "Debug${ConfigurationSuffix}"
|
||||
OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}"
|
||||
OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}"
|
||||
OPTIONS /p:SolutionDir=../
|
||||
ALLOW_ROOT_INCLUDES ON
|
||||
)
|
||||
|
||||
# clean up mpir stuff
|
||||
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/mpir.lib ${CURRENT_PACKAGES_DIR}/debug/lib/mpir.lib)
|
||||
endif()
|
||||
18
externals/vcpkg/ports/pbc/vcpkg.json
vendored
Executable file
18
externals/vcpkg/ports/pbc/vcpkg.json
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "pbc",
|
||||
"version": "0.5.14",
|
||||
"port-version": 6,
|
||||
"description": "Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems.",
|
||||
"homepage": "https://crypto.stanford.edu/pbc",
|
||||
"supports": "!uwp & !arm",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "gmp",
|
||||
"platform": "!windows"
|
||||
},
|
||||
{
|
||||
"name": "mpir",
|
||||
"platform": "windows"
|
||||
}
|
||||
]
|
||||
}
|
||||
130
externals/vcpkg/ports/pbc/windows.patch
vendored
Executable file
130
externals/vcpkg/ports/pbc/windows.patch
vendored
Executable file
@@ -0,0 +1,130 @@
|
||||
diff --git "a/include/pbc_curve.h" "b/include/pbc_curve.h"
|
||||
--- "a/include/pbc_curve.h"
|
||||
+++ "b/include/pbc_curve.h"
|
||||
@@ -60,7 +60,9 @@
|
||||
|
||||
void field_curve_set_quotient_cmp(field_ptr c, mpz_t quotient_cmp);
|
||||
|
||||
+#ifdef __GNUC__
|
||||
#pragma GCC visibility push(hidden)
|
||||
+#endif
|
||||
// Internal:
|
||||
|
||||
element_ptr curve_x_coord(element_t e);
|
||||
@@ -74,6 +76,8 @@
|
||||
void curve_set_si(element_t R, long int x, long int y);
|
||||
void curve_set_gen_no_cofac(element_ptr a);
|
||||
|
||||
+#ifdef __GNUC__
|
||||
#pragma GCC visibility pop
|
||||
+#endif
|
||||
|
||||
#endif //__PBC_CURVE_H__
|
||||
diff --git "a/include/pbc_vc_compat.win32.h" "b/include/pbc_vc_compat.win32.h"
|
||||
index 27d3bba..7f772d4 100644
|
||||
--- "a/include/pbc_vc_compat.win32.h"
|
||||
+++ "b/include/pbc_vc_compat.win32.h"
|
||||
@@ -3,7 +3,3 @@
|
||||
#define __attribute__(X)
|
||||
#define inline
|
||||
#define __func__ __FUNCTION__
|
||||
-
|
||||
-#define NULL 0
|
||||
-
|
||||
-#define snprintf _snprintf
|
||||
\ No newline at end of file
|
||||
diff --git "a/pbcwin/projects/pbclib.vcxproj" "b/pbcwin/projects/pbclib.vcxproj"
|
||||
index f0a9b3f..507c24d 100644
|
||||
--- "a/pbcwin/projects/pbclib.vcxproj"
|
||||
+++ "b/pbcwin/projects/pbclib.vcxproj"
|
||||
@@ -214,13 +214,13 @@ <?xml version="1.0" encoding="utf-8"?>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<IncludePath>$(SolutionDir)..\include;$(SolutionDir)..;$(SolutionDir)..\..\mpir\lib\$(Platform)\Release;$(IncludePath)</IncludePath>
|
||||
- <LibraryPath>$(SolutionDir)..\..\mpir\lib\x64\Release;$(LibraryPath)</LibraryPath>
|
||||
+ <LibraryPath>$(SolutionDir)..\..\mpir\lib\$(Platform)\Release;$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)lib\$(Platform)\Release\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
- <IncludePath>$(SolutionDir)..\include;$(SolutionDir)..;$(SolutionDir)..\..\mpir\lib\x64\Release;$(IncludePath)</IncludePath>
|
||||
- <LibraryPath>$(SolutionDir)..\..\mpir\lib\x64\Release;$(LibraryPath)</LibraryPath>
|
||||
+ <IncludePath>$(SolutionDir)..\include;$(SolutionDir)..;$(SolutionDir)..\..\mpir\lib\$(Platform)\Release;$(IncludePath)</IncludePath>
|
||||
+ <LibraryPath>$(SolutionDir)..\..\mpir\lib\$(Platform)\Release;$(LibraryPath)</LibraryPath>
|
||||
<OutDir>$(SolutionDir)lib\$(Platform)\Release\</OutDir>
|
||||
<IntDir>$(SolutionDir)obj\$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
|
||||
</PropertyGroup>
|
||||
@@ -245,7 +245,8 @@ <?xml version="1.0" encoding="utf-8"?>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -275,7 +276,8 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
+ <DebugInformationFormat>OldStyle</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -305,7 +307,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -332,7 +334,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -361,7 +363,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -395,7 +397,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -429,7 +431,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
@@ -460,7 +462,7 @@ echo ***************************************************************************
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>pbc_vc_compat.win32.h</ForcedIncludeFiles>
|
||||
<DisableSpecificWarnings>4068</DisableSpecificWarnings>
|
||||
- <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
+ <RuntimeLibrary>$(RuntimeLibrary)</RuntimeLibrary>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
Reference in New Issue
Block a user