diff --git a/ports/openxlsx/compilation_fix.patch b/ports/openxlsx/compilation_fix.patch new file mode 100644 index 00000000000000..fdcd1761fc3e8c --- /dev/null +++ b/ports/openxlsx/compilation_fix.patch @@ -0,0 +1,22 @@ +diff --git a/OpenXLSX/headers/XLSheet.hpp b/OpenXLSX/headers/XLSheet.hpp +index 2f33dd4..23c11c9 100644 +--- a/OpenXLSX/headers/XLSheet.hpp ++++ b/OpenXLSX/headers/XLSheet.hpp +@@ -137,7 +137,7 @@ namespace OpenXLSX + XLSheetState visibility() const + { + XLQuery query(XLQueryType::QuerySheetVisibility); +- query.template setParam("sheetID", relationshipID()); ++ query.setParam("sheetID", relationshipID()); + auto state = parentDoc().execQuery(query).template result(); + auto result = XLSheetState::Visible; + +@@ -208,7 +208,7 @@ namespace OpenXLSX + // return uint16_t(std::stoi(parentDoc().execQuery(R"({ "query": "QuerySheetIndex", "sheetID": ")" + relationshipID() + "\"}"))); + + XLQuery query(XLQueryType::QuerySheetIndex); +- query.template setParam("sheetID", relationshipID()); ++ query.setParam("sheetID", relationshipID()); + return uint16_t(std::stoi(parentDoc().execQuery(query).template result())); + } + diff --git a/ports/openxlsx/portfile.cmake b/ports/openxlsx/portfile.cmake new file mode 100644 index 00000000000000..0ecefc80544559 --- /dev/null +++ b/ports/openxlsx/portfile.cmake @@ -0,0 +1,32 @@ +# Header-only library +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO troldal/OpenXLSX + REF "v${VERSION}" + SHA512 52205b394383d45c0fb16599ab96453d8a5b9b5cd596096848cc888f47565b2713d9edded06b2ecd7b67736622badf136e4b1becc57bfa5bbdcb1e063a347084 + HEAD_REF master + PATCHES + compilation_fix.patch +) + +vcpkg_cmake_configure( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DOPENXLSX_BUILD_TESTS=OFF + -OPENXLSX_CREATE_DOCS=OFF + -OPENXLSX_BUILD_SAMPLES=OFF + -DOPENXLSX_BUILD_BENCHMARKS=OFF +) +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/OpenXLSX) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(COPY "${SOURCE_PATH}/OpenXLSX/external" DESTINATION "${CURRENT_PACKAGES_DIR}/include") +file(COPY "${SOURCE_PATH}/OpenXLSX/headers/XLException.hpp" DESTINATION "${CURRENT_PACKAGES_DIR}/include") + + +vcpkg_copy_pdbs() + + +# Handle copyright +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md") +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") diff --git a/ports/openxlsx/usage b/ports/openxlsx/usage new file mode 100644 index 00000000000000..cc740c81250fca --- /dev/null +++ b/ports/openxlsx/usage @@ -0,0 +1,4 @@ +openxlsx provides CMake targets: + + find_package(OpenXLSX CONFIG REQUIRED) + target_link_libraries(main PRIVATE OpenXLSX::OpenXLSX) diff --git a/ports/openxlsx/vcpkg.json b/ports/openxlsx/vcpkg.json new file mode 100644 index 00000000000000..82856c7a0a6cf1 --- /dev/null +++ b/ports/openxlsx/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "openxlsx", + "version": "0.3.2", + "description": "OpenXLSX is a C++ library for reading, writing, creating and modifying Microsoft Excel® files, with the .xlsx format.", + "homepage": "https://github.com/troldal/OpenXLSX", + "license": "BSD-3-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 72c99586d1dfda..6a132263e7ca42 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6740,6 +6740,10 @@ "baseline": "2.5.1", "port-version": 0 }, + "openxlsx": { + "baseline": "0.3.2", + "port-version": 0 + }, "openxr-loader": { "baseline": "1.0.31", "port-version": 0 diff --git a/versions/o-/openxlsx.json b/versions/o-/openxlsx.json new file mode 100644 index 00000000000000..ebc7f70211016e --- /dev/null +++ b/versions/o-/openxlsx.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "cfe04fbd49dba5d41bfbf4472c4d09b1d9532b22", + "version": "0.3.2", + "port-version": 0 + } + ] +}