blob: 6c91c973364fa08fd9e62be9d87d53667ece11df (
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
|
# Contributor: Dirk Sohler <spam@0x7be.de>
# Maintainer: Dirk Sohler <spam@0x7be.de>
# vim: ts=4:sw=4
pkgname=minetest-game-cdb
pkgver=20240901
pkgrel=1
pkgdesc='Latest version of “Minetest Game” from the Minetest Content Database, but installed system-wide as a regular Arch package.'
url='https://content.minetest.net/packages/Minetest/minetest_game/'
arch=('any')
license=('LGPL-2.1')
depends=('minetest' 'minetest-common')
makedepends=('curl' 'unzip' 'jq')
# Only the icon can have a checksum. The Minetest Game data is pulled from the
# Content Database. The Content Database does not provide a usable checksum.
source=('minetest_cdb_icon.png')
sha256sums=('77883f101d4b46e3ed37bfc6095e1b2143a79ff852c702d6d98509b6d998ca6b')
prepare() {
cdb='https://content.minetest.net'
releases=$(curl "${cdb}/api/packages/Minetest/minetest_game/releases/")
dlpath=$(echo $releases | jq -r '.[0].url')
curl "${cdb}${dlpath}" --output 'minetest-game-cdb.zip'
unzip "${srcdir}/minetest-game-cdb.zip"
}
pkgver() {
date -d "$(echo $releases | jq -r '.[0].release_date')" "+%Y%m%d"
}
build() {
gamepath="${srcdir}/minetest_game"
newtitle="Minetest Game (CDB, ${pkgver})"
sed -i "/^title /s/=.*$/= ${newtitle}/" "${gamepath}/game.conf"
cp "${srcdir}/minetest_cdb_icon.png" "${gamepath}/menu/icon.png"
}
package() {
location='usr/share/minetest/games'
install -d "${pkgdir}/${location}"
cp -r "${srcdir}/minetest_game" "${pkgdir}/${location}/minetest_game"
}
|