upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / ft2-clone / repos / community-x86_64 / PKGBUILD
blob7982dab87aebc0688fa14e56b07c2615fd0ef898
1 # Maintainer: George Rawlinson <grawlinson@archlinux.org>
2 # Contributor: Lex Black <autumn-wind@web.de>
3 # Contributor: Alex Gentilucci <alexander.gentilucci@gmail.com>
5 pkgname=ft2-clone
6 pkgver=1.67
7 pkgrel=1
8 pkgdesc='Portable Fasttracker II clone'
9 arch=('x86_64')
10 url='https://16-bits.org/ft2.php'
11 license=(
12   'BSD'
13   'MIT'
14   'custom:CC-BY-NC-SA-4.0'
16 depends=(
17   'glibc'
18   'gcc-libs'
19   'alsa-lib'
20   'sdl2'
21   'flac'
22   'hicolor-icon-theme'
24 makedepends=(
25   'git'
26   'libicns'
27   'cmake'
28   'gendesk'
30 _commit='fdcc53f651378abc003591a8e2371af7d6b393a1'
31 source=(
32   "$pkgname::git+https://github.com/8bitbubsy/ft2-clone#commit=$_commit"
33   'templatify-build-date.patch'
35 b2sums=('SKIP'
36         '530202416c15b7a5b35e0ff56bb633fed97e28d73bc4bfc1737a03098dfa6dfb0aa16751b58b3c7358f27cf7c0052143b752edeabe016a475b72e51f4c027543')
38 pkgver() {
39   cd "$pkgname"
41   git describe --tags | sed 's/^v//'
44 prepare() {
45   cd "$pkgname"
47   # convert icons
48   icns2png -x \
49     release/macos/ft2-clone-macos.app/Contents/Resources/ft2-clone-macos.icns
51   # generate desktop file
52   gendesk -n \
53     --exec "$pkgname" \
54     --name 'Fasttracker II Clone' \
55     --pkgname "$pkgname" \
56     --pkgdesc "$pkgdesc" \
57     --icon "$pkgname" \
58     --genericname 'Chiptune Tracker'
60   # attempt repro build by using commit date as build date
61   local commit_date="$(git show --no-patch --format=%cd --date=format:'%d %B %Y')"
63   # apply template
64   patch -p1 -i "$srcdir/templatify-build-date.patch"
66   # patch in commit date
67   sed -e "s/@DATE@/$commit_date/" -i src/ft2_header.h
70 build() {
71   cmake \
72     -S "$pkgname" \
73     -B build \
74     -DEXTERNAL_LIBFLAC=ON \
75     -DCMAKE_BUILD_TYPE='None' \
76     -DCMAKE_INSTALL_PREFIX='/usr' \
77     -Wno-dev
79   cmake --build build
82 package() {
83   DESTDIR="$pkgdir" cmake --install build
85   cd "$pkgname"
87   # application icon
88   install -vDm644 ft2-clone-macos_512x512x32.png "$pkgdir/usr/share/icons/hicolor/512x512/apps/$pkgname.png"
90   # desktop file
91   install -vDm644 -t "$pkgdir/usr/share/applications" ft2-clone.desktop
93   # documentation
94   install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
96   # licensing
97   install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" release/LICENSES.txt