diff options
-rw-r--r-- | .SRCINFO | 52 | ||||
-rw-r--r-- | How to add files and paksets.md | 20 | ||||
-rw-r--r-- | PKGBUILD | 86 | ||||
-rw-r--r-- | config.patch | 61 | ||||
-rw-r--r-- | path-for-game-data.patch | 28 | ||||
-rw-r--r-- | settings-folder.patch | 11 | ||||
-rw-r--r-- | simutrans-svn.install | 6 | ||||
-rw-r--r-- | simutrans.desktop | 9 |
8 files changed, 273 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ef09e48dbc5a --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,52 @@ +pkgbase = simutrans-svn + pkgdesc = Transportation simulation game - Nightly build from SVN + pkgver = r9588 + pkgrel = 1 + url = https://www.simutrans.com/ + install = simutrans-svn.install + arch = any + license = custom:Artistic + makedepends = subversion + makedepends = pkgconf + 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-pak32.comic: Lowest resolution graphics set for Simutrans + optdepends = simutrans-pak48.excentrique: Low resolution graphics set for Simutrans, with an eccentric theme + optdepends = simutrans-pak64: Low resolution graphics set for Simutrans + optdepends = simutrans-pak64.classic: Low resolution graphics set for Simutrans, resembling the original + optdepends = simutrans-pak64.contrast: Minimalistic, low resolution graphics set for Simutrans + optdepends = simutrans-pak64.german: Low resolution graphics set for Simutrans, with a german theme + optdepends = simutrans-pak64.ho-scale: Resolution graphics set for Simutrans for model train fans + optdepends = simutrans-pak64.japan: Low resolution graphics set for Simutrans, with a japan theme + optdepends = simutrans-pak64.nippon: An alternative japanese low resolution graphics set for Simutrans + optdepends = simutrans-pak64.scifi: Low resolution graphics set for Simutrans, with a SciFi theme + optdepends = simutrans-pak96.comic: Medium resolution graphics set for Simutrans, with a comic style + optdepends = simutrans-pakhd: Hand-drawn graphics set for Simutrans + optdepends = simutrans-pak128: High resolution graphics set for Simutrans + optdepends = simutrans-pak128.britain: High resolution graphics set for Simutrans, with a british theme + optdepends = simutrans-pak128.cs: High resolution graphics set for Simutrans, with a czech theme + optdepends = simutrans-pak128.german: High resolution graphics set for Simutrans, with a german theme + optdepends = simutrans-pak128.japan: High resolution graphics set for Simutrans, with a japan theme + optdepends = simutrans-pak192.comic: Highest resolution graphics set for Simutrans + conflicts = simutrans + source = svn+svn://servers.simutrans.org/simutrans/trunk + source = settings-folder.patch + source = path-for-game-data.patch + source = config.patch + source = simutrans.desktop + source = How to add files and paksets.md + sha256sums = SKIP + sha256sums = 671398550f46525ef0dae338d9e1984bfc0e1ec36153e1c4163c8c35de240c7e + sha256sums = cb9fda1a99d0b54f316ba5ea5b90ec658641f9a9d3b77faf981525e12ff99188 + sha256sums = 0a5fef72b8d4d3fce4454e6411e2b620104b3b0e3f57732873d14b9f51001176 + sha256sums = 99545152f5e739b7eb028152383fa10d3e3d303c99167e1c6e5a6bd7dcd00fa3 + sha256sums = 52a00091a71e250205adcb3ef8b86b560a5c27429ec700c5e5242f58184d90ab + +pkgname = simutrans-svn + diff --git a/How to add files and paksets.md b/How to add files and paksets.md new file mode 100644 index 000000000000..15f10f3a0385 --- /dev/null +++ b/How to add files and paksets.md @@ -0,0 +1,20 @@ +# Preserving your game configuration + +To preserve your game config you need to copy `/usr/share/games/simutrans/config/simuconf.tab` to `~/.config/simutrans/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` + +# Adding files in the user data directory (~/.local/share/simutrans) + +Files in this directory are symlinked from `/usr/share/games/simutrans` (shared Simutrans Standard installation) + +This means that paksets installed system-wide for Simutrans Standard are available here. + +Adding paksets to this directory 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..28a0b24f18d3 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,86 @@ +# Maintainer: Roboron <robertoms258 at gmail dot com> + +pkgname=simutrans-svn +pkgver=r9588 +pkgrel=1 +pkgdesc="Transportation simulation game - Nightly build from SVN" +arch=('any') +url="https://www.simutrans.com/" +license=('custom:Artistic') +install="$pkgname.install" +depends=('gcc-libs' 'zstd' 'zlib' 'sdl2_mixer' 'hicolor-icon-theme' 'freetype2' 'miniupnpc') +makedepends=('subversion' 'pkgconf') +optdepends=('fluidsynth: play MIDI music' + 'simutrans-pak32.comic: Lowest resolution graphics set for Simutrans' + 'simutrans-pak48.excentrique: Low resolution graphics set for Simutrans, with an eccentric theme' + 'simutrans-pak64: Low resolution graphics set for Simutrans' + 'simutrans-pak64.classic: Low resolution graphics set for Simutrans, resembling the original' + 'simutrans-pak64.contrast: Minimalistic, low resolution graphics set for Simutrans' + 'simutrans-pak64.german: Low resolution graphics set for Simutrans, with a german theme' + 'simutrans-pak64.ho-scale: Resolution graphics set for Simutrans for model train fans' + 'simutrans-pak64.japan: Low resolution graphics set for Simutrans, with a japan theme' + 'simutrans-pak64.nippon: An alternative japanese low resolution graphics set for Simutrans' + 'simutrans-pak64.scifi: Low resolution graphics set for Simutrans, with a SciFi theme' + 'simutrans-pak96.comic: Medium resolution graphics set for Simutrans, with a comic style' + 'simutrans-pakhd: Hand-drawn graphics set for Simutrans' + 'simutrans-pak128: High resolution graphics set for Simutrans' + 'simutrans-pak128.britain: High resolution graphics set for Simutrans, with a british theme' + 'simutrans-pak128.cs: High resolution graphics set for Simutrans, with a czech theme' + 'simutrans-pak128.german: High resolution graphics set for Simutrans, with a german theme' + 'simutrans-pak128.japan: High resolution graphics set for Simutrans, with a japan theme' + 'simutrans-pak192.comic: Highest resolution graphics set for Simutrans') + +conflicts=('simutrans') +source=(svn+svn://servers.simutrans.org/simutrans/trunk + settings-folder.patch + path-for-game-data.patch + config.patch + simutrans.desktop + "How to add files and paksets.md") +sha256sums=('SKIP' + '671398550f46525ef0dae338d9e1984bfc0e1ec36153e1c4163c8c35de240c7e' + 'cb9fda1a99d0b54f316ba5ea5b90ec658641f9a9d3b77faf981525e12ff99188' + '0a5fef72b8d4d3fce4454e6411e2b620104b3b0e3f57732873d14b9f51001176' + '99545152f5e739b7eb028152383fa10d3e3d303c99167e1c6e5a6bd7dcd00fa3' + '52a00091a71e250205adcb3ef8b86b560a5c27429ec700c5e5242f58184d90ab') + +prepare() { + cd trunk + + # 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 +} + +build() { + cd trunk + make +} + +package() { + #binary + install -Dm755 trunk/build/default/sim "$pkgdir/usr/bin/simutrans" + + #data + mkdir -p "$pkgdir/usr/share/games/simutrans" + cp -r trunk/simutrans/* "$pkgdir/usr/share/games/simutrans" + cp -r "How to add files and paksets.md" "$pkgdir/usr/share/games/simutrans" + + #desktop file and icon + install -Dm644 trunk/simutrans.svg "$pkgdir/usr/share/icons/hicolor/scalable/apps/simutrans.svg" + install -Dm644 simutrans.desktop "$pkgdir/usr/share/applications/simutrans.desktop" + + #license + install -Dm644 trunk/simutrans/license.txt "$pkgdir/usr/share/licenses/simutrans/license.txt" + +} + +pkgver() { + cd trunk + local ver="$(svnversion)" + printf "r%s" "${ver//[[:alpha:]]}" +} diff --git a/config.patch b/config.patch new file mode 100644 index 000000000000..8b2b131d3bca --- /dev/null +++ b/config.patch @@ -0,0 +1,61 @@ +--- config.default.orig 2020-12-30 13:56:52.910168682 +0100 ++++ config.default 2020-12-30 14:22:16.056031632 +0100 +@@ -12,7 +12,7 @@ + #BACKEND = gdi + #BACKEND = sdl + #BACKEND = sdl2 +-#BACKEND = mixer_sdl ++BACKEND = mixer_sdl2 + #BACKEND = mixer_sdl2 + #BACKEND = posix + +@@ -21,41 +21,41 @@ + #OSTYPE = cygwin + #OSTYPE = freebsd + #OSTYPE = haiku +-#OSTYPE = linux ++OSTYPE = linux + #OSTYPE = mingw + #OSTYPE = mac + + #DEBUG = 1 # Level 1-3, higher number means more debug-friendly but slower, see Makefile + #MSG_LEVEL = 1 # Level 1-4, more runtime debug messages (without only warnings and errors) +-#OPTIMISE = 1 # Add umpteen optimisation flags ++OPTIMISE = 1 # Add umpteen optimisation flags + #PROFILE = 1 # Enable profiling + #PROFILE = 2 # Enable profiling with optimisation flags, can be used with `OPTIMISE = 1' + + #STATIC = 1 # Enable static linkage, currently mingw only + #AV_FOUNDATION = 1 # Use AVFoundation instead of QTKit. If you are using macOS 10.12 or later, this must be enabled. + +-#WITH_REVISION = 1 # adds the revision from svn; required for networkgames ++WITH_REVISION = 1 # adds the revision from svn; required for networkgames + # if you do not use SVN, add -DREVISION="1234" to the FLAGS below + + #WIN32_CONSOLE = 1 # adds a console for windows debugging + +-#MULTI_THREAD = 1 # Enable multithreading ++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 = 0 ++USE_ZSTD = 1 + + # Define these as empty strings, if you don't have the respective config program + #ALLEGRO_CONFIG = allegro-config + #PNG_CONFIG = pkg-config libpng + #SDL_CONFIG = sdl-config + #SDL2_CONFIG = sdl2-config +-#FREETYPE_CONFIG = freetype-config ++FREETYPE_CONFIG = pkg-config freetype2 + + #VERBOSE = 1 + diff --git a/path-for-game-data.patch b/path-for-game-data.patch new file mode 100644 index 000000000000..2c2ecdc236f2 --- /dev/null +++ b/path-for-game-data.patch @@ -0,0 +1,28 @@ +Index: simmain.cc +=================================================================== +--- simmain.cc (revisiĆ³n: 9320) ++++ simmain.cc (copia de trabajo) +@@ -428,6 +428,11 @@ + + env_t::init(); + ++ // Make simutrans re-symlinks the files when opened ++#ifdef __linux__ ++ system("\cp -rs --remove-destination /usr/share/games/simutrans/ ~/.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/", 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..7bb1dfdd9ab3 --- /dev/null +++ b/settings-folder.patch @@ -0,0 +1,11 @@ +--- sys/simsys.cc.orig 2020-05-03 15:03:19.524104943 +0200 ++++ sys/simsys.cc 2020-05-03 15:07:19.544913395 +0200 +@@ -362,7 +362,7 @@ + find_directory(B_USER_DIRECTORY, &userDir); + sprintf(buffer, "%s/simutrans", userDir.Path()); + #else +- sprintf(buffer, "%s/simutrans", getenv("HOME")); ++ sprintf(buffer, "%s/.config/simutrans", getenv("HOME")); + #endif + + // create directory and subdirectories diff --git a/simutrans-svn.install b/simutrans-svn.install new file mode 100644 index 000000000000..0f4dbe1a2827 --- /dev/null +++ b/simutrans-svn.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" +} diff --git a/simutrans.desktop b/simutrans.desktop new file mode 100644 index 000000000000..e8d8660c87f0 --- /dev/null +++ b/simutrans.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=Simutrans +Comment=Transportation simulator +Exec=simutrans +Icon=simutrans +Terminal=false +Type=Application +Categories=Game;Simulation; + |