2020-04-14 09:41:40 +08:00
|
|
|
# Maintainer: Mitch Bigelow <ipha00@gmail.com>
|
|
|
|
# Contributor: Utkan Güngördü <utkan@freeconsole.org>
|
2021-04-07 01:32:37 +08:00
|
|
|
# Maintainer: Hurricane Pootis <hurricanepootis@protonmail.com>
|
2019-07-20 07:45:04 +08:00
|
|
|
|
|
|
|
pkgname=ncnn-git
|
|
|
|
_pkgname=ncnn
|
2023-11-08 03:34:34 +08:00
|
|
|
pkgver=20231027.r9.g31e315981
|
2022-03-25 00:17:22 +08:00
|
|
|
pkgrel=1
|
2019-07-20 07:45:04 +08:00
|
|
|
pkgdesc="High-performance neural network inference framework optimized for the mobile platform"
|
|
|
|
url="https://github.com/Tencent/ncnn"
|
|
|
|
license=('BSD')
|
2022-03-25 00:17:22 +08:00
|
|
|
depends=('glslang')
|
2022-04-11 21:58:46 +08:00
|
|
|
makedepends=('git' 'cmake' 'vulkan-icd-loader' 'protobuf' 'vulkan-headers')
|
2022-07-22 01:11:56 +08:00
|
|
|
optdepends=('protobuf: for onnx2ncnn')
|
2019-07-20 07:45:04 +08:00
|
|
|
conflicts=('ncnn')
|
|
|
|
provides=('ncnn')
|
2023-12-21 14:43:57 +08:00
|
|
|
arch=('aarch64')
|
2022-03-25 00:17:22 +08:00
|
|
|
source=("git+https://github.com/Tencent/ncnn.git"
|
|
|
|
"git+https://github.com/KhronosGroup/glslang"
|
|
|
|
"git+https://github.com/pybind/pybind11")
|
|
|
|
sha256sums=('SKIP' 'SKIP' 'SKIP')
|
2019-07-20 07:45:04 +08:00
|
|
|
pkgver() {
|
2019-08-04 22:37:41 +08:00
|
|
|
cd "${srcdir}/ncnn"
|
2020-04-14 09:41:40 +08:00
|
|
|
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
|
2019-07-20 07:45:04 +08:00
|
|
|
}
|
|
|
|
|
2020-10-14 22:21:43 +08:00
|
|
|
prepare() {
|
2021-04-07 01:32:37 +08:00
|
|
|
|
2020-10-14 22:21:43 +08:00
|
|
|
cd "${srcdir}/ncnn"
|
|
|
|
|
2022-03-25 00:17:22 +08:00
|
|
|
# init submodules
|
2023-11-08 03:34:34 +08:00
|
|
|
git submodule init
|
|
|
|
git config submodule.glslang.url "$srcdir/glslang"
|
|
|
|
git config submodule.python/pybind11.url "$srcdir/pybind11"
|
|
|
|
git -c protocol.file.allow=always submodule update
|
2020-10-14 22:21:43 +08:00
|
|
|
}
|
|
|
|
|
2019-07-20 07:45:04 +08:00
|
|
|
build() {
|
2023-02-23 15:47:10 +08:00
|
|
|
cd "${srcdir}"
|
|
|
|
cmake -S $_pkgname -B build \
|
2019-08-04 22:37:41 +08:00
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
2022-07-26 06:15:26 +08:00
|
|
|
-DCMAKE_BUILD_TYPE='Release' \
|
2020-02-12 05:07:16 +08:00
|
|
|
-DNCNN_BUILD_EXAMPLES=OFF \
|
2019-08-04 22:37:41 +08:00
|
|
|
-DNCNN_VULKAN=ON \
|
2022-03-25 00:17:22 +08:00
|
|
|
-DNCNN_SYSTEM_GLSLANG=ON \
|
2022-07-22 01:11:56 +08:00
|
|
|
-DNCNN_SHARED_LIB=ON \
|
|
|
|
-DNCNN_ENABLE_LTO=ON \
|
2022-07-26 06:15:26 +08:00
|
|
|
-DNCNN_STDIO=ON \
|
|
|
|
-DNCNN_STRING=ON \
|
|
|
|
-DNCNN_BUILD_TOOLS=1 \
|
2022-03-25 00:17:22 +08:00
|
|
|
-DGLSLANG_TARGET_DIR=/usr/lib/cmake \
|
2023-02-23 15:47:10 +08:00
|
|
|
-Wno-dev
|
|
|
|
cmake --build build
|
2019-07-20 07:45:04 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
package() {
|
2023-02-23 15:47:10 +08:00
|
|
|
cd "${srcdir}"
|
|
|
|
DESTDIR="${pkgdir}" cmake --install build
|
2019-08-04 22:37:41 +08:00
|
|
|
install -Dm644 "${srcdir}/ncnn/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
|
2019-07-20 07:45:04 +08:00
|
|
|
}
|