Skip to content
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

[Feature Request] [macOS] Improved support for app bundles on Mac #1780

Open
shinra-electric opened this issue Jan 27, 2025 · 2 comments
Open

Comments

@shinra-electric
Copy link

shinra-electric commented Jan 27, 2025

Background

At the moment, OpenXRay only provides CLI builds for macOS. However, app bundles are preferable on Mac.

I maintain a script for macOS that will perform the following actions:

  • Install Homebrew and the required dependencies
  • Clone the OpenXRay repo recursively
  • Compile
  • If detected, copy the Call of Pripyat game data to the Application Support folder
  • Copy /res/fxgame.ltx and /res/gamedata/ to the game data folder in Application Support (I don't know if openxray_plus.ltx is required or not)
  • Create an app bundle structure
    • Copy the exe and libraries to the appropriate places in the bundle
    • Fix the rpath on the exe for several dylibs
    • Create Info.plist and Pkginfo files
    • Get an icon from macosicons.com

This script works well for those who can/will compile from source themselves. But it has an issue that should be addressed before a general release.

Issue

The problem is the step where /res/fxgame.ltx and /res/gamedata/ should be copied from the source to the application support folder.

If OpenXRay released an app bundle, the installation scenario should be:

  • User downloads app bundle
  • If the user runs it without game data in the app support folder, a popup tells them to copy the game data there.
  • The user buys the game off steam or gog or wherever, and copies the game data over
  • The game should now run

It's not reasonable to expect the user to download the repo and copy /res/fxgame.ltx and /res/gamedata/ over.

Potential solution

Ideally fxgame.ltx and gamedata/ should be distributed within the app bundle. But this would mean that the game knows where to look for them, and that they might not be in the game data folder in application support.

The structure of the app bundle should look like this:

OpenXRay.app/
        |
        - Contents/
                |
                - libs/
                        - All the dylibs and .a files go here
                |
                - MacOS/
                        -  The xr_3da executable goes here
                |
                - Resources/
                        - The .icns file and any additional resource files go here 
                |
                - Info.plist
                |
                - Pkginfo

Note: libs above is usually called Frameworks, but I use dylibbundler which creates a libs folder by default. Doesn't affect anything.

My suggestion is for the game to first search for fxgame.ltx and gamedata in the game data folder ~/Library/Application Support/GSC Game World/S.T.A.L.K.E.R. - Call of Pripyat/, and if is not found then search in ../Resources

@WhoKnowscs
Copy link

https://www.macsourceports.com/game/stalkercop

MacSourcePorts just added a Mac compiled Bundle. Build Date Feb. 1,

It won't likely get updated every change but at least it's a start.

As for where game data is located you can always try see if you can drop the app bundle in the folder with the data and see if it works.

@shinra-electric
Copy link
Author

This issue applies to the MSP port too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

3 participants