1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212
|
To compile Gargoyle you will need jam 2.5.
For sound support, you will need SDL_mixer.
The FMOD sound support is slightly broken, but can be re-enabled
with a little bit of hacking.
Edit the Jamrules file to suit your system configuration.
Comment out the "USESDL = yes" line if you don't care about
sound support.
Compile with "jam". The default is to build a RELEASE build.
Compile with "jam -sBUILD=DEBUG" for a debuggable build.
The command "jam install" will copy the compiled executables
and shared libraries into "build/dist/".
For a system-wide install, the following four steps should place
the binaries, shared library, and configuration file in appropriate
locations. However, please check the Jamrules file and verify that
the referenced paths actually exist before you proceed.
sudo env SYSTEM=1 jam install
sudo ln -s -f /usr/local/libexec/gargoyle/gargoyle /usr/local/bin/gargoyle
sudo ln -s -f /usr/local/lib/gargoyle/libgarglk.so /usr/lib/libgarglk.so
sudo cp garglk/garglk.ini /etc/garglk.ini
-------------------------------
* Building on MacOS: (notes by Andrew Plotkin, April 2017)
The new build script (contributed by Brad Town) can be run on any
MacOS 10.7 or higher. It requires a set of Unix packages (see below),
which can be installed with either MacPorts or Homebrew. If you're
building Gargoyle for your own use, that's all you need to know.
For the MacPorts packages you'll need, type:
sudo port install libsdl -x11
sudo port install libsdl_mixer libsdl_sound
sudo port install libpng
sudo port install jpeg
sudo port install smpeg
sudo port install freetype
sudo port install pkgconfig
sudo port install jam
If you're using Homebrew, instead type:
brew install sdl
brew install sdl_mixer sdl_sound
brew install libpng
brew install jpeg
brew install smpeg
brew install libvorbis
brew install freetype
brew install pkg-config
brew install jam
Once the packages are installed, type:
sh gargoyle_osx.sh
This should create Gargoyle.app, and also build a .DMG file which
contains the app.
However, to create a *release build* of Gargoyle.app -- one that can
be distributed to other people -- requires more care. After some
struggle, this is what I have learned:
- You need an Intel Mac with the developer tools (Xcode) installed.
No surprise there.
- You should compile on the oldest MacOS available. You can build on an
old Mac and get the result to run on new Macs. The reverse does not work
reliably.
Therefore, I did the current build on MacOS 10.7 "Lion". (The Jamfile
and other support files in this package are now set up for 10.7, and
the resulting app runs on 10.7 and up. Unlike previous Gargoyle
releases, it does not support the PPC architecture.)
- You need to install Unix packages with MacPorts.
Homebrew, sadly, does not support 10.7 any more. (I tried to install the
necessary packages via Homebrew but ran into hopeless package dependency
loops.)
(Happily, Homebrew and MacPorts can coexist on the same box. I recommend
doing the build in a shell which can only see the MacPorts world: add
/opt/local/bin to your PATH and *remove* /usr/local/bin.)
- Building
To set up your build environment on a fresh Mac, install MacPorts
via https://www.macports.org/install.php. You want the "pkg" installer
for Lion (assuming that's your OS).
Once that's set up, run the MacPorts package install commands listed
above (the "sudo port" ones).
You can then run the build:
sh gargoyle_osx.sh
If you have both Homebrew and MacPorts installed, the build will default
to Homebrew, which is not what you want. You must set the MAC_USEHOMEBREW
env variable to "no", for example like this:
sh -c 'MAC_USEHOMEBREW=no; . gargoyle_osx.sh'
You now have build Gargoyle.app, and also the distributable .DMG file
which contains the app.
- Verifying the build
It's useful to know how to check the app for portableness. If you type a
command like
otool -L Gargoyle.app/Contents/MacOS/Gargoyle
otool -L Gargoyle.app/Contents/PlugIns/glulxe
...you will see a list of the dynamic libraries linked into the interpreter.
These may start with
@executable_path/../Frameworks/...: libs included in Gargoyle.app
/System/Library/Frameworks/...: MacOS standard libs
/usr/lib/...: more MacOS standard libs
If you see any lines starting with /opt/local or /usr/local, you have a
problem. That library is trying to load out of MacPorts or Homebrew, and
the interpreter will fail on most other Macs (which do not have those repos
installed).
- MacOS code signing and notarization
For a fully accessible build on MacOS 10.15 (Catalina), you need to both
sign and notarize the app before packaging it up. (Unsigned builds still
run on 10.15, but you have to right-click and select "Open". The user
warnings for just launching the app normally are more derisive than before.)
To do this:
First, obviously, you need an Apple developer account.
Create an app-specific password with the name "altool". Copy the password
down once it's created. (You can't re-download it from Apple, you can only
delete it and create a new one.) The instructions on this are here:
https://support.apple.com/en-us/HT204397 "Using app-specific passwords"
Verify that this password works:
xcrun altool --list-providers -u "$APPLE_ID"
APPLE_ID is the account name (probably an email address) for your
developer account. This will ask for a password. Use the altool password
that you just created above. The response will look something like:
ProviderName ProviderShortname WWDRTeamID
-------------- ---------------------- ----------
Andrew Plotkin AndrewPlotkin176400769 BK75QRDQ9E
Build Gargoyle.app using the gargoyle_osx.sh. But delete the .dmg file;
we're going to create a new one later.
Code-sign the app: (The "-o runtime" argument specifies that you want
a "hardened" app, which is a requirement.)
codesign -o runtime --deep --sign "$CERT_NAME" Gargoyle.app
The CERT_NAME is the name of your Developer ID Application certificate
in Keychain-Access. For me, this is:
"Developer ID Application: Andrew Plotkin (BK75QRDQ9E)".
Zip up the signed app for notarization:
ditto -c -k --keepParent Gargoyle.app Gargoyle.zip
Send it off to be notarized:
xcrun altool --notarize-app --primary-bundle-id 'com.googlecode.garglk.Launcher' --username "$APPLE_ID" --asc-provider "$PROV_SHORT_NAME" --file Gargoyle.zip
This will also ask for the altool password. PROV_SHORT_NAME is the
ProviderShortname you saw above. For me, it's AndrewPlotkin176400769.
If this succeeds, you'll see something like:
No errors uploading 'Gargoyle.zip'.
RequestUUID = 4745e9e4-87c2-4509-89cf-d08d84181234
Wait for Apple to send you email about this request. It's supposed to take "up to an hour"; I got a response within a few minutes.
Now look at the response details:
xcrun altool --notarization-info "$REQ_UUID" -u "$APPLE_ID"
This will give a success/failure message, plus a LogFileURL for more
info. Look at the log file to make sure there are neither errors nor
warnings.
If it all looks good, update the app with the notarization info:
xcrun stapler staple Gargoyle.app
(This doesn't need any extra arguments because Apple maintains a
public database of all successful notarizations. The stapler tool
looks up all necessary info online.)
Finally, re-run the command to create the DMG file:
hdiutil create -fs "HFS+J" -ov -srcfolder Gargoyle.app/ gargoyle-2019.1-mac.dmg
|