diff options
author | Roboron3042 | 2021-01-26 22:07:18 +0100 |
---|---|---|
committer | Roboron3042 | 2021-01-26 22:07:18 +0100 |
commit | a5c097975c4cf75bf8f1f0c99809a6e4c1bbcdea (patch) | |
tree | 28d61aadcca8b1b9931b576875701293f7728dbd | |
download | aur-a5c097975c4cf75bf8f1f0c99809a6e4c1bbcdea.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 42 | ||||
-rw-r--r-- | How to add files and paksets.md | 30 | ||||
-rw-r--r-- | PKGBUILD | 74 | ||||
-rw-r--r-- | config.patch | 46 | ||||
-rw-r--r-- | miniupnpc.patch | 13 | ||||
-rw-r--r-- | path-for-game-data.patch | 26 | ||||
-rw-r--r-- | settings-folder.patch | 12 | ||||
-rw-r--r-- | simutrans-extended.desktop | 9 | ||||
-rw-r--r-- | simutrans-extended.install | 6 |
9 files changed, 258 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d2eb558a6aef --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,42 @@ +pkgbase = simutrans-extended-git + pkgdesc = Transportation simulation game - Extended Version - Nightly build from git + pkgver = r18699.88138df68 + pkgrel = 1 + url = https://www.simutrans.com/ + install = simutrans-extended.install + arch = any + license = custom:Artistic + makedepends = pkgconf + makedepends = git + depends = gcc-libs + depends = zstd + depends = zlib + depends = sdl2_mixer + depends = hicolor-icon-theme + depends = freetype2 + depends = miniupnpc + optdepends = fluidsynth: play MIDI music + optdepends = simutrans-extended-pak128.britain: High resolution graphics set for Simutrans Extended, with a British theme + optdepends = simutrans-extended-pak128.cs: High resolution graphics set for Simutrans Extended, with a czech theme + optdepends = simutrans-extended-pak128.sweden: High resolution graphics set for Simutrans Extended, with a swedish theme + optdepends = simutrans-extended-pak256: Highest resolution graphics set for Simutrans Extended + conflicts = simutrans-extended + source = git+https://github.com/jamespetts/simutrans-extended/ + source = https://raw.githubusercontent.com/aburch/simutrans/8593f5b1248d03f907a149f7abc41ae6512009e1/simutrans.svg + source = settings-folder.patch + source = path-for-game-data.patch + source = config.patch + source = simutrans-extended.desktop + source = miniupnpc.patch + source = How to add files and paksets.md + sha256sums = SKIP + sha256sums = c0c2dd5da146f64901b00c6ee67e0818a166b983a81cee7897c4843aa9f21c81 + sha256sums = 7ed69019ba97849b65e2b8ac5ad8bf2110a7f048e3590d67c76c9cfca8a10b8d + sha256sums = d1609eb40c9bbcdb6f13e10d1150f7995700249053aaa56da8b4a0aaf24f7260 + sha256sums = 0d982430a8e1ca840e03d38e04499c30920ba66e07c6885c70f9e62468302ee1 + sha256sums = 0efcf72d3670c53de99c44cb0d8f43f7e7663fda5df0f631ba6c687cc85967d3 + sha256sums = b62cfde4070e533825b8800738ef191cb144f081ee91a195ca4f5c28cc024538 + sha256sums = 1707b5adff4174af173ac4d7a5cab1fbcda9245e55c0149ed5c3274e7bfc586c + +pkgname = simutrans-extended-git + diff --git a/How to add files and paksets.md b/How to add files and paksets.md new file mode 100644 index 000000000000..16a0ac271e05 --- /dev/null +++ b/How to add files and paksets.md @@ -0,0 +1,30 @@ +# Preserving your game configuration + +To preserve your game config you need to copy `/usr/share/games/simutrans-extended/config/simuconf.tab` to `~/.config/simutrans-extended/simuconf.tab`. Otherwise, the original simuconf.tab file will be **overwrited** with every update. + +Additionally, you can also add non-pakset files (fonts, music, etc) in `~/.config/simutrans-extended` + + +# Adding files in the user data directory (~/.local/share/simutrans-extended) + +Files in this directory are symlinked from: + +1. `/usr/share/games/simutrans-extended` (shared Simutrans Extended installation) +2. `/.local/share/simutrans` (paksets only, which are in turn symlinked from `/usr/share/games/simutrans`) + +This means that the following paksets are already available here: + +1. Paksets installed system-wide for Simutrans Extended. +2. Paksets installed system-wide for Simutrans Standard. +3. Paksets installed for Simutrans Standard by you in `/.local/share/simutrans` + +If you already have Simutrans Standard installed you probably want to keep installing Simutrans Standard paksets in `~/.local/share/simutrans`, while installing Simutrans Extended paksets here in `~/.local/share/simutrans-extended`. + +Adding paksets to these directories is the only way for non-root users to add paksets. You can also add non-pakset files (fonts, music, etc). + +Symlinked files are updated everytime you open the game, so: + +1. Don't worry about deleting symlinks by accident. +2. New paksets installed will be picked up automatically. + +But please **don't replace symlinked files in this directory**. You will lose your replaced files when you open Simutrans! Instead, if you want, for example, to install another version of "pak64" rename it to "pak64-myversion". diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c36b5513d8d6 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,74 @@ +# Maintainer: Roboron <robertoms258 at gmail dot com> + +pkgname=simutrans-extended-git +pkgver=r18699.88138df68 +pkgrel=1 +pkgdesc="Transportation simulation game - Extended Version - Nightly build from git" +arch=('any') +url="https://www.simutrans.com/" +license=('custom:Artistic') +install="simutrans-extended.install" +depends=('gcc-libs' 'zstd' 'zlib' 'sdl2_mixer' 'hicolor-icon-theme' 'freetype2' 'miniupnpc') +makedepends=('pkgconf' 'git') +optdepends=('fluidsynth: play MIDI music' + 'simutrans-extended-pak128.britain: High resolution graphics set for Simutrans Extended, with a British theme' + 'simutrans-extended-pak128.cs: High resolution graphics set for Simutrans Extended, with a czech theme' + 'simutrans-extended-pak128.sweden: High resolution graphics set for Simutrans Extended, with a swedish theme' + 'simutrans-extended-pak256: Highest resolution graphics set for Simutrans Extended') +conflicts=('simutrans-extended') +source=(git+https://github.com/jamespetts/simutrans-extended/ + https://raw.githubusercontent.com/aburch/simutrans/8593f5b1248d03f907a149f7abc41ae6512009e1/simutrans.svg + settings-folder.patch + path-for-game-data.patch + config.patch + simutrans-extended.desktop + miniupnpc.patch + "How to add files and paksets.md") +sha256sums=('SKIP' + 'c0c2dd5da146f64901b00c6ee67e0818a166b983a81cee7897c4843aa9f21c81' + '7ed69019ba97849b65e2b8ac5ad8bf2110a7f048e3590d67c76c9cfca8a10b8d' + 'd1609eb40c9bbcdb6f13e10d1150f7995700249053aaa56da8b4a0aaf24f7260' + '0d982430a8e1ca840e03d38e04499c30920ba66e07c6885c70f9e62468302ee1' + '0efcf72d3670c53de99c44cb0d8f43f7e7663fda5df0f631ba6c687cc85967d3' + 'b62cfde4070e533825b8800738ef191cb144f081ee91a195ca4f5c28cc024538' + '1707b5adff4174af173ac4d7a5cab1fbcda9245e55c0149ed5c3274e7bfc586c') + +prepare() { + cd simutrans-extended + + # Adjust paths + patch -Np0 -i ../settings-folder.patch + patch -Np0 -i ../path-for-game-data.patch + + # Configure the build process + cp config.template config.default + patch -Np0 -i ../config.patch + patch -Np0 -i ../miniupnpc.patch +} + +build() { + cd simutrans-extended + make +} + +package() { + #binary + install -Dm755 simutrans-extended/build/default/simutrans-extended "$pkgdir/usr/bin/simutrans-extended" + + #data + mkdir -p "$pkgdir/usr/share/games/simutrans-extended" + cp -r simutrans-extended/simutrans/* "$pkgdir/usr/share/games/simutrans-extended" + cp -r "How to add files and paksets.md" "$pkgdir/usr/share/games/simutrans-extended" + + #desktop file and icon + install -Dm644 simutrans.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/simutrans-extended.svg" + install -Dm644 simutrans-extended.desktop "$pkgdir/usr/share/applications/simutrans-extended.desktop" + + #license + install -Dm644 simutrans-extended/LICENSE.txt "$pkgdir/usr/share/licenses/simutrans-extended/license.txt" +} + +pkgver() { + cd "$srcdir/simutrans-extended" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} diff --git a/config.patch b/config.patch new file mode 100644 index 000000000000..16802a4ad52e --- /dev/null +++ b/config.patch @@ -0,0 +1,46 @@ +--- config.default.orig 2021-01-22 22:00:17.324949087 +0100 ++++ config.default 2021-01-22 23:32:23.111701888 +0100 +@@ -10,19 +10,19 @@ + + #BACKEND = gdi + #BACKEND = sdl +-#BACKEND = sdl2 ++BACKEND = sdl2 + #BACKEND = mixer_sdl + #BACKEND = posix + + #COLOUR_DEPTH = 0 +-#COLOUR_DEPTH = 16 ++COLOUR_DEPTH = 16 + + #OSTYPE = amiga + #OSTYPE = beos + #OSTYPE = cygwin + #OSTYPE = freebsd + #OSTYPE = haiku +-#OSTYPE = linux ++OSTYPE = linux + #OSTYPE = mingw32 + #OSTYPE = mingw64 + #OSTYPE = mac +@@ -44,10 +44,10 @@ + MULTI_THREAD = 1 # Enable multithreading + + # using freetype for Truetype font support +-USE_FREETYPE = 0 ++USE_FREETYPE = 1 + + # using UPnP for easy server hosting behind routers +-#USE_UPNP = 0 ++USE_UPNP = 1 + + # using zstd compression library + USE_ZSTD = 1 +@@ -57,6 +57,7 @@ + #SDL_CONFIG = sdl-config + #SDL2_CONFIG = sdl2-config + #FREETYPE_CONFIG = freetype-config ++FREETYPE_CONFIG = pkg-config freetype2 + + #VERBOSE = 1 + diff --git a/miniupnpc.patch b/miniupnpc.patch new file mode 100644 index 000000000000..ff13a4172f47 --- /dev/null +++ b/miniupnpc.patch @@ -0,0 +1,13 @@ +--- network/network.cc.orig 2021-01-22 22:00:17.478283377 +0100 ++++ network/network.cc 2021-01-26 18:54:23.557406415 +0100 +@@ -883,8 +883,8 @@ + */ + + extern "C" { +-#include <miniupnpc.h> +-#include <upnpcommands.h> ++#include <miniupnpc/miniupnpc.h> ++#include <miniupnpc/upnpcommands.h> + } + + #if MINIUPNPC_API_VERSION < 14 diff --git a/path-for-game-data.patch b/path-for-game-data.patch new file mode 100644 index 000000000000..5438cce3ffcc --- /dev/null +++ b/path-for-game-data.patch @@ -0,0 +1,26 @@ +--- simmain.cc.orig 2020-12-29 18:02:43.847017475 +0100 ++++ simmain.cc 2020-12-29 18:16:11.362277537 +0100 +@@ -425,6 +425,11 @@ + + env_t::init(); + ++ // Make simutrans extended re-symlinks the files when opened ++#ifdef __linux__ ++ system("\cp -rs --remove-destination /usr/share/games/simutrans-extended/ ~/.local/share/"); ++#endif ++ + // you really want help with this? + if (gimme_arg(argc, argv, "-h", 0) || + gimme_arg(argc, argv, "-?", 0) || +@@ -515,8 +520,9 @@ + strcat( env_t::data_dir, PATH_SEPARATOR ); + } + else { +- strcpy( env_t::data_dir, argv[0] ); +- *(strrchr( env_t::data_dir, PATH_SEPARATOR[0] )+1) = 0; ++ static char buffer[100]; ++ sprintf(buffer, "%s/.local/share/simutrans-extended/", getenv("HOME")); ++ strcpy(env_t::data_dir, buffer); + + #ifdef __APPLE__ + // change working directory from binary dir to bundle dir diff --git a/settings-folder.patch b/settings-folder.patch new file mode 100644 index 000000000000..c66881120a63 --- /dev/null +++ b/settings-folder.patch @@ -0,0 +1,12 @@ +--- sys/simsys.cc.orig 2011-10-28 20:32:25.000000000 +0200 ++++ sys/simsys.cc 2011-11-10 23:09:10.380031846 +0100 +@@ -47,7 +47,7 @@ + #elif defined __APPLE__ + sprintf(buffer, "%s/Library/Simutrans", getenv("HOME")); + #else +- sprintf(buffer, "%s/simutrans", getenv("HOME")); ++ sprintf(buffer, "%s/.config/simutrans-extended", getenv("HOME")); + #endif + + dr_mkdir(buffer); + diff --git a/simutrans-extended.desktop b/simutrans-extended.desktop new file mode 100644 index 000000000000..157e4fedcb62 --- /dev/null +++ b/simutrans-extended.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Simutrans Extended +Comment=Transportation simulator +Exec=simutrans-extended +Icon=simutrans-extended +Terminal=false +Type=Application +Categories=Game;Simulation; + diff --git a/simutrans-extended.install b/simutrans-extended.install new file mode 100644 index 000000000000..0f4dbe1a2827 --- /dev/null +++ b/simutrans-extended.install @@ -0,0 +1,6 @@ +post_install() { + + echo "To play MIDI music, along with fluidsynth, you will need to install a soundfont and set SDL_SOUNDFONTS=/path/to/soundfont" + echo "For example, with soundfont-fluid: SDL_SOUNDFONTS=/usr/share/soundfonts/FluidR3_GM.sf2 simutrans" + echo "Check the wiki to get more info about fluidsynth https://wiki.archlinux.org/index.php/FluidSynth" +} |