* Patch out insecure dependencies and add NixOS instructions
This commit uses `patchelf` to remove the dependency on OpenSSL 1.0,
which is outdated and considered insecure. It replaces this dependency
with libcurl, of which the latest version works just fine.
This should make sure that any distrobution can run the generated binary
out of the box, without needing a dynamically linked placeholder.
I also noticed the game failed to start on my AMD machine, and after looking
through Mesa's Gitlab I found a workaround using an environment variable.
A wrapper bash script that sets this variable and executes the `runner` binary
is created to take care of this automatically.
This commit adds instructions on how to run the game on NixOS as well.
* readme: gramar fixes
* patcher: fix syntax error
* readme: add some codeblocks
This utility patches the official AM2R 1.1 release (Windows) to the fan-made Community Update (Linux).
## Dependencies
The patcher and the installer only require a small amount of dependencies:
The patcher and the installer only require a small amount of dependencies. Note that the Java-related packages (`java`, `jre`, `jdk`) packages are only required for building an Android APK.
Make sure that multilib is enabled, as `lib32-libpulse` is a 32-bit library, and Arch does not enable 32-bit support by default.
Make sure that multilib is enabled, as `lib32-libpulse` is a 32-bit library and Arch does not enable 32-bit support by default.
To enable it, go to `/etc/pacman.conf`, search for `[multilib]`, and make sure that the next two lines are uncommented:
```
[multilib]
@ -13,28 +13,34 @@ Include = /etc/pacman.d/mirrorlist
```
Then install the following dependencies:
`sudo pacman -S --needed unzip sed xdelta3 jre8-openjdk lib32-libpulse`
`sudo pacman -S --needed unzip sed patchelf xdelta3 jre8-openjdk lib32-libpulse`
### Debian (including Ubuntu, Mint, PopOS, etc.)
Make sure that the i386 architecture is enabled for you, as libopenal1 requires the 32-bit version, and Ubuntu does not enable 32-bit support by default.
Make sure you enable the i386 architecture, as `libopenal1` requires the 32-bit version and Ubuntu does not enable 32-bit support by default.
Note that the AppImage will **not** work on NixOS. Please follow the instructions in the manual installation section.
### Red Hat (including Fedora)
`sudo yum unzip sed xdelta java-1.8.0-openjdk`
`sudo yum unzip sed xdelta patchelf java-1.8.0-openjdk`
### Suse
`sudo zypper unzip sed xdelta3 java-1_8_0-openjdk`
`sudo zypper unzip sed xdelta3 patchelf java-1_8_0-openjdk`
## Controllers
In order to be able to use a controller, you *need* the two following packages as well:
In order to use a controller on some distributions, the two following packages are *mandatory*:
- jstest-gtk
- joystick
@ -67,7 +73,8 @@ If for some reason, you are not able to access your phone, you can use the adb (
4. Open a terminal and type `adb devices`. This should show your phone. If it does, type `adb install [path-to-apk]`.
## Manual installation
This section, is if you don't like appimages, or want to run the game natively. Unless you have a very good reason for it, please use the AppImage instead!
Manual installation should not be used without due cause. Unless you have a very good reason for avoiding AppImages, please use the default installation instead!
If you cannot run AM2R after installing the packages, use `ldd` in order to find out which packages are missing.
### Dependencies
As said above, these dependencies are **only** needed if you want to run the game natively.
@ -75,25 +82,20 @@ As said above, these dependencies are **only** needed if you want to run the gam
Make sure that multilib is enabled, as this is a 32-bit application and Arch does not do so by default.
To enable it, go to `/etc/pacman.conf`, search for `[multilib]`, and make sure that both this and the next line are uncommented. After that, install the following packages:
On newer versions (Debian 10+ or Ubuntu 18+) you may have to do the below command instead. Please make sure first, that you neither have `libcurl3` nor `libcurl4` installed.
After installation, the game can be run using the `steam-run` FHS environment. This avoids having to patch the dynamic linker and dynamically linked libraries. You can run it with the following command:
`sudo yum install unzip sed xdelta openal-soft compat-openssl10`
If you cannot run AM2R after installing the packages, use `ldd` in order to find out which packages are missing.
After patching, if you want to launch AM2R via command line, make sure to do it like this: `env "LD_PRELOAD=libcurl.so.3" ./AM2R`.
However, there is also a .desktop file with the above command included (this one has the AM2R logo). You can just double click on that in order to start the game.
Some distributions don't give you any way to install libcurl3 anymore. Should that be the case, try to generate an empty library like so: