blob: 9fd426e2ac5dee26a921d648fcd1a0356886ecab (
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
# Maintainer: Julian Reyes <contacto@julianreyes.co>
# Contributor: Roald Clark <roaldclark@gmail.com>
pkgname=krita-ai-diffusion
pkgver=1.48.0
pkgrel=1
pkgdesc="A plugin to use generative AI in image painting and editing workflows from within Krita"
arch=('any')
url="https://github.com/Acly/krita-ai-diffusion"
license=('GPL-3.0-or-later')
depends=(
'krita'
'python-pyqt5'
'qt5-imageformats'
)
makedepends=(
'git'
'git-lfs'
'uv'
)
checkdepends=(
'openssl'
)
install=krita-ai-diffusion.install
source=("${pkgname}::git+${url}.git#tag=v${pkgver}"
"add-regex-to-requirements.patch")
sha256sums=('304b1f71ff865e340c5b6b23ed9a6ab75bb0ee0f6066583f7db34bdcabaf5040'
'3cdb6f448e78ae8bcfe4427d6a7b44a732b375366aa52dd4aaceb11f328edaf0')
# If `git lfs install` was run before, `makepkg` may error
# Set this env var to resolve
export GIT_LFS_SKIP_SMUDGE=1
prepare() {
# The plugin itself will run inside Krita's embedded Python,
# and only has access to the Python standard library and Qt5
cd "${srcdir}/${pkgname}"
patch -Np1 -i ../add-regex-to-requirements.patch
git submodule update --init --recursive
git lfs install --local
git remote add network-origin "${url}.git"
git lfs fetch network-origin
git lfs checkout
uv venv --python 3.12 .venv
source .venv/bin/activate
uv pip install -r requirements.txt
}
build() {
cd "${srcdir}/${pkgname}"
source .venv/bin/activate
python scripts/package.py
}
check() {
cd "${srcdir}/${pkgname}"
source .venv/bin/activate
if [[ $(vercmp "${pkgver}" "1.21.0") -gt 0 ]]; then
python scripts/download_models.py --minimal scripts/downloads
else
python scripts/download_models.py --minimal scripts/docker/downloads
fi
python -m pytest tests/test_server.py -vs --test-install
python -m pytest tests -vs --ci
}
package() {
cd "${srcdir}/${pkgname}"/scripts/.package
install -d -m 755 "${pkgdir}"/usr/share/krita/pykrita/
cp -r {ai_diffusion,ai_diffusion.desktop} "${pkgdir}"/usr/share/krita/pykrita/
install -D -m 644 ai_diffusion/ai_diffusion.action -t "${pkgdir}"/usr/share/krita/actions/
}
|