archrelease: copy trunk to community-any
[ArchLinux/community.git] / simutrans / repos / community-x86_64 / PKGBUILD
blob13fba91809885e7c5c693a241017622f31d06326
1 # Maintainer: Balló György <ballogyor+arch at gmail dot com>
2 # Contributor: Anton Bazhenov <anton.bazhenov at gmail>
3 # Contributor: Jaroslav Lichtblau <dragonlord@aur.archlinux.org>
4 # Contributor: Gilles Gagniard <gilles@gagniard.org>
5 # Contributor: JD Steffen <jd at steffennet dot org>
7 pkgname=simutrans
8 pkgver=123.0.1
9 pkgrel=1
10 pkgdesc="Transportation simulation game"
11 arch=('x86_64')
12 url="https://www.simutrans.com/"
13 license=('custom:Artistic')
14 depends=('gcc-libs' 'zlib' 'sdl2' 'libpng' 'bzip2' 'simutrans-pak64' 'hicolor-icon-theme')
15 makedepends=('dos2unix')
16 optdepends=('timidity++: play MIDI music')
17 source=(https://downloads.sourceforge.net/$pkgname/$pkgname-src-${pkgver//./-}.zip
18         https://raw.githubusercontent.com/aburch/simutrans/8593f5b1248d03f907a149f7abc41ae6512009e1/simutrans.svg
19         settings-folder.patch
20         path-for-game-data.patch
21         simutrans.desktop
22         simutrans.appdata.xml)
23 sha256sums=('8deb38c8de41fb5558640cdd4b9b161c38de92c077b3e506f74c34f93214f469'
24             'c0c2dd5da146f64901b00c6ee67e0818a166b983a81cee7897c4843aa9f21c81'
25             '5f009471489583fd48bcce5d4869048d1164423771cfd955840ae995cd6a70ca'
26             '895405df0904e6c245ab5b6e1824a59e0af7a0a0ef5ccb6f69f20b6ab8223092'
27             '99545152f5e739b7eb028152383fa10d3e3d303c99167e1c6e5a6bd7dcd00fa3'
28             'f3d2416de0f725d15b18482c20231228791e65ceeeb7305115a8ea6a2e591dd6')
30 prepare() {
31   # Some files are distributed in DOS format
32   find . -type f -exec dos2unix -q '{}' \;
34   # Adjust paths
35   patch -Np0 -i settings-folder.patch
36   patch -Np1 -i path-for-game-data.patch
38   # Configure the build process
39   cp config.template config.default
41   sed -e 's|\\#define|#define|' -i Makefile
44 build() {
45   make VERBOSE=1 BACKEND=sdl2 OSTYPE=linux
48 package() {
49   #binary
50   install -Dm755 build/default/sim "$pkgdir/usr/bin/simutrans"
52   #data
53   mkdir -p "$pkgdir/usr/share/games"
54   cp -r $pkgname "$pkgdir/usr/share/games/"
56   #desktop file and icon
57   install -Dm644 simutrans.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/simutrans.svg"
58   install -Dm644 simutrans.desktop "$pkgdir/usr/share/applications/simutrans.desktop"
59   install -Dm644 simutrans.appdata.xml "$pkgdir/usr/share/metainfo/simutrans.appdata.xml"
61   #license
62   install -Dm644 simutrans/license.txt "$pkgdir/usr/share/licenses/simutrans/license.txt"