AGS engine Mac OS X port

Started by JanetC, Mon 10/12/2012 19:12:16

Previous topic - Next topic

edenwaith

This is amazing work, Dennis, thank you!  This has been the key to help me port several games to the Mac.

I'm having some issues trying to port another game, so I'm guessing the game might be built using AGS 3.5.0 (or whatever is the most current), so I am trying to follow Dennis's instructions above to download and build AGS 3.5.0.  However, I've encountered a couple of issues.

The first stumbling block was trying to run the sed command against the Makefile:

Code: ags
cd ags-release-3.5.0/OSX/buildlibs && sed -i -e "s/10\.7/10.14/gi" -e "s/-arch i386 //gi" -e "s/;i386//gi" Makefile && cd -

sed: 1: "s/10\.7/10.14/gi": bad flag in substitute command: 'i'


Not sure why this is complaining about the 'i' substitute.  I also tried adding a backslash before the period in "10.14", but this didn't fix the error.  However, I was able to make the updates by opening up the Makefile in a text editor and making the three sets of replacements (change 10.7 to 10.14 and remove the i386 architecture references).

I then moved on to trying to perform the installation, and it appears to have downloaded a bunch of packages, before it failing

Code: ags
% cd ags-release-3.5.0/OSX/buildlibs && make install && cd -
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
make: *** [prepare] Error 1


If I run checkenv.sh by itself, no error, so perhaps the next step, or perhaps I am missing something with my system.  Any ideas what might be causing this issue?  Thanks for any tips and assistance.


Best regards,

Chad Armstrong

Quote from: Dennis Plöger on Mon 19/08/2019 10:04:45
Quote from: bx83 on Mon 19/08/2019 09:28:20
Is MacOS a fairly up-to-date channel? Is it likely that 3.5.0 might be released for MacOS in the next 6mo?

I already built 3.4.4. I can take a look if I can build 3.5.

I currently can't find the time to integrate my changes properly into the repo, but I'm on it.

Kind regards 
Dennis

Dennis Ploeger

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
deep

Dennis Ploeger

Oh, to solve the freetype error you have to download https://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2 to the libsrc directory.
deep

edenwaith

#163
Thanks for the quick response, Dennis!

I forgot to mention (even though I thought about it while writing the original post) to mention that I am running macOS 10.14.6 using the built in Bash shell.  That you are using a custom version of sed explains the the first issue.

Yes, I have Xcode installed, and I verified that the path looks good.

I don't have freetype, most likely, so that's the next step I'll take.

Best regards,

Chad Armstrong

Quote from: Dennis Ploeger on Tue 05/05/2020 07:37:11
Oh, to solve the freetype error you have to download https://download.savannah.gnu.org/releases/freetype/freetype-2.4.12.tar.bz2 to the libsrc directory.

Dennis Ploeger

Suuuuccess!

I compiled 3.5.0.24 and completely without xcode. Only a few fixes finished and I could play an advjam20-game without problems (so far).

So add freetype like I commented earlier. Also, in Engine/Makefile-defs.osx, add ../Common/libsrc/alfont-2.0.9 to INCDIR in the fourth line.

Then, in the main root run

Code: ags
make --directory Engine


After that you can find the engine binary as ags in the Engine subfolder.

I have recompiled my App container. You can download it here:

https://drive.google.com/file/d/1f3pt_e1lRoqmkJYqrdU-DwQFxwExv2F9/view?usp=sharing

Without XCode I now have means on how to easily compile the engine and will send a PR on github in the next days.

Dennis
deep

Dennis Ploeger

Aaand here's the PR: https://github.com/adventuregamestudio/ags/pull/1063

That should fix the OSX build for now and hopefully newer versions.
deep

edenwaith

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.

Monsieur OUXX

Time to beg!  :=
Do you think you guys could upload the 3.5.0.x engine executable for MacOS somewhere? And since you're there, maybe also the Linux one? (I'm guessing they're not too different but maybe I'm wrong).
Asking for my personal sanity. The learning curve for compiling on Mac is just too much.
 


edenwaith

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.

Crimson Wizard

Quote from: edenwaith on Fri 08/05/2020 04:58:31
• 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.


I swear, this happens all the time. Each 2-3 years someone fixes it, and then it appears again.

There are two places where color conversions are mentioned, first: https://github.com/adventuregamestudio/ags/blob/master/Engine/main/engine_setup.cpp#L185
and second this bitmap->video mem conversion: https://github.com/adventuregamestudio/ags/blob/master/Engine/gfx/gfxdriverbase.cpp#L314

morganw

Quote from: edenwaith on Fri 08/05/2020 04:58:31
• 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.

Could you try it with the CMake build instead, the colour issues were already meant to be fixed.

The build instructions are one page back on this same topic:
https://www.adventuregamestudio.co.uk/forums/index.php?topic=47264.msg636611972#msg636611972
Or you can download a binary from here:
https://cirrus-ci.com/task/5955130990264320

Monsieur OUXX

I'm still interested in the MacOS executable though, even with the colors issue  :=
I can act as a tester if you guys wish.
 

eri0o

#173
I have no idea who wrote this but I found it very interesting:
http://www.edenwaith.com/blog/index.php?p=112 | backup

Spoiler

Porting Adventure Game Studio Games to the Mac
18th April 2020 | Games

During the 1980s, there was a plethora of competing computer systems
(Atari, Apple \]\[, DOS, Macintosh, Amiga, etc.), which was instrumental
in encouraging Sierra On-Line to develop their AGI and SCI game engines
to support many of these systems. Since those game engines were
interpreters, it was the game engine which needed to be ported, but the
resources and code could remain fairly consistent, which reduced the
effort to bring the games to multiple platforms.

After things shuffled out and settled down to two or three platforms
during the 1990s, most games came out for DOS/Windows. Only a handful of
games were ported to the Mac, and even if they were, it was often years
later. In an effort to come up with a more platform neutral solution, I
developed for my Master's Thesis the [Platform Independent Game
Engine](http://www.edenwaith.com/downloads/pige.php) which was based off
of cross-platform frameworks like C++, OpenGL, and OpenAL. This was more
of a proof of concept than a full fledged tool for game development.

Several months ago, Steven Alexander of Infamous Quests fame directed me to a
way that shows how games created with the Adventure Game
Studio  can be ported to the Mac with minimal effort. (Note: Minimal to the level that it doesn't involve
having to rewrite 80% of the code to support another platform.) The
process to take the resources from the Windows version of an AGS game
and turn it into a Mac application only takes a couple of minutes and
does not require fragile third party frameworks like Wine. However, the
process does not end there after copying a couple of files.

This article will detail several areas to help add the extra polish to
make your game port feel like a proper Mac app by designing an
appropriate app icon, configuring the Info.plist, and finally code
signing and notarizing the app for security. I'll demonstrate porting
the hypothetical game Knight's Quest (where you play the intrepid
adventure Sir Club Cracker and roam the countryside picking up anything
which hasn't been nailed down) and how to add the extra polish to make
it into a "proper" Mac application.

Porting
The aforementioned link to the Adventure Game Studio Forum post details
one method how to set up AGS to create a Mac version of a game.
Fortunately, there is already a gameless AGS shell application which can
be modified for your game to work on the Mac without having to go
through a number of convoluted steps to retrofit the Adventure Game
Studio to work on the Mac to develop an application.
Download
the pre-compiled shell Mac application which is built for version 3.4.4
of AGS. This is an empty app, but we will soon populate it with the
required game assets. Mac apps are bundles, essentially a folder with a
collection of additional folders and files contained within. To port an
existing Windows AGS game, we will need to move a couple of the Windows
assets into the appropriate locations in the Mac app.

Right-click on the file [code single]AGS.app[/code] and select Show Package Contents
from the context menu. This will reveal the barebones contents of the
app. Inside the Contents folder is an Info.plist, a MacOS folder (which
contains the AGS executable), PkgInfo, and an empty Resources folder.

Take the executable file (.exe) of your Windows game (*not* the
winsetup.exe file that comes with some AGS games) and rename it to
[code single]ac2game.dat[/code]. If you run the [code single]file[/code] command against the [code single]ac2game.dat[/code]
file, you will see it is still a Windows executable file.

    $ file ac2game.dat
    ac2game.dat: PE32 executable (GUI) Intel 80386, for MS Windows

Next, copy the ac2game.dat, acsetup.cfg, audio.vox, music.vox,
speech.vox, and any other support files (such as files ending in .dll,
.tra, .000, .001, etc.) to the Resources folder. Your project may not
have all of these files, but most projects will contain at least
ac2game.dat, acsetup.cfg, and audio.vox.

Next rename the app bundle from AGS to the name of your game.

...and now the port is done\! Really. That wasn't so difficult, was it?
Except, it's not quite a polished Mac app, yet. To have the proper
look and feel of a proper Mac app, we still need to add that extra
shine.

One of the first things you'll notice about an app is its icon. Like so
many things in life, it's important to make a good first impression. The
same applies here. Right now, the app has a generic looking icon. For so
many years, icons were limited to small, pixelated blobs, but modern Mac
icons come in a wide range of resolutions from a tiny 16x16 to a
glorious 1024x1024.

If you have an older Mac on hand, use Icon Composer (one of the many
utilities which comes along with Xcode), otherwise, use an app like
Icon Slate to create a Mac
icon file (icns).

If you are starting with this barebones AGS app, the next section will
not apply, but this situation did come up with one app I helped port to
the Mac where the app's icon was set using an old fashioned resource
fork, a throwback of the Classic Mac OS days. If you need to check if
there is a icon resource fork present, go to the Terminal and [code single]cd[/code] into
the app bundle, then list the files contained. If you see a file that
says [code single]Icon?[/code], then there is a resource fork hidden within to represent
the app's icon.

Code: ags
    % cd SomeOtherGame.app
    $ ls -la
    total 2568
    drwxr-xr-x@  4 chadarmstrong  staff  128 Jan  1 14:15 .
    drwxr-xr-x  11 chadarmstrong  staff  352 Jan  1 20:33 ..
    drwxr-xr-x@  6 chadarmstrong  staff  192 Jan  1 14:15 Contents
    -rw-r--r--@  1 chadarmstrong  staff    0 Nov 26 08:26 Icon?


To remove the resource fork, either delete [code single]Icon?[/code] from the command
line, or if you prefer a more visual method, right-click on the app and
select the Get Info menu. In the Get Info window, click on the app icon
in the top left of the window, then hit the Delete key on your keyboard.



Other resource forks might still be lurking within the app, but we will
take care of those later.

Place the app icon file into the Resources folder of the app bundle.
Next, we will modify the Info.plist to add the app icon and other
important details.

Info.plist
The skeleton AGS app contains an Info.plist, which can be opened up in
any text editor or Xcode. A couple of additions, modifications, and a
deletion are necessary to properly customize for your game.

  - Update the bundle identifier (CFBundleIdentifier) to be unique to
    your game (e.g. com.companyname.productname)
  - Update the Bundle name (CFBundleName) and Display name
    (CFBundleDisplayName) with your game's name. The CFBundleExecutable
    should remain as AGS
  - Update the version (CFBundleShortVersionString) and build number
    (CFBundleVersion)
  - Add the human-readable copyright (NSHumanReadableCopyright)
  - Add name of the app icon (CFBundleIconFile)
  - Remove the [code single]UIStatusBarHidden[/code] key since this is for iOS and
    probably not necessary for a Mac port unless there is ever an iOS
    version.
  - Add the category type: [code single]LSApplicationCategoryType[/code]. Since this is
    the Adventure Game Studio, let's assume that many games being
    made with this IDE will be adventure games, so the
    [code single]LSApplicationCategoryType[/code] should be set to
    [code single]public.app-category.adventure-games[/code].
  - The Info.plist in the skeleton AGS app bundle contains a bunch of
    other odd cruft (such as DTSDKBuild) which probably can be removed,
    but I leave it in for now since it doesn't seem to hurt anything.

Following is a subset of the Info.plist file with the necessary changes.
Code: xml

    <?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>CFBundleDisplayName</key>
        <string>Knight's Quest</string>
        <key>CFBundleName</key>
        <string>Knight's Quest</string>
        <key>CFBundleIdentifier</key>
        <string>com.edenwaith.kq</string>
        <key>CFBundleShortVersionString</key>
        <string>1.0</string>
        <key>CFBundleVersion</key>
        <string>1</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.adventure-games</string>
        <key>NSHumanReadableCopyright</key>
        <string>Copyright © 2020 Edenwaith. All Rights Reserved</string>
        <key>CFBundleIconFile</key>
        <string>KQ-Icon</string>
        .
        .
        .
    </dict>
    </plist>


Now when you launch the app, the new app icon will appear in the Dock.

Code Signing
Code signing is one of those things which has given me several new grey
hairs over the years. If code signing wasn't enough, Apple has now added
yet another layer of security with app notarization. Notarizing an app
does require several additional steps, but it has fortunately proven to
have not been too harrowing of an experience to figure out and
implement. If you are going to make an app for macOS Mojave, Catalina,
or later, it is a good idea to both code sign and notarize the app so
macOS will not pester the player with annoying warnings about the
validity and security of the app.

I have written
about about code signing
before, so this is not a brand new topic, but with the introduction of
notarization, there is some new information to share.

With the introduction of Xcode 11, there are new types of development
and distribution certificates (e.g. Apple Development, Apple
Distribution), but for this example, I use the older style Developer ID
Application certificate for signing the app for distribution.

Let's start by verifying that the app is not code signed:

    $ codesign --verify --verbose=4 Knight\'s\ Quest.app
    Knight's Quest.app: code object is not signed at all
    In architecture: x86_64
   
    $ spctl --verbose=4 --assess --type execute Knight\'s\ Quest.app
    Knight's Quest.app: rejected
    source=no usable signature

This looks as expected. The next step is to code sign the app bundle. In
the past, we would use a command like the following:

Code:
 codesign --force --sign "Developer ID Application: John Doe (12AB34567D)" MyGreatApp.app/


However, with the introduction of notarization, there is a new set of
options to add to further harden the code signing process: `--options
runtime`

Code: ags
codesign --force -v --sign "Developer ID Application: John Doe (12AB34567D)" --options runtime Knight\'s\ Quest.app


If everything works as hoped, you will see a successful message like
this:

Code: ags
Knight's Quest.app/: signed app bundle with Mach-O thin (x86_64) [com.edenwaith.kq]


If the code signing was successful, skip to the next section about
Notarization.

Unfortunately, it is far too easy for things to go wrong. With some apps
I've helped port, there would be resource forks or other Finder info
hidden somewhere in the app, so I'd see an error message like this one:

Code: ags
SomeOtherGame.app: resource fork, Finder information, or similar detritus not allowed


This error is due to a security hardening change that was introduced
with iOS 10, macOS Sierra, watchOS 3, and tvOS 10. According to Apple:

Code signing no longer allows any file in an app bundle to have an
extended attribute containing a resource fork or Finder info.

The first time I saw this error, I determined that the "offending" file
was the icon file, so I used the following command:

Code: ags
find . -type f -name '*.icns' -exec xattr -c {} \;


In one case, the problem was because I had added a Finder tag on the app
bundle. Removing the tag fixed the problem. With another instance, some
other file was causing issues, but I was not able to immediately
discover which was the suspect file.

To ferret out the problem, I used the [code single]xattr[/code] command to see what
extended attributes were available in the app bundle.
Code: ags

    $ xattr -lr Knight\'s\ Quest.app/
    Knight's Quest.app//Contents/_CodeSignature: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents/MacOS/AGS: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents/MacOS: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents/Resources/audio.vox: com.apple.quarantine: 01c1;5e2e7a68;Firefox;7587AE66-F597-423C-8787-1DAE23ECA136
    Knight's Quest.app//Contents/Resources/ac2game.dat: com.apple.quarantine: 01c1;5e2e7a68;Firefox;7587AE66-F597-423C-8787-1DAE23ECA136
    Knight's Quest.app//Contents/Resources/acsetup.cfg: com.apple.quarantine: 01c1;5e2e7a68;Firefox;7587AE66-F597-423C-8787-1DAE23ECA136
    Knight's Quest.app//Contents/Resources: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents/Info.plist: com.apple.lastuseddate#PS:
    00000000  CD 72 0D 5E 00 00 00 00 B4 1E 64 2C 00 00 00 00  |.r.^......d,....|
    00000010
    Knight's Quest.app//Contents/Info.plist: com.apple.quarantine: 0181;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents/PkgInfo: com.apple.quarantine: 0181;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app//Contents: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C
    Knight's Quest.app/: com.apple.quarantine: 01c1;5e0d5c84;sharingd;E82F3462-E848-4A3A-846C-C497474C0E1C


To clean up the extraneous resource forks (and other detritus), use the
command:

Code: ags
xattr -cr Knight\'s\ Quest.app/


Once the cruft has been removed, verify with [code single]xattr -lr[/code] again and then
try code signing the app once more. Perform one more set of
verifications to ensure that things look good.

Code: ags
    $ codesign --verify --verbose=4 Knight\'s\ Quest.app
    Knight's Quest.app: valid on disk
    Knight's Quest.app: satisfies its Designated Requirement
    
    $ spctl --verbose=4 --assess --type execute Knight\'s\ Quest.app
    Knight's Quest.app: accepted
    source=Developer ID


Notarization
Now on to the new stuff\! The first thing you'll need to do is generate
an app-specific password for
this app. Log in to [Manage Your Apple ID
page](https://appleid.apple.com/#!&page=signin) with your Apple
developer credentials. Under the Security section, tap on the **Generate
Password...** link. In the pop up, enter in a description for the app
(e.g. Knight's Quest), and then an app-specific password will be
generated. The app-specific password will be a sixteen character
password that will look similar to this: [code single]wcag-omwd-xzxc-jcaw[/code] . Save
this password in a secure place\! You will need this password for
notarizing the app.

The next step will involve packaging the app to be notarized. It can be
packaged as either a zip archive (zip), disk image (dmg), or an
installer package (pkg). Since this is just a single app bundle, a zip
file will work.

Code: ags
    // Zip up the app
    ditto -c -k --sequesterRsrc --keepParent *app KQ.zip


For the next step, if your Apple ID is only part of a single developer
account, you can skip ahead. However, if your Apple ID is associated
with multiple accounts (such as multiple companies), then you will need
to obtain more specific information before notarizing the app.
Otherwise, if you try to notarize an app and your Apple ID belongs to
multiple accounts, you will see this error:

`Error:: altool[7230:1692365] *** Error: Your Apple ID account is
attached to other iTunes providers. You will need to specify which
provider you intend to submit content to by using the -itc_provider
command. Please contact us if you have questions or need help. (1627)`

To get the list of providers linked to your Apple ID, use this command:

Code: ags
 xcrun iTMSTransporter -m provider -u john.doe@edenwaith.com -p wcag-omwd-xzxc-jcaw


This command will output a bunch of cruft, but ends with:

Code: ags
    Provider listing:
       - Long Name -     - Short Name -
    1  John Doe            JohnDoe18675309
    2  Acme, Co.       AcmeCo


In this hypothetical example, the developer John Doe has his own
personal Apple developer account and also belongs to Acme's developer
account, as well. For this project, John will use his personal account,
so he will use the short name of [code single]JohnDoe18675309[/code], which will be used
as the ASC provider value in the following command. Again, you can omit
the [code single]asc-provider[/code] option for the notarization call if your credentials
are associated with only a single team.

To notarize the app, you will use the application launcher tool
([code single]altool[/code]), which can also be used for other purposes (such as
uploading the app to
Apple's servers). The format of notarizing is as follows:

Code: ags
 xcrun altool --notarize-app --primary-bundle-id com.example.appname --username APPLE_DEV_EMAIL --password APP_SPECIFIC_PASSWORD --asc-provider PROVIDER_SHORT_NAME  --file AppName.zip


For our example, we filled in the blanks with the following values:

  - primary-bundle-id : com.edenwaith.kq
  - APPLE\_DEV\_EMAIL : john.doe@edenwaith.com
  - APP\_SPECIFIC\_PASSWORD : wcag-omwd-xzxc-jcaw
  - asc-provider : JohnDoe18675309
  - AppName.zip : KQ.zip

Code: ags
xcrun altool --notarize-app --primary-bundle-id "com.edenwaith.kq" -u john.doe@edenwaith.com -p wcag-omwd-xzxc-jcaw --asc-provider JohnDoe18675309 --file KQ.zip


For a more in depth break out of what each of these options mean, refer
to Davide Barranca's [excellent
post](https://www.davidebarranca.com/2019/04/notarizing-installers-for-macos-catalina/)
on this topic.

This process can take awhile, depending on how large your file is, since
it needs to get uploaded to Apple's servers and be notarized.
Unfortunately, this potentially long wait time comes with consequences
if there is an error. One reason notarization might fail is if you need
to accept Apple's terms of agreement (which may have also been updated),
so you might see an error like:



Code: ags
     /var/folders/pv/xtfd6hjn7hd8kpt70q0vwl8w0000gq/T/15A31C27-F6AF-48E8-9116-A30A7C76AD03/com.edenwaith.kq.itmsp - Error Messages:
             You must first sign the relevant contracts online. (1048)
     2020-04-11 11:23:19.745 altool[22640:1119844] *** Error: You must first sign the relevant contracts online. (1048)


One approach to fix this is to log in to the Apple developer portal and
check to see if new terms of service need to be reviewed. If so, agree
to the terms, and wait a couple of minutes before trying to notarize
again. You can also check Xcode's license agreement from the Terminal by
typing in the command:

Code: ags
sudo xcodebuild -license


However, if everything works properly with uploading the file, you will
get a message like this:

Code: ags
    No errors uploading 'KQ.zip'.
    RequestUUID = 2de2e2f9-242f-3c78-9937-1a7ef60f3007


You'll want that RequestUUID value so you can check on the notarization
status to see if the package has been approved yet. After uploading your
app, the notarization process typically takes anywhere from several
minutes to an hour. When the process completes, you receive an email
indicating the outcome. Additionally, you can use the following command
to check the status of the notarization process:

Code: ags
    $ xcrun altool --notarization-info 2de2e2f9-242f-3c78-9937-1a7ef60f3007 -u john.doe@edenwaith.com -p wcag-omwd-xzxc-jcaw
    No errors getting notarization info.
    
              Date: 2020-01-04 22:44:42 +0000
              Hash: adf86725dec3ab7c26be17178e07efaf3b2806f743fefd0dd1059f68dcf45398
        LogFileURL: https://osxapps-ssl.itunes.apple.com/itunes-assets/Enigma123/v4/a5/15/64/2d...
       RequestUUID: 2de2e2f9-242f-3c78-9937-1a7ef60f3007
            Status: success
       Status Code: 0
    Status Message: Package Approved


Once the package has been approved, we can move on to the stapling the
ticket to the app.

Stapler
At this point, the app has been validated and notarized, so if an app
launches, macOS will check with the servers and verify that the app has
been properly notarized. However, if the computer is not online, then it
cannot perform this step, so it is useful to staple the ticket to the
app for offline usage.
Code: ags

    xcrun stapler staple -v KQ.app


Once again, a ton of text will scroll across the Terminal. If it works,
the last line should read: [code single]"The staple and validate action worked!"[/code]

For sanity's sake, validate that stapling worked:

Code: ags
    stapler validate Knight\'s\ Quest.app
    Process: Knight's Quest.app
    The validate action worked!


However, if the stapling hasn't been completed, there will be an error
like this:

Code: ags
    $ stapler validate Knight\'s\ Quest.app/
    Processing: Knight's Quest.app
    Knight's Quest.app does not have a ticket stapled to it.


For a final verification, use [code single]spctl[/code] to verify that the app has been
properly signed and notarized:

Code: ags
    $ spctl -a -v Knight\'s\ Quest.app
    Knight's Quest.app: accepted
    source=Notarized Developer ID


Notice that this check varies slightly from when we first did this check
before the notarization â€" the source now says [code single]Notarized Developer ID[/code].

[h3]Final Packaging[/h3]
Now that the game has been ported, code signed, and notarized, it is
time to package it up for distribution. There are a variety of ways to
do so, whether via an installer, a disk image, or a zip archive. If you
are distributing the game via download from your website, you'll
probably want to bundle the game and any other extras (such as README
files, game manuals, etc.) into a single containing folder. If you are
going to upload the game to Steam, then you may not want an enclosing
folder.

To be a good internet citizen, make sure when the zip archive is
created, that any Mac-specific files are removed, such as the .DS\_Store
file and \_\_MACOSX, which stores excess metadata and resource forks.

Code: ags
zip -r KQ.zip . -x ".*" -x "__MACOSX"


This example zips up everything in the current directory, but excludes
any dot files and any unwanted metadata. With the game packaged up, it's
ready to go\!

[h3]Ported Games[/h3]
It has been a pleasure and joy to help bring a number of adventure games
to the Mac. Below is the list of AGS games I've helped port. I highly
recommend that if you enjoy adventure games, give them a try\! I hope
that this extensive tutorial has been useful in learning how to port
games developed with the Adventure Game Studio to the Mac, in addition
to learning how to code sign and notarize a Mac application. If you
would like assistance in porting, contact me via
e-mail or
Twitter.

  - Space Quest 2 VGA
    by Infamous Adventures
  - King's Quest 3 VGA
    by Infamous Adventures
  - Order of the Thorne - The King's Challenge by
    Infamous Quests
  - Quest for Infamy
    by Infamous Quests
  - Feria D'Arles by Tom
    Simpson
  - The Crimson Diamond by Julia
    Minamata
  - Stair Quest by No More For
    Today Productions

[h4]Resources[/h4]
  - Adventure Game Studio
  - AGS engine Mac OS X port
  - Notarizing macOS Software Before Distribution
  - Customizing The Notarization Workflow
  - Your Apps and the Future of macOS Security
  - Apple ID - Create Per App-Specific Passwords
  - Using app-specific  passwords
  - How to Notarize Your Software on macOS
  - App Notarization: A Quick Primer
  - Apple Ramps Up Fight against Malware with Notarization, Stapling, and Hardening
  - Replacing Application Loader with altool
  - Notarization Provider IDs
  - Selecting iTunes Provider for Notarization
  - Technical Q\&A QA1940 Code signing fails with error 'resource fork, Finder information, or similar detritus not allowed'
  - Signing and Notarizing macOS Apps for Gatekeeper
  - Codesigning and notarizing your LC standalone for distribution outside the Mac Appstore
  - Signing and Notarizing for Catalina
  - Dev Journal â€" Automate notarizing macOS apps
  - Mac zip compress without \_\_MACOSX folder?
  - Compress without .DS\_Store and \_\_MACOSX
  - Notarizing installers for macOS Catalina
  - Notarize a Command Line Tool
  - Building and delivering command tools for Catalina


© 2001 - 2020 Edenwaith - http://www.edenwaith.com/

[close]

Privateer Puddin'

Look up a few posts and see the author posting in this very thread

eri0o

Ha! Thanks Privateer Puddin!  ;-D

edenwaith

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

edenwaith

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

edenwaith

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

morganw

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?

SMF spam blocked by CleanTalk