summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2022-04-19 21:06:53 -0400
committerIonen Wolkens <ionen@gentoo.org>2022-04-19 22:39:39 -0400
commit92a9da73390b1f2d90011e6b6a6fa8cf25512cec (patch)
treebad1a7875c1fdedb11f81429ec329cbac78d3d62 /dev-libs/ncnn
parentmedia-gfx/waifu2x-ncnn-vulkan: subscribe to ncnn subslot and unpin (diff)
downloadgentoo-92a9da73390b1f2d90011e6b6a6fa8cf25512cec.tar.gz
gentoo-92a9da73390b1f2d90011e6b6a6fa8cf25512cec.tar.bz2
gentoo-92a9da73390b1f2d90011e6b6a6fa8cf25512cec.zip
dev-libs/ncnn: add 20220419
Also remove now unnecessary avx workaround wrt bug #730468, entire usage was refactored upstream and the sed now cause issues instead. Bug: https://bugs.gentoo.org/730468 Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-libs/ncnn')
-rw-r--r--dev-libs/ncnn/Manifest1
-rw-r--r--dev-libs/ncnn/ncnn-20220419.ebuild73
2 files changed, 74 insertions, 0 deletions
diff --git a/dev-libs/ncnn/Manifest b/dev-libs/ncnn/Manifest
index c665eea3385d..af280f8884b8 100644
--- a/dev-libs/ncnn/Manifest
+++ b/dev-libs/ncnn/Manifest
@@ -1 +1,2 @@
DIST ncnn-20210525.tar.gz 11578821 BLAKE2B 1b6dc67cb89e4761c6de256c8854c3969c553159c11713d9bbbe04abd027e9439ffb694e8129da4d965807d1ec326d643c71c00ee1f032dbf4c2271c2699ceb2 SHA512 5d919b6830f5a75c751d64476f5bf2b9b71ced1cee29e4156c4f01a9d7d8833dfdf8420747c55979c5b39b29fd63b5bf4bc3d27b756a617ef39f4e2ce4da2f93
+DIST ncnn-20220419.tar.gz 12158924 BLAKE2B 06a3956ecdfff26977707ddab4922897fdee923a13f32c9963a44a6803915380c5feba8e4880e4fd528902121ebe3a1deee0a141d62c17cc9dd0e3542b75e38a SHA512 85c13889ba8f6e1afd8f1127c9de32f962735db2ccc92f29f13771ba2df8b7bd5c156d7f4eec059493904c2634765b0253028861bc99be3a9e8afb9b9d82aa56
diff --git a/dev-libs/ncnn/ncnn-20220419.ebuild b/dev-libs/ncnn/ncnn-20220419.ebuild
new file mode 100644
index 000000000000..da09a4cf9ffd
--- /dev/null
+++ b/dev-libs/ncnn/ncnn-20220419.ebuild
@@ -0,0 +1,73 @@
+# 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="
+ dev-util/glslang
+ tools? ( dev-libs/protobuf:= )
+ vulkan? ( media-libs/vulkan-loader )"
+DEPEND="
+ ${RDEPEND}
+ vulkan? ( dev-util/vulkan-headers )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-fix-glslang-include.patch
+)
+
+DOCS=( README.md docs/. )
+
+src_prepare() {
+ cmake_src_prepare
+
+ sed -i "/DESTINATION/s| lib| $(get_libdir)|" src/CMakeLists.txt || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=ON # for tools
+ -DGLSLANG_TARGET_DIR="${ESYSROOT}"/usr/$(get_libdir)/cmake
+ -DNCNN_BUILD_EXAMPLES=OFF
+ -DNCNN_BUILD_TOOLS=$(usex tools)
+ -DNCNN_PYTHON=OFF # missing portalocker, and nothing needs this for now
+ -DNCNN_SHARED_LIB=ON
+ -DNCNN_SYSTEM_GLSLANG=ON
+ -DNCNN_VERSION=${PV} # avoids libncnn.so.*.%Y%m%d (build date)
+ -DNCNN_VULKAN=$(usex vulkan)
+ )
+
+ cmake_src_configure
+}
+
+src_install() {
+ cmake_src_install
+
+ if use tools; then
+ local tools=(
+ caffe/caffe2ncnn
+ darknet/darknet2ncnn
+ mxnet/mxnet2ncnn
+ ncnn2mem
+ ncnnmerge
+ ncnnoptimize
+ onnx/onnx2ncnn
+ quantize/{ncnn2int8,ncnn2table}
+ )
+ dobin "${tools[@]/#/${BUILD_DIR}/tools/}"
+ fi
+}