aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Christensen <philc@microsoft.com>2018-12-06 16:25:37 -0800
committerPhil Christensen <philc@microsoft.com>2018-12-06 16:25:37 -0800
commitd2448e0a950ec7a32798f3882dec4a9291d0537b (patch)
tree19104fe61a620ed45abbe78730982e2b359a5aeb
parent89de5f705e199ad4c5b230902aa0d87dec94206c (diff)
parent63c1b2628e958f8e02356411f032941c0c2f3bbb (diff)
downloadvcpkg-d2448e0a950ec7a32798f3882dec4a9291d0537b.tar.gz
vcpkg-d2448e0a950ec7a32798f3882dec4a9291d0537b.zip
Merge branch 'master' of https://github.com/microsoft/vcpkg into dev/philc/4912
-rw-r--r--ports/ogre/001-cmake-install-dir.patch16
-rw-r--r--ports/ogre/002-link-optimized-lib-workaround.patch37
-rw-r--r--ports/ogre/CONTROL2
-rw-r--r--ports/ogre/portfile.cmake66
-rw-r--r--ports/pbc/CONTROL4
-rw-r--r--ports/pbc/linux.patch45
-rw-r--r--ports/pbc/portfile.cmake153
-rw-r--r--ports/pbc/windows.patch108
8 files changed, 385 insertions, 46 deletions
diff --git a/ports/ogre/001-cmake-install-dir.patch b/ports/ogre/001-cmake-install-dir.patch
index 27c6d2f70..548f946f7 100644
--- a/ports/ogre/001-cmake-install-dir.patch
+++ b/ports/ogre/001-cmake-install-dir.patch
@@ -1,5 +1,5 @@
---- a/cmake/CMakeLists.txt
-+++ b/cmake/CMakeLists.txt
+--- a/CMake/CMakeLists.txt
++++ b/CMake/CMakeLists.txt
@@ -13,10 +13,12 @@
# directory, but can also be used for custom projects.
#############################################################
@@ -8,7 +8,7 @@
- set(OGRE_CMAKE_DIR "CMake")
-else()
- set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
-+if (NOT DEFINED OGRE_CMAKE_DIR)
++if(NOT DEFINED OGRE_CMAKE_DIR)
+ if(WIN32 OR APPLE)
+ set(OGRE_CMAKE_DIR "CMake")
+ else()
@@ -16,10 +16,10 @@
+ endif()
endif()
- set(INST_FILES
---- a/cmake/InstallResources.cmake
-+++ b/cmake/InstallResources.cmake
-@@ -241,10 +241,12 @@ endif ()
+ set(INST_FILES Utils/FindPkgMacros.cmake)
+--- a/CMake/InstallResources.cmake
++++ b/CMake/InstallResources.cmake
+@@ -242,10 +242,12 @@
# Create the CMake package files
include(CMakePackageConfigHelpers)
@@ -27,7 +27,7 @@
- set(OGRE_CMAKE_DIR "CMake")
-else()
- set(OGRE_CMAKE_DIR "${OGRE_LIB_DIRECTORY}/OGRE/cmake")
-+if (NOT DEFINED OGRE_CMAKE_DIR)
++if(NOT DEFINED OGRE_CMAKE_DIR)
+ if(WIN32 OR APPLE)
+ set(OGRE_CMAKE_DIR "CMake")
+ else()
diff --git a/ports/ogre/002-link-optimized-lib-workaround.patch b/ports/ogre/002-link-optimized-lib-workaround.patch
new file mode 100644
index 000000000..b2678f488
--- /dev/null
+++ b/ports/ogre/002-link-optimized-lib-workaround.patch
@@ -0,0 +1,37 @@
+--- a/CMake/Dependencies.cmake
++++ b/CMake/Dependencies.cmake
+@@ -199,6 +199,11 @@
+ # Find zlib
+ find_package(ZLIB)
+ macro_log_feature(ZLIB_FOUND "zlib" "Simple data compression library" "http://www.zlib.net" FALSE "" "")
++# replace optimized/debug keyword with generator expression
++unset(ZLIB_LIBRARY)
++set(ZLIB_LIBRARY $<$<CONFIG:Release>:${ZLIB_LIBRARY_RELEASE}> $<$<CONFIG:Debug>:${ZLIB_LIBRARY_DEBUG}>)
++unset(ZLIB_LIBRARIES)
++set(ZLIB_LIBRARIES ${ZLIB_LIBRARY})
+
+ if (ZLIB_FOUND)
+ # Find zziplib
+@@ -213,6 +218,11 @@
+ # Find FreeType
+ find_package(Freetype)
+ macro_log_feature(FREETYPE_FOUND "freetype" "Portable font engine" "http://www.freetype.org" FALSE "" "")
++# replace optimized/debug keyword with generator expression
++unset(FREETYPE_LIBRARY)
++set(FREETYPE_LIBRARY $<$<CONFIG:Release>:${FREETYPE_LIBRARY_RELEASE}> $<$<CONFIG:Debug>:${FREETYPE_LIBRARY_DEBUG}>)
++unset(FREETYPE_LIBRARIES)
++set(FREETYPE_LIBRARIES ${FREETYPE_LIBRARY})
+
+ # Find X11
+ if (UNIX AND NOT APPLE AND NOT ANDROID AND NOT EMSCRIPTEN)
+--- src.orig/CMake/Utils/FindPkgMacros.cmake
++++ src.new/CMake/Utils/FindPkgMacros.cmake
+@@ -82,7 +82,7 @@
+ if (${PREFIX}_FWK)
+ set(${PREFIX} ${${PREFIX}_FWK})
+ elseif (${PREFIX}_REL AND ${PREFIX}_DBG)
+- set(${PREFIX} optimized ${${PREFIX}_REL} debug ${${PREFIX}_DBG})
++ set(${PREFIX} $<$<CONFIG:Release>:${${PREFIX}_REL}> $<$<CONFIG:Debug>:${${PREFIX}_DBG}>)
+ elseif (${PREFIX}_REL)
+ set(${PREFIX} ${${PREFIX}_REL})
+ elseif (${PREFIX}_DBG)
diff --git a/ports/ogre/CONTROL b/ports/ogre/CONTROL
index f7d93e7b2..288e558e9 100644
--- a/ports/ogre/CONTROL
+++ b/ports/ogre/CONTROL
@@ -1,5 +1,5 @@
Source: ogre
-Version: 1.10.11
+Version: 1.11.3-3
Build-Depends: freeimage, freetype, zlib, zziplib
Description: 3D Object-Oriented Graphics Rendering Engine
diff --git a/ports/ogre/portfile.cmake b/ports/ogre/portfile.cmake
index 8281960c6..74cb8a1c0 100644
--- a/ports/ogre/portfile.cmake
+++ b/ports/ogre/portfile.cmake
@@ -3,15 +3,12 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO OGRECave/ogre
- REF v1.10.11
- SHA512 2dfedd6f0a0de1a8c687c001439138b233200ca11e5c9940debf43d8a0380ca6472e0b5f4d599f0e22ca2049d0a5d34066ef41b6bc4912130694fa5d851fc900
+ REF v1.11.3
+ SHA512 af52821022ab6148e64fdf183b1aa4607b101c7d0edc20d2ccc909f50eed218d7a283fa3b58260fd41cd3f324ecafad8c5137c66e05786580b043240551b2c42
HEAD_REF master
-)
-
-vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
PATCHES
- "${CMAKE_CURRENT_LIST_DIR}/001-cmake-install-dir.patch"
+ 001-cmake-install-dir.patch
+ 002-link-optimized-lib-workaround.patch
)
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
@@ -58,10 +55,7 @@ vcpkg_configure_cmake(
-DOGRE_INSTALL_CMAKE=ON
-DOGRE_INSTALL_VSPROPS=OFF
-DOGRE_STATIC=${OGRE_STATIC}
- -DOGRE_UNITY_BUILD=OFF
- -DOGRE_USE_STD11=ON
-DOGRE_CONFIG_THREAD_PROVIDER=std
- -DOGRE_NODE_STORAGE_LEGACY=OFF
-DOGRE_BUILD_RENDERSYSTEM_D3D11=ON
-DOGRE_BUILD_RENDERSYSTEM_GL=ON
-DOGRE_BUILD_RENDERSYSTEM_GL3PLUS=ON
@@ -95,33 +89,31 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
-file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link ${CURRENT_PACKAGES_DIR}/lib/manual-link)
-
-file(GLOB MAIN_REL ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib)
-file(COPY ${MAIN_REL} DESTINATION ${CURRENT_PACKAGES_DIR}/lib/manual-link)
-file(GLOB MAIN_DBG ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib)
-file(COPY ${MAIN_DBG} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
-file(REMOVE ${MAIN_REL} ${MAIN_DBG})
-
-# Ogre installs custom cmake config files which don't follow the normal pattern.
-# This normally makes them completely incompatible with multi-config generators, but with some effort it can be done.
-file(READ "${CURRENT_PACKAGES_DIR}/share/ogre/OGREConfig.cmake" _contents)
-string(REPLACE "${CURRENT_INSTALLED_DIR}" "\${PACKAGE_PREFIX_DIR}" _contents "${_contents}")
-string(REPLACE "SDL2main.lib" "SDL2main$<$<CONFIG:Debug>:d>.lib" _contents "${_contents}")
-string(REPLACE "SDL2.lib" "SDL2$<$<CONFIG:Debug>:d>.lib" _contents "${_contents}")
-string(REPLACE "\${PACKAGE_PREFIX_DIR}/lib" "\${PACKAGE_PREFIX_DIR}$<$<CONFIG:Debug>:/debug>/lib" _contents "${_contents}")
-string(REPLACE "{OGRE_PREFIX_DIR}/lib" "{OGRE_PREFIX_DIR}$<$<CONFIG:Debug>:/debug>/lib" _contents "${_contents}")
-
-string(REPLACE "\"Ogre\${COMPONENT}\"" "\"Ogre\${COMPONENT}$<$<CONFIG:Debug>:_d>\"" _contents "${_contents}")
-string(REPLACE "\"Ogre\${COMPONENT}Static\"" "\"Ogre\${COMPONENT}Static$<$<CONFIG:Debug>:_d>\"" _contents "${_contents}")
-
-string(REPLACE "\"\${TYPE}_\${COMPONENT}\"" "\"\${TYPE}_\${COMPONENT}$<$<CONFIG:Debug>:_d>\"" _contents "${_contents}")
-string(REPLACE "\"\${TYPE}_\${COMPONENT}Static\"" "\"\${TYPE}_\${COMPONENT}Static$<$<CONFIG:Debug>:_d>\"" _contents "${_contents}")
-
-string(REPLACE "\"OgreMain\"" "\"\${PACKAGE_PREFIX_DIR}/lib/manual-link/OgreMain$<$<CONFIG:Debug>:_d>.lib\"" _contents "${_contents}")
-string(REPLACE "\"OgreMainStatic\"" "\"\${PACKAGE_PREFIX_DIR}/lib/manual-link/OgreMainStatic$<$<CONFIG:Debug>:_d>.lib\"" _contents "${_contents}")
-
-file(WRITE "${CURRENT_PACKAGES_DIR}/share/ogre/OGREConfig.cmake" "${_contents}")
+if(NOT VCPKG_CMAKE_SYSTEM_NAME)
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMain.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib)
+ else()
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/OgreMainStatic.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib)
+ endif()
+ endif()
+ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
+ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMain_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib)
+ else()
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/OgreMainStatic_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMainStatic_d.lib)
+ endif()
+ endif()
+
+ file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/ogre/*.cmake)
+ foreach(SHARE_FILE ${SHARE_FILES})
+ file(READ "${SHARE_FILE}" _contents)
+ string(REPLACE "lib/OgreMain" "lib/manual-link/OgreMain" _contents "${_contents}")
+ file(WRITE "${SHARE_FILE}" "${_contents}")
+ endforeach()
+endif()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/ogre RENAME copyright)
diff --git a/ports/pbc/CONTROL b/ports/pbc/CONTROL
new file mode 100644
index 000000000..a8ee10486
--- /dev/null
+++ b/ports/pbc/CONTROL
@@ -0,0 +1,4 @@
+Source: pbc
+Version: 0.5.14
+Build-Depends: mpir
+Description: Pairing-Based Crypto library provides low-level routines for pairing-based cryptosystems.
diff --git a/ports/pbc/linux.patch b/ports/pbc/linux.patch
new file mode 100644
index 000000000..198277739
--- /dev/null
+++ b/ports/pbc/linux.patch
@@ -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"
diff --git a/ports/pbc/portfile.cmake b/ports/pbc/portfile.cmake
new file mode 100644
index 000000000..32e233420
--- /dev/null
+++ b/ports/pbc/portfile.cmake
@@ -0,0 +1,153 @@
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ message(FATAL_ERROR "PBC currently can only be built for desktop")
+endif()
+
+if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
+ message(FATAL_ERROR "PBC currently can only be built using the dynamic CRT when building DLLs")
+endif()
+
+set(PBC_VERSION 0.5.14)
+
+if(VCPKG_CMAKE_SYSTEM_NAME)
+ 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_execute_required_process(
+ COMMAND ${SOURCE_PATH}/setup
+ WORKING_DIRECTORY ${SOURCE_PATH}
+ LOGNAME setup-${TARGET_TRIPLET}
+ )
+
+ file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
+ file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
+ message(STATUS "Configuring ${TARGET_TRIPLET}-dbg")
+ set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -O0 -g -I${SOURCE_PATH}/include")
+ set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}")
+ vcpkg_execute_required_process(
+ COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR}/debug ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}/debug
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
+ LOGNAME configure-${TARGET_TRIPLET}-dbg
+ )
+ message(STATUS "Building ${TARGET_TRIPLET}-dbg")
+ vcpkg_execute_required_process(
+ COMMAND make -j install
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg
+ LOGNAME install-${TARGET_TRIPLET}-dbg
+ )
+
+ file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
+ file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
+ message(STATUS "Configuring ${TARGET_TRIPLET}-rel")
+ set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -O3 -I${SOURCE_PATH}/include")
+ set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}")
+ vcpkg_execute_required_process(
+ COMMAND ${SOURCE_PATH}/configure --prefix=${CURRENT_PACKAGES_DIR} ${OPTIONS} --with-sysroot=${CURRENT_INSTALLED_DIR}
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
+ LOGNAME configure-${TARGET_TRIPLET}-rel
+ )
+ message(STATUS "Building ${TARGET_TRIPLET}-rel")
+ vcpkg_execute_required_process(
+ COMMAND make -j install
+ WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
+ LOGNAME install-${TARGET_TRIPLET}-rel
+ )
+
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share ${CURRENT_PACKAGES_DIR}/share/info)
+ configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/pbc/copyright COPYONLY)
+else()
+ 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()
diff --git a/ports/pbc/windows.patch b/ports/pbc/windows.patch
new file mode 100644
index 000000000..5b790767a
--- /dev/null
+++ b/ports/pbc/windows.patch
@@ -0,0 +1,108 @@
+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>