aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/scnlib
diff options
context:
space:
mode:
Diffstat (limited to 'vcpkg/ports/scnlib')
-rw-r--r--vcpkg/ports/scnlib/portfile.cmake33
-rw-r--r--vcpkg/ports/scnlib/scnlib-pr-136.patch26
-rw-r--r--vcpkg/ports/scnlib/vcpkg.json19
3 files changed, 78 insertions, 0 deletions
diff --git a/vcpkg/ports/scnlib/portfile.cmake b/vcpkg/ports/scnlib/portfile.cmake
new file mode 100644
index 0000000..fb0324f
--- /dev/null
+++ b/vcpkg/ports/scnlib/portfile.cmake
@@ -0,0 +1,33 @@
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO eliaskosunen/scnlib
+ REF "v${VERSION}"
+ SHA512 db14d71da3c1ecb849f00ac1e334f39c532592230e950aa1009ff00ba56670cb71e33ca457fd4ac66595ff43f0dca0e42d45f672848b9cde3cba80f19ef8693f
+ HEAD_REF master
+ PATCHES
+ # support fast_float 7.0.0
+ scnlib-pr-136.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DSCN_TESTS=OFF
+ -DSCN_EXAMPLES=OFF
+ -DSCN_BENCHMARKS=OFF
+ -DSCN_DOCS=OFF
+ -DSCN_USE_EXTERNAL_FAST_FLOAT=ON
+)
+
+vcpkg_cmake_install()
+vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/scn)
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/share/scn"
+)
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/scnlib/scnlib-pr-136.patch b/vcpkg/ports/scnlib/scnlib-pr-136.patch
new file mode 100644
index 0000000..f3ecee9
--- /dev/null
+++ b/vcpkg/ports/scnlib/scnlib-pr-136.patch
@@ -0,0 +1,26 @@
+diff --git a/src/scn/impl.cpp b/src/scn/impl.cpp
+index aa0d334..ab859a4 100644
+--- a/src/scn/impl.cpp
++++ b/src/scn/impl.cpp
+@@ -721,15 +721,17 @@ scan_expected<std::ptrdiff_t> fast_float_fallback(impl_init_data<CharT> data,
+ struct fast_float_impl_base : impl_base {
+ fast_float::chars_format get_flags() const
+ {
+- unsigned format_flags{};
++ fast_float::chars_format format_flags{};
+ if ((m_options & float_reader_base::allow_fixed) != 0) {
+- format_flags |= fast_float::fixed;
++ format_flags =
++ static_cast<fast_float::chars_format>(format_flags | fast_float::chars_format::fixed);
+ }
+ if ((m_options & float_reader_base::allow_scientific) != 0) {
+- format_flags |= fast_float::scientific;
++ format_flags =
++ static_cast<fast_float::chars_format>(format_flags | fast_float::chars_format::scientific);
+ }
+
+- return static_cast<fast_float::chars_format>(format_flags);
++ return format_flags;
+ }
+ };
+
diff --git a/vcpkg/ports/scnlib/vcpkg.json b/vcpkg/ports/scnlib/vcpkg.json
new file mode 100644
index 0000000..464e91a
--- /dev/null
+++ b/vcpkg/ports/scnlib/vcpkg.json
@@ -0,0 +1,19 @@
+{
+ "name": "scnlib",
+ "version": "4.0.1",
+ "port-version": 1,
+ "description": "scnlib is a modern C++ library for replacing scanf and std::istream",
+ "homepage": "https://scnlib.dev/",
+ "license": "Apache-2.0",
+ "dependencies": [
+ "fast-float",
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}