Update to git submodule in source(), and use system glslang

This commit is contained in:
HurricanePootis 2022-03-24 11:17:22 -05:00
parent 460c04d950
commit f7a8c5dcf1
2 changed files with 25 additions and 21 deletions

View File

@ -1,7 +1,7 @@
pkgbase = ncnn-git
pkgdesc = High-performance neural network inference framework optimized for the mobile platform
pkgver = 20210322.r16.gcc8e7a13
pkgrel = 3
pkgver = 20220216.r35.gaab476f5b
pkgrel = 1
url = https://github.com/Tencent/ncnn
arch = i686
arch = x86_64
@ -9,12 +9,15 @@ pkgbase = ncnn-git
makedepends = git
makedepends = cmake
makedepends = vulkan-icd-loader
makedepends = protobuf
depends = glslang
provides = ncnn
conflicts = ncnn
source = git://github.com/Tencent/ncnn.git
source = vulkansdk-linux-x86_64-latest.tar.gz::https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.exe
source = git+https://github.com/Tencent/ncnn.git
source = git+https://github.com/KhronosGroup/glslang
source = git+https://github.com/pybind/pybind11
sha256sums = SKIP
sha256sums = SKIP
sha256sums = SKIP
pkgname = ncnn-git

View File

@ -4,19 +4,20 @@
pkgname=ncnn-git
_pkgname=ncnn
pkgver=20210322.r16.gcc8e7a13
pkgrel=3
pkgver=20220216.r35.gaab476f5b
pkgrel=1
pkgdesc="High-performance neural network inference framework optimized for the mobile platform"
url="https://github.com/Tencent/ncnn"
license=('BSD')
depends=()
makedepends=('git' 'cmake' 'vulkan-icd-loader')
depends=('glslang')
makedepends=('git' 'cmake' 'vulkan-icd-loader' 'protobuf')
conflicts=('ncnn')
provides=('ncnn')
arch=('i686' 'x86_64')
source=("git://github.com/Tencent/ncnn.git"
"vulkansdk-linux-x86_64-latest.tar.gz::https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.exe")
sha256sums=('SKIP' 'SKIP')
source=("git+https://github.com/Tencent/ncnn.git"
"git+https://github.com/KhronosGroup/glslang"
"git+https://github.com/pybind/pybind11")
sha256sums=('SKIP' 'SKIP' 'SKIP')
pkgver() {
cd "${srcdir}/ncnn"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
@ -24,15 +25,16 @@ pkgver() {
prepare() {
mv $srcdir/1.* $srcdir/latest
export VULKAN_SDK=$srcdir/latest/x86_64
cd "${srcdir}/ncnn"
# init glslang submodule
git submodule update --init --recursive
# init submodules
git submodule init glslang
git config submodule.glslang.url "$srcdir/glslang"
git submodule update
# fix for system glslang
# sed -i'' 's|#include "glslang/glslang|#include "glslang|' ./src/gpu.cpp
git submodule init python/pybind11
git config submodule.python/pybind11.url "$srcdir/pybind11"
git submodule update
}
build() {
@ -43,6 +45,8 @@ build() {
-DCMAKE_INSTALL_PREFIX=/usr \
-DNCNN_BUILD_EXAMPLES=OFF \
-DNCNN_VULKAN=ON \
-DNCNN_SYSTEM_GLSLANG=ON \
-DGLSLANG_TARGET_DIR=/usr/lib/cmake \
..
make
}
@ -51,7 +55,4 @@ package() {
cd "${srcdir}/ncnn/build"
make DESTDIR="${pkgdir}" install
install -Dm644 "${srcdir}/ncnn/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
rm -rf "$pkgdir/usr/include/glslang"
rm -rf "$pkgdir/usr/lib/cmake/OGLCompilerTargets-release.cmake" "$pkgdir/usr/lib/cmake/OGLCompilerTargets.cmake" "$pkgdir/usr/lib/cmake/OSDependentTargets-release.cmake" "$pkgdir/usr/lib/cmake/OSDependentTargets.cmake" "$pkgdir/usr/lib/cmake/SPIRVTargets-release.cmake" "$pkgdir/usr/lib/cmake/SPIRVTargets.cmake" "$pkgdir/usr/lib/cmake/glslangTargets-release.cmake" "$pkgdir/usr/lib/cmake/glslangTargets.cmake"
rm -rf "$pkgdir/usr/lib/libGenericCodeGen.a" "$pkgdir/usr/lib/libMachineIndependent.a" "$pkgdir/usr/lib/libOGLCompiler.a" "$pkgdir/usr/lib/libOSDependent.a" "$pkgdir/usr/lib/libSPIRV.a" "$pkgdir/usr/lib/libglslang.a"
}