Skip to content

Commit 63932b3

Browse files
authored
Android: API level 28, dynamic CRT (#44424)
1 parent 6a6b135 commit 63932b3

39 files changed

+275
-136
lines changed

ports/calceph/disable-gnu-source.diff

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index a1cb297..9448623 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -147,8 +147,10 @@ IF ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel")
6+
MESSAGE(STATUS "Add the option '-fp-model precise' for the Intel compilers")
7+
string(APPEND CMAKE_C_FLAGS " -fp-model precise ")
8+
ENDIF ()
9+
+if(NOT ANDROID)
10+
# Define for the function strod_l
11+
string(APPEND CMAKE_C_FLAGS " -D_GNU_SOURCE=1 ")
12+
+endif()
13+
# Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2).
14+
string(APPEND CMAKE_C_FLAGS " -D_LARGEFILE_SOURCE=1 ")
15+
string(APPEND CMAKE_C_FLAGS " -D_LARGE_FILES=1 ")

ports/calceph/portfile.cmake

+11-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
set(CALCEPH_HASH 81cddae9fa0d06758dbbb5fae486bd64eb087dc2ebf2d7b17fa89b6689b86e0e84d1412e6852e980ebed00a4c84a3b1b4ac00b89021f6d0bb2f370a98a6dad25)
2-
31
vcpkg_download_distfile(ARCHIVE
42
URLS "https://www.imcce.fr/content/medias/recherche/equipes/asd/calceph/calceph-${VERSION}.tar.gz"
53
FILENAME "calceph-${VERSION}.tar.gz"
6-
SHA512 ${CALCEPH_HASH}
4+
SHA512 81cddae9fa0d06758dbbb5fae486bd64eb087dc2ebf2d7b17fa89b6689b86e0e84d1412e6852e980ebed00a4c84a3b1b4ac00b89021f6d0bb2f370a98a6dad25
75
)
86

97
vcpkg_extract_source_archive(
108
SOURCE_PATH
11-
ARCHIVE ${ARCHIVE}
9+
ARCHIVE "${ARCHIVE}"
10+
PATCHES
11+
disable-gnu-source.diff
1212
)
1313

1414
vcpkg_cmake_configure(
@@ -28,4 +28,10 @@ endif()
2828
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
2929

3030
file(INSTALL "${SOURCE_PATH}/README.rst" DESTINATION "${CURRENT_PACKAGES_DIR}/share/calceph" RENAME readme.rst)
31-
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING_CECILL_B.LIB")
31+
vcpkg_install_copyright(
32+
COMMENT "The CALCEPH library is triple-licensed (CECILL-2.1 OR CECILL-B OR CECILL-C)."
33+
FILE_LIST
34+
"${SOURCE_PATH}/COPYING_CECILL_V2.1.LIB"
35+
"${SOURCE_PATH}/COPYING_CECILL_B.LIB"
36+
"${SOURCE_PATH}/COPYING_CECILL_C.LIB"
37+
)

ports/calceph/vcpkg.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "calceph",
33
"version": "4.0.4",
4+
"port-version": 1,
45
"description": "C library to access the binary planetary ephemeris files.",
56
"homepage": "https://www.imcce.fr/inpop/calceph/",
67
"documentation": "https://calceph.imcce.fr/docs/latest/html/c/index.html",
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
diff --git a/src/freexl.c b/src/freexl.c
2+
index f73021d..cc76d63 100644
3+
--- a/src/freexl.c
4+
+++ b/src/freexl.c
5+
@@ -61,7 +61,7 @@ extern const char *locale_charset (void);
6+
#include <localcharset.h>
7+
#endif /* end localcharset */
8+
#else /* not WINDOWS */
9+
-#if defined(__APPLE__) || defined(__ANDROID__)
10+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
11+
#include <iconv.h>
12+
#include <localcharset.h>
13+
#else /* neither Mac OsX nor Android */
14+
diff --git a/src/freexl_ods.c b/src/freexl_ods.c
15+
index 07265eb..ec29b51 100644
16+
--- a/src/freexl_ods.c
17+
+++ b/src/freexl_ods.c
18+
@@ -61,7 +61,7 @@ extern const char *locale_charset (void);
19+
#include <localcharset.h>
20+
#endif /* end localcharset */
21+
#else /* not WINDOWS */
22+
-#if defined(__APPLE__) || defined(__ANDROID__)
23+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
24+
#include <iconv.h>
25+
#include <localcharset.h>
26+
#else /* neither Mac OsX nor Android */
27+
diff --git a/src/freexl_xlsx.c b/src/freexl_xlsx.c
28+
index dc8891d..de56436 100644
29+
--- a/src/freexl_xlsx.c
30+
+++ b/src/freexl_xlsx.c
31+
@@ -62,7 +62,7 @@ extern const char *locale_charset (void);
32+
#include <localcharset.h>
33+
#endif /* end localcharset */
34+
#else /* not WINDOWS */
35+
-#if defined(__APPLE__) || defined(__ANDROID__)
36+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
37+
#include <iconv.h>
38+
#include <localcharset.h>
39+
#else /* neither Mac OsX nor Android */

ports/freexl/portfile.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ vcpkg_extract_source_archive(
1010
PATCHES
1111
dependencies.patch
1212
subdirs.patch
13+
android-builtin-iconv.diff
1314
)
1415

1516
vcpkg_configure_make(

ports/freexl/vcpkg.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "freexl",
33
"version": "2.0.0",
4+
"port-version": 1,
45
"description": "FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet",
56
"homepage": "https://www.gaia-gis.it/gaia-sins/freexl-sources",
67
"license": "MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later",

ports/libiconv/portfile.cmake

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
1-
if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_ANDROID AND NOT VCPKG_TARGET_IS_IOS AND NOT VCPKG_TARGET_IS_FREEBSD AND NOT VCPKG_TARGET_IS_OPENBSD)
1+
if(NOT DEFINED X_VCPKG_BUILD_GNU_LIBICONV)
2+
set(X_VCPKG_BUILD_GNU_LIBICONV 0)
3+
if(VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_IOS OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OPENBSD)
4+
set(X_VCPKG_BUILD_GNU_LIBICONV 1)
5+
elseif(VCPKG_TARGET_IS_ANDROID)
6+
vcpkg_cmake_get_vars(cmake_vars_file)
7+
include("${cmake_vars_file}")
8+
if(VCPKG_DETECTED_CMAKE_SYSTEM_VERSION VERSION_LESS "28")
9+
set(X_VCPKG_BUILD_GNU_LIBICONV 1)
10+
endif()
11+
endif()
12+
endif()
13+
14+
if(NOT X_VCPKG_BUILD_GNU_LIBICONV)
15+
message(STATUS "Not building GNU libiconv.")
216
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
317
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/iconv")
418
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/iconv")

ports/libiconv/usage

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The package libiconv provides CMake targets:
1+
libiconv provides CMake targets:
22

3-
find_package(Iconv)
4-
target_link_libraries(main PRIVATE Iconv::Iconv)
3+
find_package(Iconv REQUIRED)
4+
target_link_libraries(main PRIVATE Iconv::Iconv)

ports/libiconv/vcpkg.json

+13-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
{
22
"name": "libiconv",
33
"version": "1.18",
4-
"description": "GNU Unicode text conversion",
4+
"port-version": 1,
5+
"description": [
6+
"iconv() text conversion.",
7+
"This port installs GNU libiconv if the system C runtime doesn't provide a suitable iconv() implementation."
8+
],
59
"homepage": "https://www.gnu.org/software/libiconv/",
6-
"license": null
10+
"license": null,
11+
"dependencies": [
12+
{
13+
"name": "vcpkg-cmake-get-vars",
14+
"host": true,
15+
"platform": "android"
16+
}
17+
]
718
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
diff --git a/src/gaiaaux/gg_utf8.c b/src/gaiaaux/gg_utf8.c
2+
index f11e604..620696e 100644
3+
--- a/src/gaiaaux/gg_utf8.c
4+
+++ b/src/gaiaaux/gg_utf8.c
5+
@@ -73,7 +73,7 @@ extern const char *locale_charset (void);
6+
#include <localcharset.h>
7+
#endif /* end localcharset */
8+
#else /* not MINGW32 - WIN32 */
9+
-#if defined(__APPLE__) || defined(__ANDROID__)
10+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
11+
#include <iconv.h>
12+
#include <localcharset.h>
13+
#else /* neither Mac OsX nor Android */
14+
@@ -89,7 +89,7 @@ gaiaGetLocaleCharset ()
15+
#if defined(__MINGW32__) || defined(_WIN32)
16+
return locale_charset ();
17+
#else /* not MINGW32 - WIN32 */
18+
-#if defined(__APPLE__) || defined(__ANDROID__)
19+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
20+
return locale_charset ();
21+
#else /* neither Mac OsX nor Android */
22+
return nl_langinfo (CODESET);
23+
diff --git a/src/gaiageo/gg_shape.c b/src/gaiageo/gg_shape.c
24+
index 8917535..e5e0240 100644
25+
--- a/src/gaiageo/gg_shape.c
26+
+++ b/src/gaiageo/gg_shape.c
27+
@@ -75,7 +75,7 @@ extern const char *locale_charset (void);
28+
#include <localcharset.h>
29+
#endif /* end localcharset */
30+
#else /* not MINGW32 */
31+
-#if defined(__APPLE__) || defined(__ANDROID__)
32+
+#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28)
33+
#include <iconv.h>
34+
#include <localcharset.h>
35+
#else /* neither Mac OsX nor Android */

ports/libspatialite/portfile.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ vcpkg_extract_source_archive(
1313
gaiaconfig-msvc.patch
1414
fix-mingw.patch
1515
fix-utf8-source.patch
16+
android-builtin-iconv.diff
1617
)
1718

1819
vcpkg_check_features(OUT_FEATURE_OPTIONS unused

ports/libspatialite/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "libspatialite",
33
"version": "5.1.0",
4-
"port-version": 2,
4+
"port-version": 3,
55
"description": "SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities.",
66
"homepage": "https://www.gaia-gis.it/fossil/libspatialite/index",
77
"license": null,

ports/libssh/android-glob-tilde.diff

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
diff --git a/src/bind_config.c b/src/bind_config.c
2+
index 27c42c9..9e9c5f0 100644
3+
--- a/src/bind_config.c
4+
+++ b/src/bind_config.c
5+
@@ -248,6 +248,9 @@ static void local_parse_glob(ssh_bind bind,
6+
int rt;
7+
u_int i;
8+
9+
+#if defined(__ANDROID__) && !defined(GLOB_TILDE)
10+
+ const int GLOB_TILDE = 0;
11+
+#endif
12+
rt = glob(fileglob, GLOB_TILDE, NULL, &globbuf);
13+
if (rt == GLOB_NOMATCH) {
14+
globfree(&globbuf);
15+
diff --git a/src/config.c b/src/config.c
16+
index c5c4012..72a9bdd 100644
17+
--- a/src/config.c
18+
+++ b/src/config.c
19+
@@ -249,6 +249,9 @@ static void local_parse_glob(ssh_session session,
20+
int rt;
21+
size_t i;
22+
23+
+#if defined(__ANDROID__) && !defined(GLOB_TILDE)
24+
+ const int GLOB_TILDE = 0;
25+
+#endif
26+
rt = glob(fileglob, GLOB_TILDE, NULL, &globbuf);
27+
if (rt == GLOB_NOMATCH) {
28+
globfree(&globbuf);

ports/libssh/portfile.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ vcpkg_extract_source_archive(SOURCE_PATH
99
0001-export-pkgconfig-file.patch
1010
0003-no-source-write.patch
1111
0004-file-permissions-constants.patch
12+
android-glob-tilde.diff
1213
)
1314

1415
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS

ports/libssh/vcpkg.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "libssh",
33
"version": "0.10.6",
4+
"port-version": 1,
45
"description": "libssh is a multiplatform C library implementing the SSHv2 protocol on client and server side",
56
"homepage": "https://www.libssh.org/",
67
"license": "LGPL-2.1-only",

ports/sockpp/android-strerror_r.diff

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/src/exception.cpp b/src/exception.cpp
2+
index 72aae7e..7a56c60 100644
3+
--- a/src/exception.cpp
4+
+++ b/src/exception.cpp
5+
@@ -66,7 +66,7 @@ string sys_error::error_str(int err)
6+
buf, sizeof(buf), NULL);
7+
#else
8+
#ifdef _GNU_SOURCE
9+
- #if !defined(__GLIBC__)
10+
+ #if !defined(__GLIBC__) && !defined(__ANDROID__)
11+
// use the XSI standard behavior.
12+
int e = strerror_r(err, buf, sizeof(buf));
13+
auto s = strerror(e);

ports/sockpp/portfile.cmake

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ vcpkg_from_github(
66
REF "v${VERSION}"
77
SHA512 99191c9551ff345f96af9177d124c6e10f3da8e87021576058b63df82ee64461cb8fc134919fe390617200aebf222e70501e3cee43fc0a294596947669ed4f03
88
HEAD_REF master
9+
PATCHES
10+
android-strerror_r.diff
911
)
1012

1113
vcpkg_replace_string("${SOURCE_PATH}/CMakeLists.txt" "\${SOCKPP}-static" "\${SOCKPP}" IGNORE_UNCHANGED)

ports/sockpp/vcpkg.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "sockpp",
33
"version": "1.0.0",
4-
"port-version": 1,
4+
"port-version": 2,
55
"description": "Simple, modern, C++ socket library. This is a fairly low-level C++ wrapper around the Berkeley sockets library using socket, acceptor, and connector classes that are familiar concepts from other languages.",
66
"homepage": "https://github.com/fpagliughi/sockpp",
77
"license": "BSD-3-Clause",

ports/suitesparse-lagraph/portfile.cmake

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ vcpkg_cmake_configure(
2020
DISABLE_PARALLEL_CONFIGURE
2121
OPTIONS
2222
-DBUILD_STATIC_LIBS=${BUILD_STATIC_LIBS}
23+
-DBUILD_TESTING=OFF
2324
-DSUITESPARSE_USE_CUDA=OFF
2425
-DSUITESPARSE_USE_STRICT=ON
2526
-DSUITESPARSE_USE_FORTRAN=OFF

ports/suitesparse-lagraph/vcpkg.json

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"$comment": "Use scripts/update_suitesparse.py to update all SuiteSparse ports",
33
"name": "suitesparse-lagraph",
44
"version-semver": "1.1.4",
5+
"port-version": 1,
56
"description": "LAGraph: Library plus test harness for collecting algorithms that use GraphBLAS",
67
"homepage": "https://lagraph.readthedocs.io/en/latest/",
78
"license": "BSD-2-Clause",

ports/treehopper/fix-dependences.patch

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ index 8537305..db3d29b 100644
99
- target_link_libraries(treehopper usb-1.0 pthread)
1010
+ find_package(PkgConfig REQUIRED)
1111
+ pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0)
12-
+
13-
+ target_link_libraries(treehopper PRIVATE PkgConfig::libusb pthread)
12+
+ find_package(Threads REQUIRED)
13+
+ target_link_libraries(treehopper PRIVATE PkgConfig::libusb ${CMAKE_THREAD_LIBS_INIT})
1414
elseif(WIN32)
1515
target_link_libraries(treehopper winusb setupapi)
1616
endif(APPLE)

ports/treehopper/portfile.cmake

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY ONLY_DYNAMIC_CRT)
1+
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
22

33
vcpkg_from_github(
44
OUT_SOURCE_PATH SOURCE_PATH
@@ -10,8 +10,18 @@ vcpkg_from_github(
1010
fix-dependences.patch
1111
)
1212

13+
if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID)
14+
vcpkg_find_acquire_program(PKGCONFIG)
15+
endif()
16+
1317
vcpkg_cmake_configure(
1418
SOURCE_PATH "${SOURCE_PATH}/C++/API/"
19+
OPTIONS
20+
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
21+
-DTHREADS_PREFER_PTHREAD_FLAG=ON
22+
MAYBE_UNUSED_VARIABLES
23+
PKG_CONFIG_EXECUTABLE
24+
THREADS_PREFER_PTHREAD_FLAG
1525
)
1626

1727
vcpkg_cmake_install()

ports/treehopper/vcpkg.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "treehopper",
33
"version": "1.11.3",
4-
"port-version": 9,
4+
"port-version": 10,
55
"description": "Treehopper connects the physical world to your computer, tablet, or smartphone.",
66
"homepage": "https://treehopper.io",
7-
"supports": "!staticcrt & !uwp",
7+
"supports": "!uwp & !(static & staticcrt)",
88
"dependencies": [
99
{
1010
"name": "libusb",
11-
"platform": "linux"
11+
"platform": "android | linux"
1212
},
1313
{
1414
"name": "vcpkg-cmake",

0 commit comments

Comments
 (0)