Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[freexl] Update to 1.0.6 #20520

Merged
merged 7 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 1 addition & 28 deletions ports/freexl/fix-makefiles.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
diff --git a/makefile.vc b/makefile.vc
index 0aacbc7..d95d859 100644
index cb8bd36..85c0352 100644
--- a/makefile.vc
+++ b/makefile.vc
@@ -7,7 +7,7 @@
LIBOBJ = freexl.obj
FREEXL_DLL = freexl$(VERSION).dll

-CFLAGS = /nologo -IC:\OSGeo4W\include -I. -Iheaders $(OPTFLAGS)
+CFLAGS = /nologo -I$(INSTALLED_ROOT)\include -I. -Iheaders $(OPTFLAGS)

default: all

@@ -23,9 +23,9 @@ freexl.lib: $(LIBOBJ)
$(FREEXL_DLL): freexl_i.lib

Expand All @@ -23,21 +14,3 @@ index 0aacbc7..d95d859 100644
if exist $(FREEXL_DLL).manifest mt -manifest \
$(FREEXL_DLL).manifest -outputresource:$(FREEXL_DLL);2

diff --git a/nmake.opt b/nmake.opt
index 35f9242..efb6f77 100644
--- a/nmake.opt
+++ b/nmake.opt
@@ -1,10 +1,10 @@
# Directory tree where FreeXL will be installed.
-INSTDIR=C:\OSGeo4W
+INSTDIR=$(INST_DIR)

# Uncomment the first for an optimized build, or the second for debug.
-OPTFLAGS= /nologo /Ox /fp:precise /W3 /MD /D_CRT_SECURE_NO_WARNINGS \
+OPTFLAGS= /nologo /fp:precise /W3 $(CL_FLAGS) /D_CRT_SECURE_NO_WARNINGS \
/DDLL_EXPORT
-#OPTFLAGS= /nologo /Zi /MD /Fdfreexl.pdb /DDLL_EXPORT
+#OPTFLAGS= /nologo $(CL_FLAGS) /Fdfreexl.pdb /DDLL_EXPORT

# Set the version number for the DLL. Normally we leave this blank since
# we want software that is dynamically loading the DLL to have no problem
22 changes: 0 additions & 22 deletions ports/freexl/fix-sources.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,3 @@ index a39d4e7..37f1c0b 100644

/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
diff --git a/src/freexl.c b/src/freexl.c
index a0b255a..92163a9 100644
--- a/src/freexl.c
+++ b/src/freexl.c
@@ -92,7 +92,7 @@ freexl_version (void)
#if defined(_WIN32) && !defined(__MINGW32__)
/* MSVC compiler doesn't support lround() at all */
static double
-round (double num)
+round_old (double num)
{
double integer = ceil (num);
if (num > 0)
@@ -101,7 +101,7 @@ round (double num)
}

static long
-lround (double num)
+lround_old (double num)
{
long integer = (long) round (num);
return integer;
96 changes: 56 additions & 40 deletions ports/freexl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,70 +1,86 @@
set(FREEXL_VERSION_STR "1.0.4")
set(FREEXL_VERSION_STR "1.0.6")

vcpkg_download_distfile(ARCHIVE
URLS "http://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-${FREEXL_VERSION_STR}.tar.gz"
URLS "https://www.gaia-gis.it/gaia-sins/freexl-sources/freexl-${FREEXL_VERSION_STR}.tar.gz"
FILENAME "freexl-${FREEXL_VERSION_STR}.tar.gz"
SHA512 d72561f7b82e0281cb211fbf249e5e45411a7cdd009cfb58da3696f0a0341ea7df210883bfde794be28738486aeb4ffc67ec2c98fd2acde5280e246e204ce788
SHA512 efbbe261e57d5c05167ad8e1d5a5b348a7e702c0a4030b18dd2a8c60a38332caccbb073ff604bdf5bafac827310b41c7b79f9fa519ea512d6de2eafd9c1f71f6
)

vcpkg_extract_source_archive_ex(
ARCHIVE "${ARCHIVE}"
OUT_SOURCE_PATH SOURCE_PATH
PATCHES
fix-makefiles.patch
fix-sources.patch
fix-pc-file.patch
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\""
)
set(LIBS_ALL_REL
"\"${CURRENT_INSTALLED_DIR}/lib/iconv.lib\" \
\"${CURRENT_INSTALLED_DIR}/lib/charset.lib\""
)

set(OPTFLAGS "/nologo /fp:precise /W3 /D_CRT_SECURE_NO_WARNINGS /DDLL_EXPORT")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I look forward to the day that we have vcpkg_get_cmake_vars as an official stable helper port

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vcpkg_build_nmake already passes CMAKE_CXX_FLAGS (+debug/relase) from (directly including!) scripts/toolchains/windows.cmake (or chainload override) via ENV{CL}. It does not use vcpkg_get_cmake_vars.

However, it doesn't add /LIBPATH:..., and I wonder if it should. There are also other quirks. I considered creating a vcpkg-nmake port...

set(LIBS_ALL "iconv.lib charset.lib")
if(VCPKG_TARGET_IS_UWP)
string(APPEND OPTFLAGS " /DWINAPI_FAMILY=WINAPI_FAMILY_APP")
string(APPEND LIBS_ALL " WindowsApp.lib /APPCONTAINER")
endif()
cmake_path(NATIVE_PATH CURRENT_PACKAGES_DIR INSTDIR)
vcpkg_install_nmake(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
"OPTFLAGS=${OPTFLAGS}"
"CFLAGS=-I. -Iheaders ${OPTFLAGS}"
"LIBS_ALL=${LIBS_ALL}"
OPTIONS_DEBUG
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}/debug"
INST_DIR="${CURRENT_PACKAGES_DIR}/debug"
"LINK_FLAGS=/debug"
"LIBS_ALL=${LIBS_ALL_DBG}"
"INSTDIR=${INSTDIR}\\debug"
"LINK_FLAGS=/debug /LIBPATH:\"${CURRENT_INSTALLED_DIR}/debug/lib\""
OPTIONS_RELEASE
INSTALLED_ROOT="${CURRENT_INSTALLED_DIR}"
INST_DIR="${CURRENT_PACKAGES_DIR}"
"LINK_FLAGS="
"LIBS_ALL=${LIBS_ALL_REL}"
"INSTDIR=${INSTDIR}"
"LINK_FLAGS=/LIBPATH:\"${CURRENT_INSTALLED_DIR}/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")
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")
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")
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")
endif()
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")
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")
endif()
endif()

set(VERSION "${FREEXL_VERSION_STR}")
set(libdir [[${prefix}/lib]])
set(exec_prefix [[${prefix}]])
set(ICONV_LIBS "-liconv -lcharset")
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
set(includedir [[${prefix}/include]])
set(outfile "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/freexl.pc")
configure_file("${SOURCE_PATH}/freexl.pc.in" "${outfile}" @ONLY)
vcpkg_replace_string("${outfile}" " -lm" "")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
set(includedir [[${prefix}/../include]])
set(outfile "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/freexl.pc")
configure_file("${SOURCE_PATH}/freexl.pc.in" "${outfile}" @ONLY)
vcpkg_replace_string("${outfile}" " -lm" "")
endif()

else() # Build in UNIX
else()

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()

endif()

vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
3 changes: 1 addition & 2 deletions ports/freexl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "freexl",
"version-string": "1.0.4",
"port-version": 12,
"version-string": "1.0.6",
"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": [
Expand Down
2 changes: 0 additions & 2 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,6 @@ freeglut:x64-osx=fail
# Needs /bigobj
freeopcua:arm64-windows=fail
freetype-gl:x64-uwp=fail
freexl:arm-uwp=fail
freexl:x64-uwp=fail
fribidi:arm64-windows=fail
fribidi:arm-uwp=fail
fribidi:x64-uwp=fail
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2241,8 +2241,8 @@
"port-version": 1
},
"freexl": {
"baseline": "1.0.4",
"port-version": 12
"baseline": "1.0.6",
"port-version": 0
},
"fribidi": {
"baseline": "1.0.10",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/freexl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "d9635355d8831e1f9628ecbb8935a8e89813ff51",
"version-string": "1.0.6",
"port-version": 0
},
{
"git-tree": "26e9d42e555e69bf1ea1747739daf3d6551bb46b",
"version-string": "1.0.4",
Expand Down