blob: 6dd98e111b3e7806772c7038123a6d89863b6ecc (
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# Maintainer: Voylin <voylinslife@gmail.com>
_gitname="GoZen"
_godot_version="4.4.1"
pkgname=gozen-git
pkgver=0
pkgrel=1
pkgdesc="A minimalistic video editor (git)"
arch=('x86_64')
url="https://github.com/VoylinsGamedevJourney/GoZen"
license=('GPL3')
options=('!debug')
makedepends=(
'git'
'scons'
'python'
'gcc'
'pkgconf'
'unzip'
'wget'
'ffmpeg>=6.1'
'yasm'
)
depends=(
'ffmpeg>=6.1'
)
optdepends=(
'x264: for H.264 encoding support via FFmpeg'
'x265: for H.265/HEVC encoding support via FFmpeg'
)
source=(
"git+https://github.com/VoylinsGamedevJourney/GoZen.git"
"godot-editor.zip::https://github.com/godotengine/godot-builds/releases/download/${_godot_version}-stable/Godot_v${_godot_version}-stable_linux.x86_64.zip"
"godot-templates.tpz::https://github.com/godotengine/godot-builds/releases/download/${_godot_version}-stable/Godot_v${_godot_version}-stable_export_templates.tpz"
)
pkgver() {
cd "${srcdir}/${_gitname}"
printf "%s.r%s.g%s" \
"$(git log -1 --format='%cd' --date=format:'%Y%m%d')" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
prepare() {
cd "${srcdir}/${_gitname}"
git submodule update --init --recursive
# Set version in project.godot.
local commit_hash="$(git rev-parse --short HEAD)"
msg "Git build for hash: ${commit_hash}..."
sed -i "s|^config/version\s*=.*|config/version=\"${commit_hash}-git\"|" src/project.godot
# Fix the gozen.gdextension file for system FFmpeg build.
sed -i '/\[dependencies\]/,$d' "src/gozen.gdextension"
# Prepare Godot export templates directory structure.
if [ ! -d ~/.local/share/godot/export_templates/${_godot_version}.stable ]; then
msg "Preparing Godot export templates ..."
mkdir -p "$HOME/.local/share/godot/export_templates/${_godot_version}.stable"
unzip -o -d "$HOME/.local/share/godot/export_templates/${_godot_version}.stable" "${srcdir}/godot-templates.tpz"
mv "$HOME/.local/share/godot/export_templates/${_godot_version}.stable/templates/"* \
"$HOME/.local/share/godot/export_templates/${_godot_version}.stable/"
rmdir "$HOME/.local/share/godot/export_templates/${_godot_version}.stable/templates"
else
msg "Godot export templates found in cache."
fi
# Make Godot editor executable.
chmod +x "${srcdir}/Godot_v${_godot_version}-stable_linux.x86_64"
}
build() {
cd "${srcdir}/${_gitname}"
# Compile GDE GoZen
msg "Compiling GDExtension GoZen..."
cd libs
scons -j$(nproc) platform=linux arch=x86_64 target=template_debug use_system=yes
scons -j$(nproc) platform=linux arch=x86_64 target=template_release use_system=yes
cd ..
msg "Exporting Godot project for Linux..."
mkdir -p "${srcdir}/export_output"
"${srcdir}/Godot_v${_godot_version}-stable_linux.x86_64" \
--import "src/godot.project" --headless
"${srcdir}/Godot_v${_godot_version}-stable_linux.x86_64" \
--headless --path "src" --export-release "Linux_x86_64" \
"${srcdir}/export_output/GoZen.x86_64"
if [ ! -f "${srcdir}/export_output/GoZen.x86_64" ]; then
error "Godot export failed. Check export preset name and paths."
return 1
fi
# Make a different desktop file for the -git build.
sed -i 's/^Name=GoZen$/Name=GoZen-git/' gozen.desktop
}
package() {
cd "${srcdir}/${_gitname}"
# Install application to /opt.
install -d "${pkgdir}/opt/${pkgname}"
# Copy all contents from the export_output directory.
cp -r "${srcdir}/export_output/"* "${pkgdir}/opt/${pkgname}/"
# Ensure executable permissions.
chmod +x "${pkgdir}/opt/${pkgname}/GoZen.x86_64"
# And any .so files if they were copied there.
find "${pkgdir}/opt/${pkgname}" -name '*.so' -exec chmod +x {} \;
# Create a symlink.
install -d "${pkgdir}/usr/bin"
ln -s "/opt/${pkgname}/GoZen.x86_64" "${pkgdir}/usr/bin/${pkgname}"
install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 MANUAL.md "${pkgdir}/usr/share/doc/${pkgname}/MANUAL.md"
install -Dm644 "gozen.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
install -Dm644 "assets/gozen_icon.png" "${pkgdir}/usr/share/icons/hicolor/128x128/apps/${pkgname}.png"
install -Dm644 "assets/logo.svg" "${pkgdir}/usr/share/icons/hicolor/scalable/apps/${pkgname}.svg"
}
sha256sums=('SKIP'
'd6e382fb531019f85630c1f485a561a0d20c4a2344b6c3847735cfee7da812aa'
'7a8d14ade489fd4d22f178193021fe8a876a9e51068ed4dde26dac3ae4c59a88')
|