Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - edenwaith

#1
For historical documentation purposes, I'm linking this thread to the newer Implementing Steam Achievements for Mac AGS Games post.  Both of these posts provide a lot of the insight, efforts, and pitfalls of getting Steam achievements to work on Mac AGS games in 2024.
#2
This is a follow up post to @TheVolumeRemote's instructions on setting up a Mac game to work with Steam achievements, which is an abridged version of my own blog post.  In case my own site ever goes down or disappears, a copy of the instructions will be here, which I hope will serve as useful steps to implement Steam achievements for a Mac version of an AGS game.

Setup and Configuration

Since I first wrote about porting AGS games to the Mac in 2020, Apple has made another seismic shift with their technology by abandoning Intel processors in favor of their home grown Apple Silicon. Last year I developed a Universal Binary version of the AGS app shell; one step closer to natively supporting the newer processors. However, this was only one major piece of the puzzle, since to truly support the newer platform, any additional components and libraries also need to be rebuilt. There are a number of older AGS games which work with Steam, but I have not seen any which have been entirely constructed as Universal Binaries to run natively on both Intel and Apple Silicon. I surmise that the older games were built for Intel, so when they launch on newer Macs, Rosetta 2 translates the Intel instructions to Apple Silicon. However, if the game shell is a Universal Binary, but third party libraries are still Intel-only, that can cause an issue with trying to run the older software.

The steps:

  • Get a copy of the AGS skeleton app. This is built against AGS 3.6.1 Patch 3 and is a Universal Binary. As of this writing in 2024, 3.6.1 is the current version, but in the future if you want to build a newer version, follow my instructions on Building a Universal Binary Version of Adventure Game Studio for Mac.
  • Set up the app, configure the Info.plist, and copy over the necessary game files. More complete instructions on this step are at Porting Adventure Game Studio Games to the Mac.
  • Download the libagsteam-unified-universal-binary.zip file and unzip it. This archive contains two files, libagsteam-unified.dylib and libsteam_api.dylib. The first file is a rebuilt Universal Binary of the agsteam library which is linked to libsteam_api.dylib (version 1.59 of Steam's dynamic library).
  • Copy libagsteam-unified.dylib and libsteam_api.dylib into the Contents/Resources folder of the app bundle. Make sure that the steam_appid.txt file is also in the Contents/Resources folder alongside the two dylib files.

Entitlements

In Apple's efforts to increase the security of the software running on its platforms, they have layered on numerous measures like Gatekeeper, code signing, notarization, and entitlements over the years.

When trying to enable Steam achievements with a Mac game, it is important to set the proper entitlements so the third party Steam library can communicate with Steam. This is not something limited to games developed with AGS, but with any game that integrates with Steam. This is often the tricky, missing piece that can make getting Steam achievements to trigger so challenging with Mac ports.

When code signing the app bundle and its components, you will need to add the --entitlements flag and the path to your entitlements file. In this example, there are only two necessary keys in the file: com.apple.security.cs.disable-library-validation and com.apple.security.cs.allow-dyld-environment-variables, and both have their values set to true. There are numerous other options which can be added, but these are the only two we need for the purpose of allowing the third party libraries to function properly.

Code: ags
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>com.apple.security.cs.disable-library-validation</key>
        <true/>
        <key>com.apple.security.cs.allow-dyld-environment-variables</key>
        <true/>
</dict>
</plist>

Once your game has been properly built and code signed (more on this below), you can verify the entitlements from the command line:

Code: ags
codesign -d --entitlements - --xml MyGame.app

The returned result should show the path to the app bundle's executable, and if there is an entitlement, it will be displayed in a blob of XML.

Code: ags
Executable=/Users/johndoe/Library/Application Support/Steam/SteamApps/common/MyGame/MyGame.app/Contents/MacOS/AGS
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.cs.disable-library-validation</key><true/><key>com.apple.security.cs.allow-dyld-environment-variables</key><true/></dict></plist>

If you prefer a more visual method of checking the code signature and entitlements of an app bundle, use the excellent program Apparency.

Building

Now for the meat and potatoes to put everything together before testing: code signing and notarization! A lot of these steps were covered in my post Porting Adventure Game Studio Games to the Mac, but these instructions are also more up-to-date and concise.

In the following script, make the necessary substitutions for your game, then run the script in the same folder as your game. I tend to just have the script do the code signing, then I perform the remainder of the steps (archiving the app bundle and so on) from the Terminal, but if this script works for your purposes, go for it!

Code: ags
APP_NAME=MyGame.app # Set to the name of the app bundle
APP_DIR=MyGame.app # Same here
RESOURCES_DIR="${APP_DIR}/Contents/Resources"
MACOS_DIR="${APP_DIR}/Contents/MacOS"
ENTITLEMENTS_PLIST=~/path/to/entitlements.plist # Need to set to the path of the entitlements.plist
CERTIFICATE="Developer ID Application: John Doe (12AB3456CD)" # Set to details of the actual developer certificate
EXECUTABLE_NAME="AGS"
DEVELOPER_EMAIL="john.doe[member=0][/member]example.com"
APP_SPECIFIC_PASSWORD="abcd-efgh-ijkl-mnop" # Need to generate an app-specific password for your game
TEAM_ID="12AB45543C" # only required if your developer account is connected to more than one team

# Clean out any troublesome forks, dot files, etc.
echo "Cleaning out detritus..."
xattr -cr "$APP_NAME"

# Loop through and code sign any dynamic libraries
echo "Code signing dylibs..."
libfile=`find "$APP_NAME" -name '*.dylib'`
while read -r libname; do
	echo "Sign:" $libname
	codesign --deep --force --verify -vvvv --timestamp --options runtime --entitlements "$ENTITLEMENTS_PLIST" --sign "$CERTIFICATE" "$libname"
done <<< "$libfile"

# Code sign the entire application
codesign -s "$CERTIFICATE" --timestamp --options=runtime -f --entitlements "$ENTITLEMENTS_PLIST" --deep --force "$APP_NAME"

# Verify the code signature
codesign --verify --deep --strict --verbose=4 "$APP_NAME"

# Archive the app bundle
ditto -c -k --sequesterRsrc --keepParent *app MG.zip

# Notarize
xcrun notarytool submit ./MG.zip --wait --apple-id "$DEVELOPER_EMAIL" --password "$APP_SPECIFIC_PASSWORD" --team-id "$TEAM_ID" 

# Staple
xcrun stapler staple -v "$APP_NAME"

# Validate
spctl --verbose=4 --assess --type execute "$APP_NAME"


Testing

At this point, it is assumed that you have already set up your project in Steam, added the necessary Steam achievements, and perhaps even have a test build available (which are topics outside the scope of this post).

When testing the achievements, the critical step is to have the Steam client open!. However, the game does not need to be in the location where Steam downloads games (~/Library/Application Support/Steam/SteamApps/common/) during this testing. Launch your game. You should see an initial overlay which says "Access the Steam Community while playing" if you have the Steam client running. Perform an action in the game to trigger the achievement. If all goes well, you should hear the "blip" chime and an overlay to indicate which achievement was earned (although I don't always see an overlay appear). If that happened, then everything is working and you are good to go!

Except...

Things are rarely that easy, are they? In my own tests, I did a lot of testing and ended up with a lot of frustrating nothing. There were times where I ended up launching the game from the Mac Terminal via a command like ./MyGame.app/Contents/MacOS/AGS and then inspected the output which could give clues to why Steam achievements were not working. In several cases I did see various warnings where the necessary libraries could not get loaded properly, either due to the wrong computer architecture (Intel vs. Apple Silicon), or the linked libraries were not compatible with each other, or a library was built with too new of a system. Further details of these types of issues will be in a follow-up post.

If you are doing some testing of your game and need to reset your achievements, Steam has some nice functionality built into its client with a console. To open up the console in the Steam client, go to your web browser and type steam://open/console or from the Terminal, type:
Code: ags
open steam://open/console

A couple of useful console commands are available to reset achievements. You will need the Application ID of the game, which can be found in the steam_appid.txt file. If that text file is not in the app bundle, you can go to the Steam Store and search for a game. The number in the page's URL should be the application ID (e.g. 2215540).

To reset all achievements:

Code: ags
reset_all_stats <application ID>

Example:

Code: ags
reset_all_stats 2215540

To reset a specific achievement:

Code: ags
achievement_clear <application ID> <achievement name>

Example:

Code: ags
achievement_clear 2215540 OnlyJustBegun

To find the name of achievements in a game, go to SteamDB, search for the game, then click on Achievements. This page shows the API and display names of the game's achievements. The API name serves as the achievement name.

You might need to restart the Steam client to see the updated achievements list.
#3
@eri0o I created a Universal Binary of v0.2.0 of your plug-in and popped it into a Mac version of an AGS game.  I tested out the functionality and it WORKS!

Thank you again for your amazing quick turn around and responsiveness.  I'm very happy that this now works well for the Mac, and now it has no dependencies on the SDL library.
#4
Thanks for the quick turn around!  I probably should create some new Mac shells, built from 3.6.2.  I tend to create a build using CMake, but I've also created a build using Xcode, and that one includes the SDL2.framework, instead of just building it into the binary (that's what I'm assuming is happening).

You mentioned having to fix rpath, something I've been digging into quite a bit lately in trying to figure out how to get dylibs to work with AGS on the Mac, and ensuring that the libraries are found and linked properly.

Here is the errors I'm seeing from my debugging info when the game launches and is trying to load up the libagsappopenurl.dylib on an Intel-based Mac:

Code: ags
Lookup Dir: '/Users/username/Programs/Mac/MyGame.app/Contents/Resources/'
libname 'agsappopenurl' | libfile 'libagsappopenurl.dylib'
Try library path: libagsappopenurl.dylib
dlopen error: dlopen(libagsappopenurl.dylib, 1): Library not loaded: @rpath/libSDL2-2.0.dylib
  Referenced from: /Users/username/Programs/Mac/MyGame.app/Contents/Resources/libagsappopenurl.dylib
  Reason: image not found
Try library path: ./libagsappopenurl.dylib
dlopen error: dlopen(./libagsappopenurl.dylib, 1): Library not loaded: @rpath/libSDL2-2.0.dylib
  Referenced from: /Users/username/Programs/Mac/MyGame.app/Contents/Resources/libagsappopenurl.dylib
  Reason: image not found
Try library path: /Users/username/Programs/Mac/MyGame.app/Contents/Resources/libagsappopenurl.dylib
dlopen error: dlopen(/Users/username/Programs/Mac/MyGame.app/Contents/Resources/libagsappopenurl.dylib, 1): Library not loaded: @rpath/libSDL2-2.0.dylib
  Referenced from: /Users/username/Programs/Mac/MyGame.app/Contents/Resources/libagsappopenurl.dylib
  Reason: image not found
Plugin 'agsappopenurl' could not be loaded (expected 'libagsappopenurl.dylib'), trying built-in plugins...
Placeholder functions for the plugin 'agsappopenurl' found.

Quote from: eri0o on Wed 21/08/2024 19:50:55
Spoiler
@edenwaith I wrote a version of the plugin that doesn't depend on SDL2 in macOS, can you test it ?

It's here: https://cirrus-ci.com/task/6084764296282112

If it works for you I am going to rewrite for Linux and Windows too and rerelease the plugin. Thanks!

NOTE: in the link above I hardcoded the encoding as ASCII, I am trying to figure it out if I can figure the encoding of the AGS game from the plugin API somehow.

The build in the CI newer after this is using UTF-8 as encoding. I am trying to figure if there's some way to figure this from the game. I noticed the SDL version instead assumes arbitrary encodings so it may be useful to reimplement this myself anyway.
[close]

I ended up fixing the issues and CW pointed me how to detect encoding. Created a new release, just waiting the CI builds to happen...
#5
I encountered a bug with the Mac version of this plug-in (works fine with the Windows version).  The error did mention trying to find a SDL library, which I think it built into the version of the AGS shell I create (currently built from 3.6.1 Patch 3).  I will need to get the specific error I encountered to see if it makes more sense why it is not working.

Quote from: eri0o on Sun 26/02/2023 19:49:20A small plugin to open URL in a browser, made for AGS 3.6.0 and beyond. (the plugin uses SDL2, so if you are using a previous version of ags, you have to add SDL2 somewhere)

The idea is to use this plugin instead of the agsshell plugin - for safety reasons and better cross-platform support. It uses SDL2 behind the scenes, so it can't run in older versions of AGS. (well you would have to add SDL2 somewhere if using an old ags version)
#6
Thanks, I'll give that a try.  I'm taking a look at other games (not even all of them developed using AGS), and the lack of the linked reference to the dylib had me a little concerned.  But I'm delving down a deep rabbit hole here, so these might be blind guesses in what is necessary and what is not.

As an aside, when I built the AGS Mac shell with Xcode, I did see the AGS executable did connect up to the libsteam_api.dylib when I had added and linked that library up in Xcode.  One major difference between the Xcode and cmake builds is that SDL is added as a framework with the Xcode build.  I'm guessing that cmake integrates the various libraries (SDL, ogg, vorbis, etc.) directly into the executable.
#7
I'm looking into how I can modify the Cmake build process to create a Mac shell app (AGS.app), but also be able to extend it a bit by linking a third party library (in this case, libsteam_api.dylib).

When I run "otool -L" against the executable in a Mac bundle for other games which link against libsteam_api.dylib, I will see a line like this:

@loader_path/libsteam_api.dylib (compatibility version 1.0.0, current version 1.0.0)

I came across some documentation (https://github.com/adventuregamestudio/ags/wiki/Adding-third%E2%80%90party-libraries-to-the-project) which looked promising, unfortunately the Mac section on how to do this hasn't been completed yet. (shrug)

I'm hoping this process is relatively straightforward by playing the dylib in an appropriate folder, add something like a -L option and the appropriate name and path, and also being able to copy the dylib into the app bundle would also be a bonus.  I'm not overly familiar with how everything is put together, so I'm looking for guidance on the necessary files to update for this task.
#8
I think that @TheVolumeRemote's approach here includes the kitchen sink, now we need to scale down to figure out what is truly necessary while being able to preserve the Steam achievement functionality.

I still suspect that the only keys we need to enable in the entitlements.plist file are com.apple.security.cs.allow-dyld-environment-variables and com.apple.security.cs.disable-library-validation.  Those are the two keys I have often seen mentioned.  When I looked at Valve's Steam example (steamworksexample), those were also the two Hardened Runtime options selected (Allow DYLD Environment Variables and Disable Library Validation).

I'm doing some additional dividing into how the skeleton AGS app and executable are build and ensuring that they are properly built and linked against the Steam dylib.
#9
Thank you for making that fix for moving the location of where the warnings.log file is written for certain platforms (e.g. macOS).  This was causing an issue with some Debug Mac builds where that log file would get created inside the app bundle's Resources folder, which can cause issues if the app was code signed (since the app bundle should not be modified).  I'll definitely verify this change with some games I'm porting to ensure that things are working as I'm hoping!
#10
Thanks, Hobbes for mentioning that you've gotten the AGS Editor to run on the Mac.  I'll need to give that a shot at some point.

Fortunately, porting AGS games to the Mac isn't overly complicated and doesn't require the AGS Editor to do so.  (The most complicated part is probably the code signing and notarization.)
#11
I noticed that there are versions available for Windows and Linux, but not for Mac.  On a Facebook post announcing this game, another person lamented that there wasn't a Mac version available.

Fortunately, I have ported a number of AGS games to the Mac, so I spent a couple of minutes to put together a proof of concept, and got a Mac version up and running in about five minutes.  Let me know if you'd like a more official version of a Mac port.

[imgzoom]http://www.edenwaith.com/images/misc/KQ4-Retold-Mac.png[/imgzoom]
#12
After consulting with my wise rubber duck, I believe I have solved the problem.  The previous build of the Mac AGS shell app was likely a debug build, so Allegro thought that writing a log file into the app bundle's Resource folder was a good idea (it wasn't).  I followed the build instructions using CMake at this post (https://www.adventuregamestudio.co.uk/forums/index.php?topic=47264.msg636611972#msg636611972) and wrote up a small script and ran that from the ags-release-3.5.0 directory.  I have code signed the app and run it, and it appears that the allegro.log file is no longer appearing, so this looks promising now.
#13
I wouldn't be surprised if there was some debug setting in Allegro.

Here's an example of what is being written to the allegro.log:

Code: ags
al-main INFO: Allegro initialised (instance 1)
al-gfx INFO: Called set_gfx_mode(1129268812, 356, 200, 0, 0).
al-gfx INFO: First call, remembering console state.
al-gfx INFO: The driver will wait for vsync.
al-gfx INFO: set_gfx_card success for 356x200x32.
al-osxgl INFO: OpenGL Version: 2.1 INTEL-12.10.24
al-osxgl INFO: Vendor: Intel Inc.
al-osxgl INFO: Renderer: Intel(R) Iris(TM) Pro Graphics 6200
al-gfx INFO: Called set_gfx_mode(-1, 0, 0, 0, 0).
al-gfx INFO: Closing graphics driver (0x1009feb90) Cocoa GL full.
al-gfx INFO: Closing, restoring original console state.
al-gfx INFO: Graphic mode closed.


Quote from: Crimson Wizard on Tue 08/12/2020 04:09:15
I could be mistaken, but I thought allegro.log is only written if you compiled engine in Debug configuration or using debug version of allegro library. Could you double check that you are using a release build?

What kind of messages that log contains?

PS. AGS itself does not control that behavior.
#14
An issue I just encountered with the 3.5 build of AGS is that an allegro.log file is being written inside of a Mac's app bundle when the game launches.  Is there a way to disable this with the acsetup.cfg file, or is this something with Allegro that needs to be changed so it stops writing to the allegro.log file?  This is causing major problems since it breaks the code signing of the app if something changes within the app bundle.

Quote from: morganw on Sun 26/07/2020 12:05:16
As far as I know, you need to be using the newer (and custom) Allegro version from the repository in order to have the colours work correctly:
https://github.com/adventuregamestudio/lib-allegro/tree/allegro-4.4.3.1-agspatch

One issue I struggled to test is whether the signing for an app bundle is invalidated when the game data file changes:
https://github.com/adventuregamestudio/ags/pull/1083#issuecomment-650588478
I don't suppose you know the answer?
#15
Thanks for the tip, Morgan, I'll make sure to update allegro.

Code signing (and app notarization) is the last step you want to perform.  If you modify the app bundle after it has been code signed, that will invalidate the signing.  However, it is possible to build the app and then code sign once you have the completed bundle.  Of the AGS games I've ported (and other projects), it is possible to manually code sign the app so Xcode (or even the source code) is not necessary.

Quote from: morganw on Sun 26/07/2020 12:05:16
As far as I know, you need to be using the newer (and custom) Allegro version from the repository in order to have the colours work correctly:
https://github.com/adventuregamestudio/lib-allegro/tree/allegro-4.4.3.1-agspatch

One issue I struggled to test is whether the signing for an app bundle is invalidated when the game data file changes:
https://github.com/adventuregamestudio/ags/pull/1083#issuecomment-650588478
I don't suppose you know the answer?
#16
OK, finally got everything built.  I believe the final issue was the Makefile had some issues because I edited it by hand when the native version of sed didn't work properly to replace "10.7" with "10.14" and I ended up fat fingering a few values.  After properly swapping out "10.7" for "10.14", things built.

- Chad
#17
I'm starting to make some progress.  A couple of things which were causing issues on my machine.

1. I upgraded my version of homebrew, which required its own amount of fixing permissions on the /usr/local directory.
2. I've been using macOS/Mac OS X since the 10.0 beta days, so there are still some hidden remains of the tcsh shell (even though my shell is currently set to Bash), which might have been causing some of the issues.  I ended up downloading iTerm, and this seems to be more successful in running "make install".
3. I was missing several tools, such as pkg-config, etc. so I ended up running this command:
Code: ags
brew install curl pkg-config autoconf automake libtool


After running
Code: ags
make install
, it is progressing much further now, but it is still failing.  It appears there is a code signing issue (a perpetual bane of my programming existence):

Code: ags
        /usr/bin/codesign --force --sign - --entitlements /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/CMAKE_TRY_COMPILE.build/Debug/cmTC_67420.build/cmTC_67420.xcent --timestamp=none /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420
    /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420: No such file or directory
    Command /usr/bin/codesign failed with exit code 1

    ** BUILD FAILED **


    The following build commands failed:
    	Ld /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420 normal x86_64
    	CodeSign /Users/edenwaith/Programs/ags/AGS-macOS-3.5.0/ags-release-3.5.0/OSX/buildlibs/build/allegro-4.4.2/build/CMakeFiles/CMakeTmp/Debug/cmTC_67420
    (2 failures)


Any thoughts on was is missing here now?  Hmm...

Regards,

Chad


Quote from: Dennis Ploeger on Tue 05/05/2020 07:14:38
Hey chad!

Thanks, happy to help. :)

Ah, I'm sorry. I guess, I used the GNU sed version I installed with Homebrew for the command. BSD's sed, which is installed by default on macOS has no case-insensitive search. But actually, that isn't needed anyways. I updated my post with the correct command. Perhaps you can try to rerun the command?

However, I can not reproduce the error you're getting. I get past that checkenv.sh and later get errors around a missing freetype library:

Code: ags

~/Downloads/ags-v.3.5.0.24/OSX/buildlibs âžœ  make install  
cd /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc && ./download.sh

allegro-4.4.2.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/allegro-4.4.2.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 4565k  100 4565k    0     0  1002k      0  0:00:04  0:00:04 --:--:-- 1177k

dumb-0.9.3.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/dumb-0.9.3.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  163k  100  163k    0     0  74225      0  0:00:02  0:00:02 --:--:-- 74225

libogg-1.3.2.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libogg-1.3.2.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  537k  100  537k    0     0   156k      0  0:00:03  0:00:03 --:--:--  156k

libvorbis-1.3.5.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libvorbis-1.3.5.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1600k  100 1600k    0     0   481k      0  0:00:03  0:00:03 --:--:--  481k

libtheora-20150828-gfbb2758.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtheora-20150828-gfbb2758.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  996k  100  996k    0     0   157k      0  0:00:06  0:00:06 --:--:--  224k

libtheora-20160525-g50df933.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtheora-20160525-g50df933.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  958k  100  958k    0     0   269k      0  0:00:03  0:00:03 --:--:--  269k

libtremor-20150108-r19427.tar.bz2: https://s3-ap-southeast-2.amazonaws.com/ags-shared/libtremor-20150108-r19427.tar.bz2

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  122k  100  122k    0     0  49498      0  0:00:02  0:00:02 --:--:-- 49478

lua-5.1.5.tar.gz: https://s3-ap-southeast-2.amazonaws.com/ags-shared/lua-5.1.5.tar.gz

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  216k  100  216k    0     0  93654      0  0:00:02  0:00:02 --:--:-- 93654
allegro-4.4.2.tar.gz: OK
dumb-0.9.3.tar.gz: OK
libogg-1.3.2.tar.gz: OK
libtheora-20150828-gfbb2758.tar.bz2: OK
libtheora-20160525-g50df933.tar.bz2: OK
libtremor-20150108-r19427.tar.bz2: OK
libvorbis-1.3.5.tar.gz: OK
lua-5.1.5.tar.gz: OK
./checkenv.sh
mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt
mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
tar xf /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/lua-5.1.5.tar.gz -C /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
cd /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build/lua-5.1.5 && \
		patch -p1 < /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../patches/lua-5.1.5.patch && \
		make macosx INSTALL_TOP="/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt" PLAT_LDFLAGS="-mmacosx-version-min=10.14 -arch x86_64" PLAT_CFLAGS="-mmacosx-version-min=10.14 -arch x86_64" && \
		make install INSTALL_TOP="/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt"
patching file src/Makefile
cd src && /Applications/Xcode.app/Contents/Developer/usr/bin/make macosx
/Applications/Xcode.app/Contents/Developer/usr/bin/make all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-lreadline"
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lapi.o lapi.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lcode.o lcode.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldebug.o ldebug.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldo.o ldo.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldump.o ldump.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lfunc.o lfunc.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lgc.o lgc.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o llex.o llex.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lmem.o lmem.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lobject.o lobject.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lparser.o lparser.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstate.o lstate.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstring.o lstring.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltable.o ltable.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltm.o ltm.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lundump.o lundump.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lvm.o lvm.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lzio.o lzio.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lauxlib.o lauxlib.c
lauxlib.c:577:61: warning: while loop has empty body [-Wempty-body]
   while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ;
                                                            ^
lauxlib.c:577:61: note: put the semicolon on a separate line to silence this warning
1 warning generated.
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ldblib.o ldblib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o liolib.o liolib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lmathlib.o lmathlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o loslib.o loslib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o ltablib.o ltablib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o loadlib.o loadlib.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o lstrlib.o loadlib.o linit.o	# DLL needs all object files
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o lua.o lua.c
gcc -o lua  -mmacosx-version-min=10.14 -arch x86_64 lua.o liblua.a -lm -lreadline
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o luac.o luac.c
gcc -O2 -Wall -DLUA_USE_LINUX -mmacosx-version-min=10.14 -arch x86_64   -c -o print.o print.c
gcc -o luac  -mmacosx-version-min=10.14 -arch x86_64 luac.o print.o liblua.a -lm -lreadline
cd src && mkdir -p /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/bin /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/include /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/man/man1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/share/lua/5.1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib/lua/5.1
cd src && install -p -m 0755 lua luac /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/bin
cd src && install -p -m 0644 lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/include
cd src && install -p -m 0644 liblua.a /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/lib
cd doc && install -p -m 0644 lua.1 luac.1 /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/opt/man/man1
tar xf /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/freetype-2.4.12.tar.bz2 -C /Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/build
tar: Error opening archive: Failed to open '/Users/dennis.ploeger/Downloads/ags-v.3.5.0.24/OSX/buildlibs/../../libsrc/freetype-2.4.12.tar.bz2'
make: *** [freetype] Error 1


I guess there's some dependency, that has not been downloaded. Can't check that right now.

Oh, did you perhaps don't have the xcode command line tools installed? I guess, those are required. Please try to run

Code: ags
xcode-select --install


first and then try again.

Kind regards
Dennis
#18
Yep, that's my extensive blog post on the steps I take to port an AGS game to the Mac.  Glad someone else found it and hopefully it will prove useful to anyone wanting to bring their game to the Mac.

Once I figure out how to download and get the AGS source building on my Mac, I'll probably write up a follow up post.

Quote from: eri0o on Wed 01/07/2020 03:11:20
I have no idea who wrote this but I found it very interesting:
http://www.edenwaith.com/blog/index.php?p=112 | backup
#19
I tried the latest version of the AGS shell app.

The Good:
• It worked with an AGS 3.5.0 game I was trying to port.

The Bad:
• macOS Catalina only (a macOS Mojave build would be nice, I'll see if I can get that working)
• Some of the colors in the game were inverted.  Not sure if it is the game, the engine, or some combo.  I'll need to do some research.
#20
Awesome work, Dennis.  I'll test these out and see how things run.


Quote from: Dennis Ploeger on Wed 06/05/2020 21:09:45
Aaand here's the PR: https://github.com/adventuregamestudio/ags/pull/1063

That should fix the OSX build for now and hopefully newer versions.
SMF spam blocked by CleanTalk