Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 17 additions & 27 deletions ports/mpir/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,31 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO wbhart/mpir
REF cdd444aedfcbb190f00328526ef278428702d56e # 3.0.0
REF cdd444aedfcbb190f00328526ef278428702d56e # tag: mpir-3.0.0
SHA512 f46e45bdba27c9f89953ba23186b694486fd3010bd370ea2de71a4649a2816e716a6520c9baa96936f1884437ef03f92b21c0b1fb5b757beba5a05fed30b2bfc
HEAD_REF master
PATCHES
enable-runtimelibrary-toggle.patch
fix-static-include-files.patch
subdirs.diff
vcpkg-cross-builds.diff
)

if(NOT VCPKG_TARGET_IS_WINDOWS)
if(NOT VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_MINGW)
vcpkg_find_acquire_program(YASM)

set(SHARED_STATIC --disable-static --enable-shared)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(SHARED_STATIC --enable-static --disable-shared --with-pic)
endif()

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")

# on Linux, autoconf is required; on macOS, it isn't
if(VCPKG_TARGET_IS_LINUX)
set(AUTOCONFIG "AUTOCONFIG")
endif()

vcpkg_configure_make(
vcpkg_make_configure(
SOURCE_PATH "${SOURCE_PATH}"
${AUTOCONFIG}
OPTIONS ${OPTIONS}
AUTORECONF
OPTIONS
--enable-cxx
--enable-gmpcompat
--with-pic
"--with-yasm=${YASM}"
"CFLAGS=\$CFLAGS -Wno-implicit-function-declaration"
"CCAS=" # use default $CC -c
)
vcpkg_install_make()
vcpkg_make_install()
else()
set(MSVC_VERSION 14)
if(VCPKG_PLATFORM_TOOLSET MATCHES "v14(1|2|3)")
Expand Down Expand Up @@ -72,12 +65,9 @@ else()
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/COPYING.LIB" "${CURRENT_PACKAGES_DIR}/debug/lib/COPYING.LIB")
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING" "${SOURCE_PATH}/COPYING.LIB")
15 changes: 15 additions & 0 deletions ports/mpir/subdirs.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/Makefile.am b/Makefile.am
index 6565654..554ed17 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -100,9 +100,8 @@ LIBGMPXX_LT_CURRENT = 12
LIBGMPXX_LT_REVISION = 3
LIBGMPXX_LT_AGE = 4

-SUBDIRS = tests

-SUBDIRS += mpn fft mpz mpq mpf printf scanf cxx tune doc
+SUBDIRS = mpn fft mpz mpq mpf printf scanf cxx tune

EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf

26 changes: 26 additions & 0 deletions ports/mpir/vcpkg-cross-builds.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
diff --git a/configure.ac b/configure.ac
index 5b363fb..cf8fdc5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1718,11 +1718,21 @@ GMP_H_ANSI


# The C compiler on the build system, and associated tests.
+if test "$cross_compiling" == "no" ; then
+# native build, native tools
GMP_PROG_CC_FOR_BUILD
GMP_PROG_CPP_FOR_BUILD
GMP_PROG_EXEEXT_FOR_BUILD
GMP_C_FOR_BUILD_ANSI
GMP_CHECK_LIBM_FOR_BUILD
+else
+# cross build, <TOOL>_FOR_BUILD disabled by vcpkg
+AC_SUBST(CC_FOR_BUILD,"false")
+AC_SUBST(CPP_FOR_BUILD,"false")
+AC_SUBST(EXEEXT_FOR_BUILD,"")
+AC_SUBST(U_FOR_BUILD,"")
+AC_SUBST(LIBM_FOR_BUILD,"")
+fi

# How to assemble, used with CFLAGS etc, see mpn/Makeasm.am.
# Using the compiler is a lot easier than figuring out how to invoke the
11 changes: 8 additions & 3 deletions ports/mpir/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"name": "mpir",
"version-date": "2022-03-02",
"port-version": 3,
"version": "3.0.0",
"port-version": 12,
"description": "Multiple Precision Integers and Rationals",
"homepage": "https://github.com/wbhart/mpir",
"license": null,
"supports": "!(uwp | arm)",
"dependencies": [
{
"name": "vcpkg-make",
"host": true,
"platform": "!windows | mingw"
},
{
"name": "vcpkg-msbuild",
"host": true,
"platform": "windows"
"platform": "windows & !mingw"
}
]
}
1 change: 1 addition & 0 deletions scripts/ci.feature.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ moos-essential:arm64-windows=fail
moos-essential:x64-windows-static-md=fail
moos-essential:x64-windows=fail
moos-essential:x86-windows=fail
mpir:x64-android=fail
msquic(android)=fail
nana:x64-linux=fail
nana:x64-uwp=fail
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6593,8 +6593,8 @@
"port-version": 5
},
"mpir": {
"baseline": "2022-03-02",
"port-version": 3
"baseline": "3.0.0",
"port-version": 12
},
"mpmcqueue": {
"baseline": "2021-12-01",
Expand Down
5 changes: 5 additions & 0 deletions versions/m-/mpir.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "71d08b7432c6eb9631acbddb9debf3c1a0ec9be4",
"version": "3.0.0",
"port-version": 12
},
{
"git-tree": "66630c57080280e1089146536f7d5d21c7504600",
"version-date": "2022-03-02",
Expand Down