# Maintainer: George Rawlinson # Contributor: Lex Black # Contributor: Alex Gentilucci pkgname=ft2-clone pkgver=1.67 pkgrel=1 pkgdesc='Portable Fasttracker II clone' arch=('x86_64') url='https://16-bits.org/ft2.php' license=( 'BSD' 'MIT' 'custom:CC-BY-NC-SA-4.0' ) depends=( 'glibc' 'gcc-libs' 'alsa-lib' 'sdl2' 'flac' 'hicolor-icon-theme' ) makedepends=( 'git' 'libicns' 'cmake' 'gendesk' ) _commit='fdcc53f651378abc003591a8e2371af7d6b393a1' source=( "$pkgname::git+https://github.com/8bitbubsy/ft2-clone#commit=$_commit" 'templatify-build-date.patch' ) b2sums=('SKIP' '530202416c15b7a5b35e0ff56bb633fed97e28d73bc4bfc1737a03098dfa6dfb0aa16751b58b3c7358f27cf7c0052143b752edeabe016a475b72e51f4c027543') pkgver() { cd "$pkgname" git describe --tags | sed 's/^v//' } prepare() { cd "$pkgname" # convert icons icns2png -x \ release/macos/ft2-clone-macos.app/Contents/Resources/ft2-clone-macos.icns # generate desktop file gendesk -n \ --exec "$pkgname" \ --name 'Fasttracker II Clone' \ --pkgname "$pkgname" \ --pkgdesc "$pkgdesc" \ --icon "$pkgname" \ --genericname 'Chiptune Tracker' # attempt repro build by using commit date as build date local commit_date="$(git show --no-patch --format=%cd --date=format:'%d %B %Y')" # apply template patch -p1 -i "$srcdir/templatify-build-date.patch" # patch in commit date sed -e "s/@DATE@/$commit_date/" -i src/ft2_header.h } build() { cmake \ -S "$pkgname" \ -B build \ -DEXTERNAL_LIBFLAC=ON \ -DCMAKE_BUILD_TYPE='None' \ -DCMAKE_INSTALL_PREFIX='/usr' \ -Wno-dev cmake --build build } package() { DESTDIR="$pkgdir" cmake --install build cd "$pkgname" # application icon install -vDm644 ft2-clone-macos_512x512x32.png "$pkgdir/usr/share/icons/hicolor/512x512/apps/$pkgname.png" # desktop file install -vDm644 -t "$pkgdir/usr/share/applications" ft2-clone.desktop # documentation install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md # licensing install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" release/LICENSES.txt }