From 234d20e4843a25b9523b91394dd5f19247eea9cc Mon Sep 17 00:00:00 2001 From: Saad Date: Wed, 17 Jan 2024 18:40:23 -0500 Subject: [PATCH] [nanojsonc] Add new port (#34909) * Create nanojson (JSON Parser for C/C++) Event-Driven JSON Parser for C/C++ * Creating nanojson port Event-Driven JSON Parser for C/C++ * init * update nanojson * update sha512 Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> * update version Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * update copy license Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * update dependencies Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> * update vcpkg * update license filename * deleted license * update * update hash * update * update * update * [saadshams-nanojson] Add new port * update version * never agreed to the name, it was published without consent * rebranded as nanojsonc * update hash * update * update * update * format vcpkg.sjon * update version * update version * update * update * update * update * fix error * update version * update * update * update fixed share * update * update * formating vcpkg.json * update version * additional empty line * update version --------- Co-authored-by: Alexander Neumann <30894796+Neumann-A@users.noreply.github.com> Co-authored-by: JonLiu1993 <63675417+JonLiu1993@users.noreply.github.com> Co-authored-by: vzhli17 --- ports/nanojsonc/portfile.cmake | 19 +++++++++++++++++++ ports/nanojsonc/usage | 4 ++++ ports/nanojsonc/vcpkg.json | 18 ++++++++++++++++++ versions/baseline.json | 4 ++++ versions/n-/nanojsonc.json | 9 +++++++++ 5 files changed, 54 insertions(+) create mode 100644 ports/nanojsonc/portfile.cmake create mode 100644 ports/nanojsonc/usage create mode 100644 ports/nanojsonc/vcpkg.json create mode 100644 versions/n-/nanojsonc.json diff --git a/ports/nanojsonc/portfile.cmake b/ports/nanojsonc/portfile.cmake new file mode 100644 index 0000000000..0b9fc7806a --- /dev/null +++ b/ports/nanojsonc/portfile.cmake @@ -0,0 +1,19 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO open-source-patterns/nanojsonc + REF "${VERSION}" + SHA512 306fce8f90c1e5b9031f3f2b1cec5430722477425766fc05e430cceb03bb85188f2c451c0c7d34aed49b506e6a2cd835e419792362f992acbafc0b099fbe4b5e + HEAD_REF main +) + +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DBUILD_TESTS=OFF) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup() # removes /debug/share +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") # removes debug/include + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") # Install License +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") # Install Usage diff --git a/ports/nanojsonc/usage b/ports/nanojsonc/usage new file mode 100644 index 0000000000..6e1e2c3ae9 --- /dev/null +++ b/ports/nanojsonc/usage @@ -0,0 +1,4 @@ +The package nanojsonc provides CMake targets: + + find_package(nanojsonc CONFIG REQUIRED) + target_link_libraries(main PRIVATE nanojsonc::nanojsonc) diff --git a/ports/nanojsonc/vcpkg.json b/ports/nanojsonc/vcpkg.json new file mode 100644 index 0000000000..48eb35f0eb --- /dev/null +++ b/ports/nanojsonc/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "nanojsonc", + "version": "1.0.0", + "maintainers": "Saad Shams", + "description": "Event-Driven JSON Parser for C", + "homepage": "https://github.com/open-source-patterns/nanojsonc", + "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 6427615e84..e5f01355e2 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -5876,6 +5876,10 @@ "baseline": "2019-09-23", "port-version": 5 }, + "nanojsonc": { + "baseline": "1.0.0", + "port-version": 0 + }, "nanomsg": { "baseline": "1.2.0", "port-version": 1 diff --git a/versions/n-/nanojsonc.json b/versions/n-/nanojsonc.json new file mode 100644 index 0000000000..3a8ad2e97a --- /dev/null +++ b/versions/n-/nanojsonc.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "7680709fd527db1cc26d47f8897c0669cacbfb0f", + "version": "1.0.0", + "port-version": 0 + } + ] +}