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

Lines changed: 15 additions & 0 deletions
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

Lines changed: 11 additions & 5 deletions
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

Lines changed: 1 addition & 0 deletions
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",
Lines changed: 39 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 15 additions & 1 deletion
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 13 additions & 2 deletions
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
}
Lines changed: 35 additions & 0 deletions
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 */

0 commit comments

Comments
 (0)