From 5bc27e8a5073ba139e29432a1b0d8ced50794a41 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 1 Sep 2021 05:39:38 +0200 Subject: [PATCH] [freexl] Fix mingw, cleanup (#19504) * New port version, format manifest * Revise portfile * Add mingw support * Add libiconv dependency to pc file * x-add-version * Apply PR comment * x-add-version --- ports/freexl/CONTROL | 6 --- ports/freexl/fix-pc-file.patch | 26 ++++++++++++ ports/freexl/portfile.cmake | 73 ++++++++++++---------------------- ports/freexl/vcpkg.json | 10 +++++ versions/baseline.json | 2 +- versions/f-/freexl.json | 5 +++ 6 files changed, 68 insertions(+), 54 deletions(-) delete mode 100644 ports/freexl/CONTROL create mode 100644 ports/freexl/fix-pc-file.patch create mode 100644 ports/freexl/vcpkg.json diff --git a/ports/freexl/CONTROL b/ports/freexl/CONTROL deleted file mode 100644 index 3855a9cad3..0000000000 --- a/ports/freexl/CONTROL +++ /dev/null @@ -1,6 +0,0 @@ -Source: freexl -Version: 1.0.4 -Port-Version: 11 -Homepage: https://www.gaia-gis.it/gaia-sins/freexl-sources -Description: FreeXL is an open source library to extract valid data from within an Excel (.xls) spreadsheet -Build-Depends: libiconv diff --git a/ports/freexl/fix-pc-file.patch b/ports/freexl/fix-pc-file.patch new file mode 100644 index 0000000000..5a429026de --- /dev/null +++ b/ports/freexl/fix-pc-file.patch @@ -0,0 +1,26 @@ +diff --git a/configure.ac b/configure.ac +index a44dbf4..55bd768 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -64,9 +64,11 @@ 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}}") + + AC_OUTPUT + +diff --git a/freexl.pc.in b/freexl.pc.in +index 5813e68..8fc671d 100644 +--- a/freexl.pc.in ++++ b/freexl.pc.in +@@ -10,3 +10,4 @@ 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@ diff --git a/ports/freexl/portfile.cmake b/ports/freexl/portfile.cmake index 6b4998b679..12834382f8 100644 --- a/ports/freexl/portfile.cmake +++ b/ports/freexl/portfile.cmake @@ -6,15 +6,16 @@ vcpkg_download_distfile(ARCHIVE SHA512 d72561f7b82e0281cb211fbf249e5e45411a7cdd009cfb58da3696f0a0341ea7df210883bfde794be28738486aeb4ffc67ec2c98fd2acde5280e246e204ce788 ) -if (VCPKG_TARGET_IS_WINDOWS) - vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH - PATCHES - fix-makefiles.patch - fix-sources.patch - ) - +vcpkg_extract_source_archive_ex( + ARCHIVE "${ARCHIVE}" + OUT_SOURCE_PATH SOURCE_PATH + PATCHES + fix-makefiles.patch + fix-sources.patch + fix-pc-file.patch +) + +if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) set(LIBS_ALL_DBG "\"${CURRENT_INSTALLED_DIR}/debug/lib/iconv.lib\" \ \"${CURRENT_INSTALLED_DIR}/debug/lib/charset.lib\"" @@ -25,7 +26,7 @@ if (VCPKG_TARGET_IS_WINDOWS) ) vcpkg_install_nmake( - SOURCE_PATH ${SOURCE_PATH} + SOURCE_PATH "${SOURCE_PATH}" OPTIONS_DEBUG INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}/debug" INST_DIR="${CURRENT_PACKAGES_DIR}/debug" @@ -37,55 +38,33 @@ if (VCPKG_TARGET_IS_WINDOWS) "LINK_FLAGS=" "LIBS_ALL=${LIBS_ALL_REL}" ) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright) - if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib) + if (VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin") + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib") else() - file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/freexl.lib) - file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib) + file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/freexl.lib") + file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib") if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - file(RENAME ${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib ${CURRENT_PACKAGES_DIR}/lib/freexl.lib) + file(RENAME "${CURRENT_PACKAGES_DIR}/lib/freexl_i.lib" "${CURRENT_PACKAGES_DIR}/lib/freexl.lib") endif() if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib) + file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/freexl_i.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/freexl.lib") endif() endif() -elseif (CMAKE_HOST_UNIX OR CMAKE_HOST_APPLE) # Build in UNIX +else() # Build in UNIX - vcpkg_extract_source_archive_ex( - ARCHIVE ${ARCHIVE} - OUT_SOURCE_PATH SOURCE_PATH - ) - file(REMOVE_RECURSE "${SOURCE_PATH}/configure") vcpkg_configure_make( - AUTOCONFIG - SOURCE_PATH ${SOURCE_PATH} - OPTIONS_DEBUG - INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" - "LINK_FLAGS=/debug" - "CL_FLAGS=${CL_FLAGS_DBG}" - "LIBS_ALL=${LIBS_ALL_DBG}" - OPTIONS_RELEASE - INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}" - "LINK_FLAGS=" - "CL_FLAGS=${CL_FLAGS_REL}" - "LIBS_ALL=${LIBS_ALL_REL}" + SOURCE_PATH "${SOURCE_PATH}" + AUTOCONFIG ) - vcpkg_install_make() - vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES m) - - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) - file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/freexl RENAME copyright) + vcpkg_fixup_pkgconfig() -else()# Other build system - message(FATAL_ERROR "Unsupported build system.") endif() -message(STATUS "Packaging ${TARGET_TRIPLET} done") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/freexl/vcpkg.json b/ports/freexl/vcpkg.json new file mode 100644 index 0000000000..3a19e57707 --- /dev/null +++ b/ports/freexl/vcpkg.json @@ -0,0 +1,10 @@ +{ + "name": "freexl", + "version-string": "1.0.4", + "port-version": 12, + "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", + "dependencies": [ + "libiconv" + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index b4480c5bed..95ead45b49 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2158,7 +2158,7 @@ }, "freexl": { "baseline": "1.0.4", - "port-version": 11 + "port-version": 12 }, "fribidi": { "baseline": "1.0.10", diff --git a/versions/f-/freexl.json b/versions/f-/freexl.json index 8883043b52..8df61ab967 100644 --- a/versions/f-/freexl.json +++ b/versions/f-/freexl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "26e9d42e555e69bf1ea1747739daf3d6551bb46b", + "version-string": "1.0.4", + "port-version": 12 + }, { "git-tree": "eb377ce039ce22eaec25f3bf81668c5d77bec086", "version-string": "1.0.4",