summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-libs/ncnn/Manifest1
-rw-r--r--dev-libs/ncnn/ncnn-20220701.ebuild46
2 files changed, 47 insertions, 0 deletions
diff --git a/dev-libs/ncnn/Manifest b/dev-libs/ncnn/Manifest
index ac715a325fcf..38f8273d8755 100644
--- a/dev-libs/ncnn/Manifest
+++ b/dev-libs/ncnn/Manifest
@@ -1 +1,2 @@
DIST ncnn-20220420.tar.gz 12158916 BLAKE2B fcecf395e54ff683bb8301365d805b99439b3797493e419fa8c99a325ebd1dfd80e65b08cffd9283fe453010a0cdde221aeeffa37e154335d2f6d7f6c6b9b138 SHA512 7c567bcd75cf36be7fbb16dba7f978ae965478afed8948e9e1c6f8c681ea678f769e64fae337a5c1d0bc1549bf922c1761b51a7822153a1eb4d267ef8adf1ecd
+DIST ncnn-20220701.tar.gz 12220010 BLAKE2B 3038500683c9ea1634777cb4158aea0d6c6e640cb4a31302b99c546f000fb91f5d75d01328cf35896b7579dc3172512d120612f973ae9881b4f95d101607adcb SHA512 4b7f539213c8f06a426d1633e881ceeabee84b5419e890eaa95447868a511cad8a4528d1e311c87ed322ccabbcfb38cc1725592fb6299ef9be7e068c43bbd0b2
diff --git a/dev-libs/ncnn/ncnn-20220701.ebuild b/dev-libs/ncnn/ncnn-20220701.ebuild
new file mode 100644
index 000000000000..4b8ce607d594
--- /dev/null
+++ b/dev-libs/ncnn/ncnn-20220701.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake
+
+DESCRIPTION="High-performance neural network inference framework"
+HOMEPAGE="https://github.com/Tencent/ncnn/"
+SRC_URI="https://github.com/Tencent/ncnn/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="BSD ZLIB"
+SLOT="0/${PV}" # currently has unstable ABI that often requires rebuilds
+KEYWORDS="~amd64 ~x86"
+IUSE="tools +vulkan"
+
+# Need the static library to run tests + skip vulkan / GPU:
+# -DNCNN_BUILD_TESTS=ON -DNCNN_SHARED_LIB=OFF -DNCNN_VULKAN=OFF
+RESTRICT="test"
+
+RDEPEND="
+ tools? ( dev-libs/protobuf:= )
+ vulkan? (
+ dev-util/glslang
+ media-libs/vulkan-loader
+ )"
+DEPEND="
+ ${RDEPEND}
+ vulkan? ( dev-util/vulkan-headers )"
+
+DOCS=( README.md docs/. )
+
+src_configure() {
+ local mycmakeargs=(
+ -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake
+ -DNCNN_BUILD_EXAMPLES=OFF
+ -DNCNN_BUILD_TOOLS=$(usex tools)
+ -DNCNN_PYTHON=OFF # todo if something needs it
+ -DNCNN_SHARED_LIB=ON
+ -DNCNN_SYSTEM_GLSLANG=ON
+ -DNCNN_VERSION=${PV} # avoids libncnn.so.*.%Y%m%d using build date
+ -DNCNN_VULKAN=$(usex vulkan)
+ )
+
+ cmake_src_configure
+}