Skip to content

Commit

Permalink
[libidn2] Update to 2.3.7 [libgnutls] Fix android (microsoft#37196)
Browse files Browse the repository at this point in the history
libidn2: Enable android support.

libgnutls: CCAS defaults to CC, but CCASFLAGS would lack what we move to
CPPFLAGS.

---------

Co-authored-by: Monica <[email protected]>
Co-authored-by: Billy Robert O'Neal III <[email protected]>
  • Loading branch information
3 people authored May 29, 2024
1 parent dee924d commit c0cb041
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 85 deletions.
23 changes: 23 additions & 0 deletions ports/libgnutls/ccasflags.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/configure.ac b/configure.ac
index d6f283a..77e5a56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -40,6 +40,8 @@ AC_PROG_CC
gl_EARLY
ggl_EARLY
unistring_EARLY
+# Override AM_PROG_AS default
+test "${CCASFLAGS+set}" = set || CCASFLAGS="$CPPFLAGS $CFLAGS"
AM_PROG_AS
AM_PROG_AR
AC_PROG_CXX
@@ -243,7 +245,8 @@ if test "$hw_accel" = aarch64; then
AARCH64_CCASFLAGS="-Wa,-march=all"
AC_MSG_CHECKING([whether the compiler supports -Wa,-march=all])
: > conftest.s
- if "$CCAS" "$AARCH64_CCASFLAGS" -c conftest.s >/dev/null 2>&1; then
+ # As in Makefiles
+ if "$CCAS" "$AARCH64_CCASFLAGS" $CCASFLAGS -c conftest.s >/dev/null 2>&1; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
11 changes: 1 addition & 10 deletions ports/libgnutls/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${tarball}"
SOURCE_BASE "v${VERSION}"
PATCHES
ccasflags.patch
use-gmp-pkgconfig.patch
link-zlib.patch # directly as before 3.8.4
)
Expand All @@ -31,16 +32,6 @@ if(VCPKG_TARGET_IS_WINDOWS)
vcpkg_list(APPEND options "LIBS=\$LIBS -liconv -lcharset") # for libunistring
endif()

if(VCPKG_CROSSCOMPILING)
vcpkg_cmake_get_vars(cmake_vars_file)
include("${cmake_vars_file}")
set(ccas "${VCPKG_DETECTED_CMAKE_C_COMPILER}")
cmake_path(GET ccas PARENT_PATH ccas_dir)
vcpkg_add_to_path("${ccas_dir}")
cmake_path(GET ccas FILENAME ccas_command)
vcpkg_list(APPEND options "CCAS=${ccas_command}")
endif()

set(ENV{GTKDOCIZE} true) # true, the program
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
Expand Down
6 changes: 1 addition & 5 deletions ports/libgnutls/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libgnutls",
"version": "3.8.5",
"port-version": 1,
"description": "A secure communications library implementing the SSL, TLS and DTLS protocols.",
"homepage": "https://www.gnutls.org/",
"license": null,
Expand All @@ -11,11 +12,6 @@
"libtasn1",
"libunistring",
"nettle",
{
"name": "vcpkg-cmake-get-vars",
"host": true,
"platform": "!native"
},
"zlib"
],
"features": {
Expand Down
15 changes: 11 additions & 4 deletions ports/libidn2/disable-subdirs.patch
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ diff --git a/Makefile.am b/Makefile.am
index 3c8179c..f37158c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -15,7 +15,7 @@

@@ -16,6 +16,7 @@
DISTCHECK_CONFIGURE_FLAGS ?= --enable-gtk-doc --enable-gtk-doc-pdf --disable-gcc-warnings

-SUBDIRS = gl unistring lib src examples tests fuzz po
+SUBDIRS = gl unistring lib src po
SUBDIRS = gl unistring lib src examples fuzz po
+SUBDIRS = gl unistring lib src po
ACLOCAL_AMFLAGS = -I m4 -I gl/m4 -I unistring/m4
EXTRA_DIST = gl/m4/gnulib-cache.m4

@@ -23,7 +24,6 @@ if ENABLE_DOC
SUBDIRS += doc
endif

-SUBDIRS += tests

EXTRA_DIST += cfg.mk maint.mk CONTRIBUTING.md README.md
EXTRA_DIST += COPYING COPYING.LESSERv3 COPYING.unicode COPYINGv2
13 changes: 0 additions & 13 deletions ports/libidn2/fix-msvc.patch

This file was deleted.

30 changes: 0 additions & 30 deletions ports/libidn2/fix-static-into-shared-linking.patch

This file was deleted.

20 changes: 7 additions & 13 deletions ports/libidn2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,27 +1,17 @@
vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}

set(IDN2_FILENAME "libidn2-${VERSION}.tar.gz")

vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}" "https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
URLS "https://ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
"https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libidn/${IDN2_FILENAME}"
FILENAME "${IDN2_FILENAME}"
SHA512 a6e90ccef56cfd0b37e3333ab3594bb3cec7ca42a138ca8c4f4ce142da208fa792f6c78ca00c01001c2bc02831abcbaf1cf9bcc346a5290fd7b30708f5a462f3
SHA512 eab5702bc0baed45492f8dde43a4d2ea3560ad80645e5f9e0cfa8d3b57bccd7fd782d04638e000ba07924a5d9f85e760095b55189188c4017b94705bef9b4a66
)

vcpkg_list(SET patches)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
# Fix linking static libidn2 into shared library
# https://gitlab.com/libidn/libidn2/-/issues/80
vcpkg_list(APPEND patches "fix-static-into-shared-linking.patch")
endif()

vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${ARCHIVE}"
SOURCE_BASE "v${VERSION}"
PATCHES
${patches}
disable-subdirs.patch
fix-msvc.patch
fix-uwp.patch
)

Expand Down Expand Up @@ -71,6 +61,10 @@ file(REMOVE_RECURSE
)

vcpkg_install_copyright(
COMMENT [[
The installed C library libidn2 is dual-licensed under LGPLv3+|GPLv2+,
while the rest of the package is GPLv3+.
]]
FILE_LIST
"${SOURCE_PATH}/COPYING"
"${SOURCE_PATH}/COPYING.LESSERv3"
Expand Down
7 changes: 3 additions & 4 deletions ports/libidn2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "libidn2",
"version": "2.3.4",
"port-version": 3,
"version": "2.3.7",
"description": "GNU Libidn is an implementation of the Stringprep, Punycode and IDNA 2003 specifications. Libidn's purpose is to encode and decode internationalized domain names.",
"homepage": "https://www.gnu.org/software/libidn/",
"license": null,
Expand All @@ -13,14 +12,14 @@
"nls": {
"description": "Enable native language support",
"dependencies": [
"gettext",
{
"name": "gettext",
"host": true,
"features": [
"tools"
]
}
},
"gettext-libintl"
]
}
}
Expand Down
3 changes: 0 additions & 3 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,6 @@ libhdfs3:x64-android=fail
libhdfs3:x64-linux=fail
libhdfs3:x64-osx=fail
libhdfs3:arm64-osx=fail
libidn2:arm-neon-android=fail
libidn2:arm64-android=fail
libidn2:x64-android=fail
# 120 min build time for libjxl arm64-uwp-rel, reason unknown
libjxl:arm64-uwp=skip
liblo:arm-neon-android=fail
Expand Down
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4458,7 +4458,7 @@
},
"libgnutls": {
"baseline": "3.8.5",
"port-version": 0
"port-version": 1
},
"libgo": {
"baseline": "3.1",
Expand Down Expand Up @@ -4541,8 +4541,8 @@
"port-version": 1
},
"libidn2": {
"baseline": "2.3.4",
"port-version": 3
"baseline": "2.3.7",
"port-version": 0
},
"libigl": {
"baseline": "2.5.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libgnutls.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d3b0c3c8e603b2cb67040ee657a859ac63dcce1a",
"version": "3.8.5",
"port-version": 1
},
{
"git-tree": "c3e31974234b23cde0cd18912c88c4bc9e05c2ef",
"version": "3.8.5",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libidn2.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "e259ea117cae1ad4f2cc28fe863cdafd6d812d40",
"version": "2.3.7",
"port-version": 0
},
{
"git-tree": "20e169744f242f67bc4b4dc310f5785d55dba58c",
"version": "2.3.4",
Expand Down

0 comments on commit c0cb041

Please sign in to comment.