Compare commits

...

10 Commits

Author SHA1 Message Date
b27ceb360b Add Jenkinsfile
Some checks failed
gitea/pkg-ncnn-git/pipeline/head There was a failure building this commit
Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
2023-12-21 14:43:57 +08:00
HurricanePootis
a7fd985ad6 Make submodule cloning more like wiki 2023-11-07 13:34:34 -06:00
HurricanePootis
660b36fe8d Forgot the .srcinfo 2023-02-23 01:47:43 -06:00
HurricanePootis
acccdb7414 Improve cmake style 2023-02-23 01:47:10 -06:00
HurricanePootis
42e5cad4f0 Update git module method 2022-10-19 15:46:06 -05:00
HurricanePootis
9205caa327 Forgot the .SRCINFO lol 2022-07-25 17:17:09 -05:00
HurricanePootis
aa14c3c27b Enable building of tools 2022-07-25 17:15:26 -05:00
HurricanePootis
2f47001970 Update PKGBUILD to be more inline with community/ncnn 2022-07-21 12:11:56 -05:00
HurricanePootis
74c72f8f75 Update to include vulkan-headers 2022-04-11 08:58:46 -05:00
HurricanePootis
f7a8c5dcf1 Update to git submodule in source(), and use system glslang 2022-03-24 11:17:22 -05:00
3 changed files with 85 additions and 33 deletions

View File

@ -1,20 +1,24 @@
pkgbase = ncnn-git
pkgdesc = High-performance neural network inference framework optimized for the mobile platform
pkgver = 20210322.r16.gcc8e7a13
pkgrel = 3
pkgver = 20231027.r9.g31e315981
pkgrel = 1
url = https://github.com/Tencent/ncnn
arch = i686
arch = x86_64
arch = aarch64
license = BSD
makedepends = git
makedepends = cmake
makedepends = vulkan-icd-loader
makedepends = protobuf
makedepends = vulkan-headers
depends = glslang
optdepends = protobuf: for onnx2ncnn
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

45
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,45 @@
pipeline {
agent {
label 'aarch64 && archlinux'
}
stages {
stage('Download Config') {
steps {
dir('jenkins-utils') {
git 'https://gitlab.classfun.cn:4443/renegade-project/jenkins-utils'
}
}
}
stage('Cleanup packages') {
steps {
sh 'rm -f *.pkg.tar.*'
}
}
stage('Build') {
steps {
sh 'sudo pacman -Syy'
sh 'makepkg --config jenkins-utils/makepkg-aarch64.conf --syncdeps --force --noconfirm'
}
}
stage('Signature packages') {
steps {
withCredentials([
file(credentialsId: 'gpg-file', variable: 'GPG_FILE'),
string(credentialsId: 'gpg-secret', variable: 'GPG_SECRET')
]) {
sh 'python3 jenkins-utils/sign-pkg.py -d . -k "$GPG_FILE" -p "$GPG_SECRET"'
}
}
}
stage('Upload packages') {
steps {
sh 'python3 jenkins-utils/upload-pkg.py -d . -a aarch64'
}
}
stage('Archive') {
steps {
archiveArtifacts artifacts: '*.pkg.tar.*', fingerprint: true
}
}
}
}

View File

@ -4,19 +4,21 @@
pkgname=ncnn-git
_pkgname=ncnn
pkgver=20210322.r16.gcc8e7a13
pkgrel=3
pkgver=20231027.r9.g31e315981
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' 'vulkan-headers')
optdepends=('protobuf: for onnx2ncnn')
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')
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')
pkgver() {
cd "${srcdir}/ncnn"
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
@ -24,34 +26,35 @@ 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
# fix for system glslang
# sed -i'' 's|#include "glslang/glslang|#include "glslang|' ./src/gpu.cpp
# init submodules
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
}
build() {
cd "${srcdir}/ncnn"
mkdir -p build
cd build
cmake \
cd "${srcdir}"
cmake -S $_pkgname -B build \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE='Release' \
-DNCNN_BUILD_EXAMPLES=OFF \
-DNCNN_VULKAN=ON \
..
make
-DNCNN_SYSTEM_GLSLANG=ON \
-DNCNN_SHARED_LIB=ON \
-DNCNN_ENABLE_LTO=ON \
-DNCNN_STDIO=ON \
-DNCNN_STRING=ON \
-DNCNN_BUILD_TOOLS=1 \
-DGLSLANG_TARGET_DIR=/usr/lib/cmake \
-Wno-dev
cmake --build build
}
package() {
cd "${srcdir}/ncnn/build"
make DESTDIR="${pkgdir}" install
cd "${srcdir}"
DESTDIR="${pkgdir}" cmake --install build
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"
}