blob: ecb9948b90cc896e4acac40e5d61cdfe0b18b89f (
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
73
74
75
|
# Maintainer: NF <notfood.dev at gmail dot com>
# Contributor: Oliver Mangold <o.mangold@gmail.com>
# Contributor: Adam Brunnmeier <adam.brunnmeier@gmail.com>
pkgname=blender-4.3-bin
pkgver=4.3.240704.addf1fa84b75
pkgrel=1
pkgdesc="A fully integrated 3D graphics creation suite"
arch=('x86_64')
url="https://www.blender.org"
license=('GPL')
# dependencies copied from https://www.archlinux.org/packages/community/x86_64/blender/
depends=('libxi' 'python' 'libxrender' 'libglvnd' 'hicolor-icon-theme')
makedepends=('wget')
optdepends=('cuda: cycles renderer cuda support' 'python311: use system python')
# use different url per version to trigger rebuilds when package updates.
# using $pkgver instead of $_inc is not possible (see comments on AUR-website)
_webpage="daily.$(date '+%y%m%d').html"
source=("$_webpage::https://builder.blender.org/download/")
md5sums=('SKIP')
_setvars() {
cd "$srcdir"
_upstreamversion=$(echo $pkgname | cut -d '-' -f2)
local regex="blender-${_upstreamversion}[^-]*[^\+]+\+([^.]+).([^-]+)-linux.x86_64-release.tar.xz" && [[ $(cat $_webpage) =~ $regex ]]
_full=${BASH_REMATCH[0]}
_branch=${BASH_REMATCH[1]}
_commit=${BASH_REMATCH[2]}
local regex="$_commit-linux.*?([0-9]{4}-[0-9]+-[0-9]+T[0-9]+:[0-9]+:[0-9]+\+[0-9]+:[0-9]+)" && [[ $(cat $_webpage) =~ $regex ]]
_date=$(date --date="${BASH_REMATCH[1]//,}" "+%y%m%d")
}
pkgver() {
_setvars
printf "$_upstreamversion.$_date.$_commit"
}
build() {
_setvars
cd "$srcdir"
wget -nc "https://builder.blender.org/download/daily/$_full"
tar -xJ -f "$_full"
cd "${_full%.tar.xz}"
# Remove included python installation if the right version is available. (requires 3.11 as 2024-07-01)
[ -f /usr/bin/python3.11 ] && rm -rf "$_upstreamversion/python"
sed -i "s/=blender/=blender-$_upstreamversion/" blender.desktop
sed -i "s/=Blender/=Blender-$_upstreamversion/" blender.desktop
#for f in datafiles/icons/*/apps/blender.* ; do chmod 644 $f && mv $f "${f%.*}-$_upstreamversion.${f#*.}" ; done
echo -n "[Thumbnailer Entry]
TryExec=blender-$_upstreamversion-thumbnailer
Exec=blender-$_upstreamversion-thumbnailer %u %o
MimeType=application/x-blender;
" > blender.thumbnailer
echo -e "#!/bin/bash\nLD_LIBRARY_PATH=/usr/share/blender/$_upstreamversion/lib exec /usr/share/blender/blender-$_upstreamversion \$@" > blender-$_upstreamversion
echo -e "#!/bin/bash\nLD_LIBRARY_PATH=/usr/share/blender/$_upstreamversion/lib exec /usr/share/blender/blender-softwaregl-$_upstreamversion \$@" > blender-$_upstreamversion-softwaregl
}
package() {
_setvars
cd "$srcdir/${_full%.tar.xz}"
install -Dm644 blender.desktop "$pkgdir/usr/share/applications/blender-$_upstreamversion.desktop"
install -Dm644 blender.thumbnailer "$pkgdir/usr/share/thumbnailers/blender-$_upstreamversion.thumbnailer"
mkdir -p "$pkgdir/usr/share/icons/hicolor/scalable/apps"
install -Dm644 blender.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/blender-$_upstreamversion.svg"
mkdir -p "$pkgdir/usr/share/icons/hicolor/symbolic/apps"
install -Dm644 blender-symbolic.svg "$pkgdir/usr/share/icons/hicolor/symbolic/apps/blender-$_upstreamversion-symbolic.svg"
mkdir -p "$pkgdir/usr/share/blender/"
cp -r $_upstreamversion "$pkgdir/usr/share/blender/$_upstreamversion"
cp -r lib "$pkgdir/usr/share/blender/$_upstreamversion/"
# binaries path workaround
install -Dm755 blender "$pkgdir/usr/share/blender/blender-$_upstreamversion"
install -Dm755 blender-$_upstreamversion "$pkgdir/usr/bin/blender-$_upstreamversion"
install -Dm755 blender-softwaregl "$pkgdir/usr/share/blender/blender-softwaregl-$_upstreamversion"
install -Dm755 blender-$_upstreamversion-softwaregl "$pkgdir/usr/bin/blender-$_upstreamversion-softwaregl"
install -Dm755 blender-thumbnailer "$pkgdir/usr/bin/blender-$_upstreamversion-thumbnailer"
}
|