From 754b45e09005e8e2a1505fc8b19238d5b52c329e Mon Sep 17 00:00:00 2001 From: Thomas1664 <46387399+Thomas1664@users.noreply.github.com> Date: Tue, 30 Aug 2022 01:37:12 +0200 Subject: [PATCH] [ncnn] New Port (#26557) * [ncnn] Add new port * [ncnn] Add new port * update version * add ncnn options * update vcpkg.json to constraint supported platforms * Add a new final line * update version * Update ports/ncnn/portfile.cmake Co-authored-by: Thomas1664 <46387399+Thomas1664@users.noreply.github.com> * fixed ncnn install error * Update to latest upstream version * Fixup pc files * version * unsupported on Windows arm * version Co-authored-by: holylong Co-authored-by: Jonliu1993 <13720414433@163.com> --- ports/ncnn/portfile.cmake | 29 +++++++++++++++++++++++++++++ ports/ncnn/vcpkg.json | 18 ++++++++++++++++++ versions/baseline.json | 4 ++++ versions/n-/ncnn.json | 9 +++++++++ 4 files changed, 60 insertions(+) create mode 100644 ports/ncnn/portfile.cmake create mode 100644 ports/ncnn/vcpkg.json create mode 100644 versions/n-/ncnn.json diff --git a/ports/ncnn/portfile.cmake b/ports/ncnn/portfile.cmake new file mode 100644 index 0000000000..50b7f19365 --- /dev/null +++ b/ports/ncnn/portfile.cmake @@ -0,0 +1,29 @@ +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO Tencent/ncnn + REF 20220729 + SHA512 0df877ee42edc32faa6891c8b234fc21064b18c1dc8c612b43757daf5f912530f3d015c783e6e199c2884616a88137d10f9c899528000f25e9d0881f028a9586 + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DNCNN_BUILD_TOOLS=OFF + -DNCNN_BUILD_EXAMPLES=OFF + -DNCNN_BUILD_BENCHMARK=OFF + -DNCNN_SHARED_LIB=${BUILD_SHARED} +) + +vcpkg_cmake_install() + +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/ncnn) +vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/ncnn/vcpkg.json b/ports/ncnn/vcpkg.json new file mode 100644 index 0000000000..362a7c90e2 --- /dev/null +++ b/ports/ncnn/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "ncnn", + "version": "20220729", + "description": "ncnn is a high-performance neural network inference computing framework.", + "homepage": "https://github.com/Tencent/ncnn", + "license": "BSD-3-Clause", + "supports": "!(windows & arm)", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index 7d35b5dbbc..0f091f0a0f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4940,6 +4940,10 @@ "baseline": "2.4.6", "port-version": 2 }, + "ncnn": { + "baseline": "20220729", + "port-version": 0 + }, "ncurses": { "baseline": "6.3", "port-version": 1 diff --git a/versions/n-/ncnn.json b/versions/n-/ncnn.json new file mode 100644 index 0000000000..ef0cf20d1f --- /dev/null +++ b/versions/n-/ncnn.json @@ -0,0 +1,9 @@ +{ + "versions": [ + { + "git-tree": "e87afd4b85016896dc6903f9e65e1d239e614b0b", + "version": "20220729", + "port-version": 0 + } + ] +}