summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 32a3b912042e45c04b50cebfe83c79e8b739de51 (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
# Maintainer: Alex Gentilucci <alexander.gentilucci@gmail.com>
pkgname=ft2-clone
pkgver=1.00
pkgrel=1
pkgdesc="A portable Fasttracker II clone written in C"
arch=('x86_64')
url="https://16-bits.org/ft2.php"
license=("BSD")
makedepends=("gcc" "libicns" "unzip")
depends=("alsa-lib" "sdl2")
source=("https://16-bits.org/ft2.php" "ft2-clone.desktop")
md5sums=("SKIP" "SKIP")

pkgver() {
  grep -oP "(?<=ft2-clone-v)([0-9]+\.[0-9]+)(?=-code\.zip)" ft2.php | head -n 1
}

prepare() {
  name=$(grep -oE "(ft2-clone-v)([0-9]+\.[0-9]+)(-code\.zip)" ft2.php | head -n 1)
  curl -O "https://16-bits.org/$name"
  unzip $name
}

build() {
  cd "$pkgname-code"
  icns2png -x "release/macos/ft2-clone-macos.app/Contents/Resources/ft2-clone-macos.icns"
  chmod +x "make-linux.sh"
  ./make-linux.sh
}

package() {
  install -D -m 755 "$pkgname-code/release/other/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm644 "$pkgname-code/src/LICENSE.txt" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm644 "ft2-clone.desktop" "$pkgdir/usr/share/applications/ft2-clone.desktop"
  install -Dm644 "$pkgname-code/ft2-clone-macos_256x256x32.png" "$pkgdir/usr/share/pixmaps/ft2-clone.png"
}