[mpir] Fix download REF and HASH (#23330)

* [mpir] Fix download REF and HASH

* version

* Unify repo under all architectures, format code

* version

* change to version-date

* version
This commit is contained in:
Jack·Boos·Yu 2022-03-03 06:50:21 +08:00 committed by GitHub
parent 59a3e1a39e
commit 1ac50ccd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 53 additions and 65 deletions

View File

@ -6,31 +6,25 @@ if(VCPKG_CRT_LINKAGE STREQUAL "static" AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynam
message(FATAL_ERROR "${PORT} currently can only be built using the dynamic CRT when building DLLs")
endif()
set(MPIR_VERSION 3.0.0)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wbhart/mpir
REF cdd444aedfcbb190f00328526ef278428702d56e # 3.0.0
SHA512 f46e45bdba27c9f89953ba23186b694486fd3010bd370ea2de71a4649a2816e716a6520c9baa96936f1884437ef03f92b21c0b1fb5b757beba5a05fed30b2bfc
HEAD_REF master
PATCHES enable-runtimelibrary-toggle.patch
)
if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
vcpkg_download_distfile(
ARCHIVE
URLS "http://mpir.org/mpir-${MPIR_VERSION}.tar.bz2"
FILENAME mpir-${MPIR_VERSION}.tar.bz2
SHA512 c735105db8b86db739fd915bf16064e6bc82d0565ad8858059e4e93f62c9d72d9a1c02a5ca9859b184346a8dc64fa714d4d61404cff1e405dc548cbd54d0a88e
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
REF ${MPIR_VERSION}
)
vcpkg_find_acquire_program(YASM)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(SHARED_STATIC --enable-static --disable-shared)
set(SHARED_STATIC "--enable-static --disable-shared")
else()
set(SHARED_STATIC --disable-static --enable-shared)
set(SHARED_STATIC "--disable-static --enable-shared")
endif()
set(OPTIONS --disable-silent-rules --enable-gmpcompat --enable-cxx ${SHARED_STATIC})
set(OPTIONS "--disable-silent-rules --enable-gmpcompat --enable-cxx ${SHARED_STATIC}")
string(APPEND VCPKG_C_FLAGS " -Wno-implicit-function-declaration")
string(APPEND VCPKG_CXX_FLAGS " -Wno-implicit-function-declaration")
@ -41,7 +35,7 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
endif()
vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
SOURCE_PATH "${SOURCE_PATH}"
${AUTOCONFIG}
OPTIONS ${OPTIONS}
)
@ -49,22 +43,11 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX)
vcpkg_install_make()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
endif()
configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
elseif(VCPKG_TARGET_IS_WINDOWS)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wbhart/mpir
REF mpir-${MPIR_VERSION}
SHA512 7d37f60645c533a6638dde5d9c48f5535022fa0ea02bafd5b714649c70814e88c5e5e3b0bef4c5a749aaf8772531de89c331716ee00ba1c2f9521c2cc8f3c61b
HEAD_REF master
PATCHES enable-runtimelibrary-toggle.patch
)
if(VCPKG_PLATFORM_TOOLSET MATCHES "v141")
set(MSVC_VERSION 15)
else()
@ -83,69 +66,69 @@ elseif(VCPKG_TARGET_IS_WINDOWS)
set(RuntimeLibraryExt "DLL")
endif()
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
file(GLOB FILES ${SOURCE_PATH}/*)
file(COPY ${FILES} DESTINATION ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET})
file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
file(GLOB FILES "${SOURCE_PATH}/*")
file(COPY ${FILES} DESTINATION "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}")
vcpkg_build_msbuild(
PROJECT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/build.vc${MSVC_VERSION}/${DLL_OR_LIB}_mpir_gc/${DLL_OR_LIB}_mpir_gc.vcxproj
PROJECT_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/build.vc${MSVC_VERSION}/${DLL_OR_LIB}_mpir_gc/${DLL_OR_LIB}_mpir_gc.vcxproj"
OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}"
OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}"
)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_build_msbuild(
PROJECT_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/build.vc${MSVC_VERSION}/${DLL_OR_LIB}_mpir_cxx/${DLL_OR_LIB}_mpir_cxx.vcxproj
PROJECT_PATH "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/build.vc${MSVC_VERSION}/${DLL_OR_LIB}_mpir_cxx/${DLL_OR_LIB}_mpir_cxx.vcxproj"
OPTIONS_DEBUG "/p:RuntimeLibrary=MultiThreadedDebug${RuntimeLibraryExt}"
OPTIONS_RELEASE "/p:RuntimeLibrary=MultiThreaded${RuntimeLibraryExt}"
)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(GLOB REL_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib)
file(GLOB REL_LIBS_CXX "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.lib")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(GLOB DBG_LIBS_CXX ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib)
file(GLOB DBG_LIBS_CXX "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.lib")
endif()
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(GLOB HEADERS
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmp.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/gmpxx.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpirxx.h"
)
file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL ${HEADERS} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(GLOB REL_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll)
file(GLOB REL_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib)
file(GLOB REL_DLLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.dll")
file(GLOB REL_LIBS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Release/mpir.lib")
list(APPEND REL_LIBS ${REL_LIBS_CXX})
file(INSTALL ${REL_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
file(INSTALL ${REL_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
file(INSTALL ${REL_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(INSTALL ${REL_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(GLOB HEADERS
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmp.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmpxx.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.h
${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.h
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmp.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/gmpxx.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.h"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpirxx.h"
)
file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
file(INSTALL ${HEADERS} DESTINATION "${CURRENT_PACKAGES_DIR}/include")
file(GLOB DBG_DLLS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll)
file(GLOB DBG_LIBS ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib)
file(GLOB DBG_DLLS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.dll")
file(GLOB DBG_LIBS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}/*/*/Debug/mpir.lib")
list(APPEND DBG_LIBS ${DBG_LIBS_CXX})
file(INSTALL ${DBG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
file(INSTALL ${DBG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL ${DBG_DLLS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(INSTALL ${DBG_LIBS} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
endif()
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/COPYING.lib DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
endif()
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -1,8 +1,8 @@
{
"name": "mpir",
"version": "3.0.0",
"port-version": 11,
"version-date": "2022-03-02",
"description": "Multiple Precision Integers and Rationals",
"homepage": "https://github.com/wbhart/mpir",
"license": "GPL-3.0-only",
"supports": "!(uwp | arm)"
}

View File

@ -4581,8 +4581,8 @@
"port-version": 2
},
"mpir": {
"baseline": "3.0.0",
"port-version": 11
"baseline": "2022-03-02",
"port-version": 0
},
"mpmcqueue": {
"baseline": "2019-07-26",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "5358d4a724061eab499969ae3b56f8abbdea3347",
"version-date": "2022-03-02",
"port-version": 0
},
{
"git-tree": "8aabcec72d2006d0a338159fac489aae1da57220",
"version": "3.0.0",