pkg-ncnn-git/PKGBUILD

61 lines
1.7 KiB
Bash
Raw Permalink Normal View History

2020-04-14 09:41:40 +08:00
# Maintainer: Mitch Bigelow <ipha00@gmail.com>
# Contributor: Utkan Güngördü <utkan@freeconsole.org>
# 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
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')
depends=('glslang')
2022-04-11 21:58:46 +08:00
makedepends=('git' 'cmake' 'vulkan-icd-loader' 'protobuf' 'vulkan-headers')
optdepends=('protobuf: for onnx2ncnn')
2019-07-20 07:45:04 +08:00
conflicts=('ncnn')
provides=('ncnn')
arch=('aarch64')
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() {
2020-10-14 22:21:43 +08:00
cd "${srcdir}/ncnn"
# 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 \
-DNCNN_SYSTEM_GLSLANG=ON \
-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 \
-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
}