diff options
Diffstat (limited to 'vcpkg/ports/freexl')
| -rw-r--r-- | vcpkg/ports/freexl/android-builtin-iconv.diff | 39 | ||||
| -rw-r--r-- | vcpkg/ports/freexl/dependencies.patch | 47 | ||||
| -rw-r--r-- | vcpkg/ports/freexl/portfile.cmake | 32 | ||||
| -rw-r--r-- | vcpkg/ports/freexl/subdirs.patch | 12 | ||||
| -rw-r--r-- | vcpkg/ports/freexl/vcpkg.json | 13 |
5 files changed, 143 insertions, 0 deletions
diff --git a/vcpkg/ports/freexl/android-builtin-iconv.diff b/vcpkg/ports/freexl/android-builtin-iconv.diff new file mode 100644 index 0000000..7ffc4a5 --- /dev/null +++ b/vcpkg/ports/freexl/android-builtin-iconv.diff @@ -0,0 +1,39 @@ +diff --git a/src/freexl.c b/src/freexl.c +index f73021d..cc76d63 100644 +--- a/src/freexl.c ++++ b/src/freexl.c +@@ -61,7 +61,7 @@ extern const char *locale_charset (void); + #include <localcharset.h> + #endif /* end localcharset */ + #else /* not WINDOWS */ +-#if defined(__APPLE__) || defined(__ANDROID__) ++#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28) + #include <iconv.h> + #include <localcharset.h> + #else /* neither Mac OsX nor Android */ +diff --git a/src/freexl_ods.c b/src/freexl_ods.c +index 07265eb..ec29b51 100644 +--- a/src/freexl_ods.c ++++ b/src/freexl_ods.c +@@ -61,7 +61,7 @@ extern const char *locale_charset (void); + #include <localcharset.h> + #endif /* end localcharset */ + #else /* not WINDOWS */ +-#if defined(__APPLE__) || defined(__ANDROID__) ++#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28) + #include <iconv.h> + #include <localcharset.h> + #else /* neither Mac OsX nor Android */ +diff --git a/src/freexl_xlsx.c b/src/freexl_xlsx.c +index dc8891d..de56436 100644 +--- a/src/freexl_xlsx.c ++++ b/src/freexl_xlsx.c +@@ -62,7 +62,7 @@ extern const char *locale_charset (void); + #include <localcharset.h> + #endif /* end localcharset */ + #else /* not WINDOWS */ +-#if defined(__APPLE__) || defined(__ANDROID__) ++#if defined(__APPLE__) || (defined(__ANDROID__) && __ANDROID_API__ < 28) + #include <iconv.h> + #include <localcharset.h> + #else /* neither Mac OsX nor Android */ diff --git a/vcpkg/ports/freexl/dependencies.patch b/vcpkg/ports/freexl/dependencies.patch new file mode 100644 index 0000000..e6c4147 --- /dev/null +++ b/vcpkg/ports/freexl/dependencies.patch @@ -0,0 +1,47 @@ +diff --git a/configure.ac b/configure.ac +index d79099f..a820b17 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -66,10 +66,12 @@ AC_CONFIG_FILES([Makefile \ + AC_CHECK_HEADERS(iconv.h,, [AC_MSG_ERROR([cannot find iconv.h, bailing out])]) + # on some systems "iconv()" lives in libc. On others it lives in libiconv + # on older systems "libiconv()" lives in libiconv ++SAVED_LIBS="${LIBS}" + AC_SEARCH_LIBS(iconv,iconv,, + AC_SEARCH_LIBS(libiconv,iconv,,AC_MSG_ERROR(['libiconv' is required but it doesn't seem to be installed on this system.]),)) + AC_SEARCH_LIBS(locale_charset,charset,, + AC_SEARCH_LIBS(nl_langinfo,c,,AC_MSG_ERROR(['libcharset' is required but it doesn't seem to be installed on this system.]),)) ++AC_SUBST(ICONV_LIBS, "${LIBS%${SAVED_LIBS}}") + + #----------------------------------------------------------------------- + # --enable-xmldocs +@@ -77,14 +79,14 @@ AC_SEARCH_LIBS(locale_charset,charset,, + AC_ARG_ENABLE(xmldocs, [AS_HELP_STRING( + [--enable-xmldocs], [enables XML documents support [default=yes]])], + [], [enable_xmldocs=yes]) ++PKG_PROG_PKG_CONFIG + if test x"$enable_xmldocs" != "xyes"; then + AC_DEFINE(OMIT_XMLDOC) + else +-AC_CHECK_HEADERS(minizip/unzip.h,, [AC_MSG_ERROR([cannot find minizip/unzip.h, bailing out])]) +-AC_SEARCH_LIBS(unzLocateFile, minizip,,AC_MSG_ERROR(['libminizip' is required but it doesn't seem to be installed on this system.])) +- +-AC_CHECK_HEADERS(expat.h,, [AC_MSG_ERROR([cannot find expat.h, bailing out])]) +-AC_CHECK_LIB(expat,XML_ParserCreate,,AC_MSG_ERROR(['expat' is required but it doesn't seem to be installed on this system.])) ++ PKG_CHECK_MODULES(MINIZIP, [minizip], [], [AC_MSG_ERROR([[minizip is required]])]) ++ PKG_CHECK_MODULES(EXPAT, [expat], [], [AC_MSG_ERROR([[expat is required]])]) ++ CFLAGS="${EXPAT_CFLAGS} ${MINIZIP_CFLAGS} ${CFLAGS}" ++ LIBS="${EXPAT_LIBS} ${MINIZIP_LIBS} ${LIBS}" + fi + #----------------------------------------------------------------------- + +diff --git a/freexl.pc.in b/freexl.pc.in +index 5813e68..4393590 100644 +--- a/freexl.pc.in ++++ b/freexl.pc.in +@@ -10,3 +10,5 @@ Description: a simple library extracting data from .xls (Excel BIFF) files + Version: @VERSION@ + Libs: -L${libdir} -lfreexl -lm + Cflags: -I${includedir} ++Libs.private: @ICONV_LIBS@ ++Requires.private: expat minizip diff --git a/vcpkg/ports/freexl/portfile.cmake b/vcpkg/ports/freexl/portfile.cmake new file mode 100644 index 0000000..f390ecd --- /dev/null +++ b/vcpkg/ports/freexl/portfile.cmake @@ -0,0 +1,32 @@ +vcpkg_download_distfile(ARCHIVE + URLS "https://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-${VERSION}.tar.gz" + FILENAME "freexl-${VERSION}.tar.gz" + SHA512 663ccc321c2f0dcab8ad9255b2a77066c2046d531a0aa723fb114301fa27b53bf980787dd2548c46541036eceef988c5eedf2bec053adf628929470e67ddc17a +) + +vcpkg_extract_source_archive( + SOURCE_PATH + ARCHIVE "${ARCHIVE}" + PATCHES + dependencies.patch + subdirs.patch + android-builtin-iconv.diff +) + +vcpkg_configure_make( + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG +) +vcpkg_install_make() + +if(VCPKG_TARGET_IS_WINDOWS) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freexl.pc" " -lm" " -liconv -lcharset") + if(NOT DEFINED VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freexl.pc" " -lm" " -liconv -lcharset") + endif() +endif() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/vcpkg/ports/freexl/subdirs.patch b/vcpkg/ports/freexl/subdirs.patch new file mode 100644 index 0000000..3beb115 --- /dev/null +++ b/vcpkg/ports/freexl/subdirs.patch @@ -0,0 +1,12 @@ +diff --git a/Makefile.am b/Makefile.am +index 50dc7f6..cbc99ca 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -1,6 +1,6 @@ + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = headers src tests examples ++SUBDIRS = headers src + + EXTRA_DIST = makefile.vc nmake.opt makefile64.vc nmake64.opt \ + images/piazza.jpg images/piazza.eps mainpage.doxy config-msvc.h diff --git a/vcpkg/ports/freexl/vcpkg.json b/vcpkg/ports/freexl/vcpkg.json new file mode 100644 index 0000000..0262585 --- /dev/null +++ b/vcpkg/ports/freexl/vcpkg.json @@ -0,0 +1,13 @@ +{ + "name": "freexl", + "version": "2.0.0", + "port-version": 1, + "description": "FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet", + "homepage": "https://www.gaia-gis.it/gaia-sins/freexl-sources", + "license": "MPL-1.1 OR GPL-2.0-or-later OR LGPL-2.1-or-later", + "dependencies": [ + "expat", + "libiconv", + "minizip" + ] +} |