summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 580da7e369e5cde17fc5fdedacaa5f5290054ebb (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
# Maintainer: Xesxen <arch@xesxen.nl>
# Contributor: Gaetan Bisson <bisson@archlinux.org>

pkgname=vvvvvv-git
binname=vvvvvv
pkgver=20230402.c88f249f
_pkgver=git
pkgrel=1
pkgdesc='A retro-styled 2D platformer'
arch=('i686' 'x86_64')
url='https://thelettervsixtim.es/'
license=('custom')
depends=('sh' 'sdl2_mixer')
makedepends=('git' 'cmake')
provides=('vvvvvv')
conflicts=('vvvvvv')
source=(
    "git+https://github.com/TerryCavanagh/VVVVVV.git"
    "git+https://github.com/lvandeve/lodepng"
    "git+https://github.com/icculus/physfs/"
    "git+https://github.com/leethomason/tinyxml2/"
    "git+https://github.com/FNA-XNA/FAudio"
    "git+https://github.com/Mashpoe/c-hashmap"
    "${binname}.desktop"
    "${binname}.sh"
    "https://thelettervsixtim.es/makeandplay/data.zip"
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            '8c704e92e6abc8172d7d9fe726f1a0bba4b8630682745d6daf1f34ce12e0e3e4'
            '883913125c4630d16fe0081d9a96bf65f2bc08ace7fa345613669d827a8ea7c1'
            'c767809594f6472da9f56136e76657e38640d584164a46112250ac6293ecc0ea')
install="${pkgname}.install"

pkgver() {
	cd "${srcdir}/VVVVVV"
	git log -1 --format='%cd.%h' --date=short | tr -d -
}

prepare() {
  cd VVVVVV

  echo "Please note: the retrieved data.zip is for personal use only without redistribution"
  echo "See also: /usr/share/licenses/vvvvvv-git/LICENSE.md and https://thelettervsixtim.es/makeandplay/"

  git submodule init
  for submodule in lodepng physfs tinyxml2 FAudio c-hashmap; do
    git config "submodule.third_party/$submodule.url" "$srcdir/$submodule"
  done
  git -c protocol.allow=never -c protocol.file.allow=always submodule update
}

build() {
  cd VVVVVV/desktop_version
  mkdir -p build
  cd build
  cmake ..
  make
}

package() {
  cd ${srcdir}/VVVVVV/desktop_version/build
  install -d "${pkgdir}/opt/${binname}"
  install -D -m644 ../../LICENSE.md "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE.md"
  # Legal: There used to be a separate LICENSE-data.md, but the LICENSE.md also mentions the "Make and Play" edition specifically.
  # We now instead warn the user on build they should not redistribute the package and mention the same on install
  install -m755 ${binname^^} \
    "${pkgdir}/opt/${binname}/${binname}"

  cd ${srcdir}
  install -m644 -t "${pkgdir}/opt/${binname}" \
      data.zip
  install -D -m755 "${srcdir}/${binname}.sh" "${pkgdir}/usr/bin/${binname}"
  install -D -m644 "VVVVVV.png" \
      "${pkgdir}/usr/share/pixmaps/${binname}.png"
  install -D -m644 "${srcdir}/${binname}.desktop" \
      "${pkgdir}/usr/share/applications/${binname}.desktop"
}