blob: 5ddb1bdd747cea19fbf1a61c607d5810ba4dce37 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
# Maintainer: robertfoster
pkgname=stable-diffusion.cpp-sycl-f32-git
pkgver=r211.10c6501
pkgrel=1
pkgdesc="Stable Diffusion in pure C/C++ (with Intel SYCL GPU optimizations)"
arch=('armv7h' 'aarch64' 'x86_64')
url="https://github.com/leejet/stable-diffusion.cpp"
license=("MIT")
depends=('intel-oneapi-basekit')
makedepends=(
'cmake'
'git'
)
conflicts=("${pkgname%%-git}" 'stable-diffusion.cpp')
conflicts=("${pkgname%%-git}" 'stable-diffusion.cpp')
source=("${pkgname%%-git}::git+${url}"
"git+https://github.com/ggerganov/ggml.git")
pkgver() {
cd "${srcdir}/${pkgname%%-git}"
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
}
prepare() {
cd "${srcdir}/${pkgname%%-git}"
git submodule init
git config submodule.ggml.url "${srcdir}/ggml"
git -c protocol.file.allow=always submodule update
}
build() {
source /opt/intel/oneapi/setvars.sh
cmake \
-B "${srcdir}/build" \
-S "${srcdir}/${pkgname%%-git}" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx \
-DGGML_SYCL=1
cmake --build build
}
package() {
DESTDIR="${pkgdir}" cmake --install "${srcdir}/build"
rm "${pkgdir}/usr/include/"ggml*
install -Dm644 "${srcdir}/${pkgname%%-git}/LICENSE" \
-t "${pkgdir}/usr/share/licenses/${pkgname}"
}
sha256sums=('SKIP'
'SKIP')
|