diff --git a/ports/nanopb/fix-install-location.patch b/ports/nanopb/fix-install-location.patch new file mode 100644 index 0000000000..e3db1d50a5 --- /dev/null +++ b/ports/nanopb/fix-install-location.patch @@ -0,0 +1,41 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 0ce05ea..1e8c4ed 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -34,18 +34,11 @@ if(NOT DEFINED CMAKE_INSTALL_CMAKEDIR) + set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/nanopb") + endif() + +-execute_process( +- COMMAND ${Python_EXECUTABLE} -c +- "import os.path, sys, sysconfig; print(os.path.relpath(sysconfig.get_path('purelib'), start=sys.prefix))" +- OUTPUT_VARIABLE PYTHON_INSTDIR +- OUTPUT_STRIP_TRAILING_WHITESPACE +-) +- + if(nanopb_BUILD_GENERATOR) + set(generator_protos nanopb) +- if(NOT DEFINED nanopb_PROTOC_PATH) +- message(FATAL_ERROR "nanopb_PROTOC_PATH not defined") +- endif() ++ if(NOT DEFINED nanopb_PROTOC_PATH) ++ message(FATAL_ERROR "nanopb_PROTOC_PATH not defined") ++ endif() + foreach(generator_proto IN LISTS generator_protos) + string(REGEX REPLACE "([^;]+)" "${PROJECT_SOURCE_DIR}/generator/proto/\\1.proto" generator_proto_file "${generator_proto}") + string(REGEX REPLACE "([^;]+)" "\\1_pb2.py" generator_proto_py_file "${generator_proto}") +@@ -58,12 +51,12 @@ if(nanopb_BUILD_GENERATOR) + install( + FILES ${PROJECT_BINARY_DIR}/${generator_proto_py_file} + ${generator_proto_file} +- DESTINATION ${PYTHON_INSTDIR}/proto/ ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/proto/ + ) + endforeach() + + install( FILES generator/proto/_utils.py +- DESTINATION ${PYTHON_INSTDIR}/proto/ ) ++ DESTINATION ${CMAKE_INSTALL_DATADIR}/proto/ ) + endif() + + if(WIN32) diff --git a/ports/nanopb/portfile.cmake b/ports/nanopb/portfile.cmake index 450cc60470..cb90f31966 100644 --- a/ports/nanopb/portfile.cmake +++ b/ports/nanopb/portfile.cmake @@ -8,6 +8,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-cmakelist-and-pb-header.patch + fix-install-location.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" nanopb_BUILD_STATIC_LIBS) @@ -30,6 +31,7 @@ vcpkg_cmake_configure( -Dnanopb_MSVC_STATIC_RUNTIME=${nanopb_STATIC_LINKING} -Dnanopb_PROTOC_PATH="${CURRENT_HOST_INSTALLED_DIR}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" ${FEATURE_OPTIONS} + -DCMAKE_INSTALL_DATADIR=share/${PORT} ) vcpkg_cmake_install() @@ -37,7 +39,7 @@ vcpkg_copy_pdbs() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") if(nanopb_BUILD_GENERATOR) file(INSTALL "${CURRENT_PACKAGES_DIR}/bin/nanopb_generator.py" DESTINATION "${CURRENT_PACKAGES_DIR}/tools/${PORT}") diff --git a/ports/nanopb/vcpkg.json b/ports/nanopb/vcpkg.json index 63e5e3300d..315f5fe635 100644 --- a/ports/nanopb/vcpkg.json +++ b/ports/nanopb/vcpkg.json @@ -1,6 +1,7 @@ { "name": "nanopb", "version-semver": "0.4.7", + "port-version": 1, "description": "A small code-size Protocol Buffers implementation in ANSI C.", "homepage": "https://jpa.kapsi.fi/nanopb/", "license": "Zlib", diff --git a/versions/baseline.json b/versions/baseline.json index 9e0d39a244..8b464aa942 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -2134,7 +2134,7 @@ }, "drogon": { "baseline": "1.8.4", - "port-version": 0 + "port-version": 0 }, "dstorage": { "baseline": "1.1.0", @@ -5374,7 +5374,7 @@ }, "nanopb": { "baseline": "0.4.7", - "port-version": 0 + "port-version": 1 }, "nanoprintf": { "baseline": "2020-05-27", diff --git a/versions/n-/nanopb.json b/versions/n-/nanopb.json index 972b5ab6fb..27d3df147b 100644 --- a/versions/n-/nanopb.json +++ b/versions/n-/nanopb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4d78bf2dbff06f0540e971677c39641b9057dc57", + "version-semver": "0.4.7", + "port-version": 1 + }, { "git-tree": "230c55c9370ee3756674be33a6d5740ff04fccda", "version-semver": "0.4.7",