Skip to content

what about making it cross-platform? #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Helias opened this issue Nov 20, 2022 · 8 comments
Open

what about making it cross-platform? #12

Helias opened this issue Nov 20, 2022 · 8 comments
Labels
help wanted Extra attention is needed On Hold Current not being worked on until someone picks it up

Comments

@Helias
Copy link
Contributor

Helias commented Nov 20, 2022

It does not work on Linux :(
At least, the setup seems a bit odd

moreover you could add a requirements.txt file putting these packages to start openGOALModLauncher.py

  • progressbar
  • pysimpleguid
  • cloudscraper
@dallmeyer
Copy link
Collaborator

@Zedb0T is currently working on making the launcher linux compatible 👍

re: package requirements, we do have this batch script to help with that - we should make a linux equivalent

@Helias
Copy link
Contributor Author

Helias commented Nov 21, 2022

I strongly recommend to use always cross-platform scripts or any kind of file, a requirements.txt is os-independent.
Moreover, if you make it compatible for Linux will be easy to make the docker container, this will make easier the usage instead of running scripts and installing dependencies.

Thanks anyways to make this project and make it compatible with Linux, hope I will be one tester of it and hope to open some PRs to improve it at least for the usage documentation

@Zedb0T
Copy link
Contributor

Zedb0T commented Nov 23, 2022

Yeah for now I am dropping work on this but its to a point that it should be easy to finish if someone has a better understanding of linux than I do and a better development setup.

The repo where I did most of the work is here https://github.com/OpenGOAL-Unofficial-Mods/openGOAL-terminal-launcher

The idea is basically if platform.system() is Linux, then use the binaries that are prepackaged rather then the windows ones that are bundled with the mods. But getting them to execute properly is proving to be a challenge

@Zedb0T Zedb0T added help wanted Extra attention is needed On Hold Current not being worked on until someone picks it up labels Nov 23, 2022
@StevenLares
Copy link

StevenLares commented Feb 20, 2024

It seems that these are the tasks required to make this project Linux compatible:

Pending #58:

  • Convert windows file paths into platform agnostic paths. You can use Python's Pathlib for this.
  • Remove "exe" from executable file path names if the user is on Linux.
  • Migrating methods from windows specific to platform agnostic methods, an example is given in the description for #56 (only launcherUtils.py has this issue)
  • Similar to the previous task, add bash shell commands for Linux or use a platform agnostic alternative (only launcherUtils.py has this issue)
  • Modify the current criteria that autoupdater uses to determine the latest release: currently it only uses latest_release_date but should also account for the user's platform to download the correct executable
  • Use the correct config folder for Linux

Other tasks:

  • Mods must be rebuilt for Linux
  • Mod launcher must be built for Linux and listed as an executable under the github repo's release (so that the autoupdater can download it).
    • Create bash script alternative(s) to the .bat files, and adjust pyinstaller parameters for Linux if needed. This allows the build to be automated
  • Change the build preset (in OG-Mod-Base) to build for Windows and Linux simultaneously. Will increase build times for mod developers but prevents having casual users or maintainers from building it for Linux anyways.

Thankfully, it seems that the project's imports are currently platform agnostic.

I will continue to modify this comment if there are any other tasks.

@Zedb0T
Copy link
Contributor

Zedb0T commented Feb 20, 2024

So, you do need to compile/build the binaries separately for linux entirely. The problem here is we were kind of lazy, and just didnt build 97% of the mods for linux.

Most of the most are based on the OG-Mod-Base upstream, so here we should probably edit the build preset to just build for windows and linux simultaneously. This would increase build times, but remove the ability to be lazy.

https://github.com/OpenGOAL-Mods/OG-Mod-Base

@Zedb0T
Copy link
Contributor

Zedb0T commented Feb 20, 2024

Also another thing to consider - you need to give these executables the proper settings to execute on linux. This is where I got stuck the last time I tried, but I didnt really try for more than 2 days. If your want to spearhead/lead adding support for linux mods, then I'd be happy to provide input and build linux versions of most mods.

@StevenLares
Copy link

Thanks for the prompt reply.

Regarding your offer with building most mods for Linux: that would help if it is not too much of a drain of your time. I am interested in adding Linux support to the launcher.

I have started reading the code base (for the launcher, and OG-Mod-Base) today as well as the faq at https://jakmods.dev/faq.
Please let me know if my understanding of the modding process is correct:

So most of the mods are based on OG-Mod-Base upstream. The mod developers then build the executable using that template. Currently, the build preset is set to Windows (as obviously most users will be playing there. This will also keep build times short). Therefore, mods are individual code bases to build rather than a patch on your existing installation, since OpenGOAL doesn't really have a modding API at the moment.

The launcher relies on JSON files (per game) that are manually maintained to track mods on GitHub. The launcher downloads the release files for the user's chosen mod (including executables, which are typically Windows).

So with the current design, you would need to build Linux versions for all (or at least most) OpenGOAL mods.

Is my understanding of applying mods correct?
If there is something else I can read up on, please let me know.

@Zedb0T
Copy link
Contributor

Zedb0T commented Feb 20, 2024

Yeah thats pretty much it. Mod Base has some unique functions and libraries in its binaries that are not present in the vanilla build (Mostly the sound library) so any mods that relies on these libraries must use custom binaries. Some mods you could probably get away with just grabbing vanilla and using that - but that isnt a proper practice that I'd like to support/encourage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed On Hold Current not being worked on until someone picks it up
Projects
None yet
Development

No branches or pull requests

4 participants