Jump to content
The Dark Mod Forums

Compiling on OSX


Recommended Posts

There are no shortcuts in MacOSX? :blink: Maybe linking to a shell script is possible?

D'oh, didn't think of that! blush.gif

 

I'll have a go at creating a shell script with a relative path, that way any Mac users can just create an Alias for this script wherever it happens to be (you're correct, the Doom 3 folder can be anywhere).

 

BTW, I'm happy to try tdm_update if this is available.

 

 

Link to post
Share on other sites
  • Replies 145
  • Created
  • Last Reply

Top Posters In This Topic

Sorry for not confirming, the updater seems to work fine but I haven't had much time to do extensive testing on it. I've been getting other issues with occasional segmentation faults occurring at various points with TDM itself (usually related to loading FMs / quicksaves). Are these known issues or likely to be related to this build? I'll update this post with relevant log info next time this happens.

I get some weird message saying that I need to choose an application to run it...? Shouldn't it run on its own?

It will work if you open up a command prompt and run it that way, i.e. "./tdm_update.macosx". You can also set the Terminal to run the file by setting this as the "Open With" application under the Get Info properties so that you can just double click it in future.

 

However, I just tried this and it wanted to download the full 2GB even though I already had the latest files (and running directly from terminal says it's all up to date), so you probably have to stick to one method. Don't know what would explain this, possibly something different in the user environment when going through the Finder?

 

Link to post
Share on other sites

However, I just tried this and it wanted to download the full 2GB even though I already had the latest files (and running directly from terminal says it's all up to date), so you probably have to stick to one method. Don't know what would explain this, possibly something different in the user environment when going through the Finder?

I'd need to see the tdm_update.log that is created in the same folder as the updater to tell what's going on.

Link to post
Share on other sites
  • 2 weeks later...

Sorry for taking so long to get back to this. I've found that the problem is that launching a shell script via Finder by double clicking it will give you a working directory of the users home directory, i.e. /Users/scott/ rather than the directory where the shell script resides. To get around this with tdmlauncher I tried using an env var in the shell script, i.e.:

 

export TDMDIR="/Users/scott/Library/Application\ Support/Doom\ 3/darkmod"

exec "$TDMDIR/tdmlauncher.macosx"

 

The tdmlauncher.log file (which was being created in the home folder) showed that although the launcher was finding the sym link "Doom 3" by default, it wasn't correctly loading unless I specifically added a path onto the end of the above exec command, e.g.

 

exec "$TDMDIR/tdmlauncher.macosx" "$TDMDIR/../Doom 3.app/Contents/MacOS/Doom 3"

 

Originally, I'd tried this with escape characters for the spaces in this path, but this didn't work, which might explain why using no path parameter didn't work as the sym link "Doom 3" in this folder points to "Doom\ 3.app/Contents/MacOS/Doom\ 3" which has these escape characters.

 

tdmupdate

Running through terminal works fine, but when running through Finder it's the same thing as with running tdmlauncher, Finder launches the terminal process which starts out with the home folder as the working directory and starts downloading the mod from scratch into the home folder.

 

To get around having the Doom3 path hard coded anywhere, I've created helper shell scripts for both tdmlauncher and tdm_update which figure out where it is being run from, so these would need to be located in the darkmod folder:

 

tdmlauncher_helper.sh:

#!/bin/sh
export TDMDIR=`dirname "$0"`
exec "$TDMDIR/tdmlauncher.macosx" "$TDMDIR/../Doom 3.app/Contents/MacOS/Doom 3"

tdm_update_helper.sh:

#!/bin/sh
export TDMDIR=`dirname "$0"`
cd "$TDMDIR"
exec ./tdm_update.macosx

A MacOS alias / shortcut can then be created to just point to wherever each of these files happen to be. Both the launcher and update programs are working fine now when using this method.

 

Downside to this approach is I'm not seeing any log files generated anywhere if using these shell scripts, but using terminal is always available if necessary to create these.

Edited by Midnight
Link to post
Share on other sites

Thanks for the update.

 

tdmupdate

Running through terminal works fine, but when running through Finder it's the same thing as with running tdmlauncher, Finder launches the terminal process which starts out with the home folder as the working directory and starts downloading the mod from scratch into the home folder.

 

To get around having the Doom3 path hard coded anywhere, I've created helper shell scripts for both tdmlauncher and tdm_update which figure out where it is being run from, so these would need to be located in the darkmod folder:

tdm_update acceps a --targetdir argument. Can you try using it like this:

 

tdm_update.macosx --targetdir=/Users/scott/Library/Application\ Support/Doom\ 3/darkmod

 

If the spaces cause trouble, maybe putting the path into double-quotes helps.

Link to post
Share on other sites
  • 1 month later...

I'm considering including the Mac binaries in the next TDM release, but I think we're going to need a lot of instructions for Mac users.

 

Midnight, would you have time to do a short summary of the steps necessary to get the mod running in Mac? (As previously mentioned I don't have a Mac capable of running the mod myself, I can merely compile the code projects.)

Link to post
Share on other sites

I've played around with permissions here and there so it would be a good idea to test on a 'clean' machine to make sure the whole process works. I have another Mac to try this on but it's in storage for a couple more weeks, so if grayman wants to try some instructions in the meantime I'll have them written out today.

 

Greebo, we're going to need a 1.05 binary, unless grayman still has a 1.04 install he can copy from. I've already updated my mac install to 1.05 using tdm_update (this works with a targetdir btw).

 

If the helper shell scripts (above) were included in the list of files for download then it should make the installation a lot simpler for any Mac users (they could just create shortcuts to these files). Is this something you'd consider or should the instructions include how to set these up?

 

I mentioned I had a couple crashes when reloading FMs sometimes. Here are the last few lines from the console after I had first run the mod, installed and played a mission after restart, then installed a new mission and it failed to launch during restart (this was with 1.04):

/Users/scott/Library/Application Support/Doom 3/base/game03.pk4 (2 files)
/Users/scott/Library/Application Support/Doom 3/base/game02.pk4 (2 files)
/Users/scott/Library/Application Support/Doom 3/base/game01.pk4 (2 files)
/Users/scott/Library/Application Support/Doom 3/base/game00.pk4 (2 files)
game DLL: 0x0 in pak: 0x0Addon pk4s:file system initialized.
--------------------------------------
Unknown command 'vid_restart'idRenderSystem::Shutdown()
----- Shutting down GL -----
FIXME: Sys_FadeScreenFIXME: Sys_UnfadeScreens
----- Done shutting down GL -----
Sys_Error: Couldn't reopen /Users/scott/Library/Application Support/Doom 3/base/pak000.pk4

 

Maybe it is low memory related, since it's intermittent and I'm only running 2GB.

Edited by Midnight
Link to post
Share on other sites

Greebo, we're going to need a 1.05 binary, unless grayman still has a 1.04 install he can copy from.

 

I can copy 1.04 and 1.05 to my Mac and test the instructions with 1.04 until the 1.05 binary is available.

 

Edit: 1.04 doesn't include the Mac binary, so I'll wait for the 1.05 binary and test with that.

 

 

 

Link to post
Share on other sites

These instructions will have to do until the mac binary is downloaded by tdm_update:

 

You'll need to locate the "Doom 3.app" application and create a "darkmod" folder alongside this. Download the tdm_update.macosx file from the top of this page and copy this to the darkmod folder as well as the tdm_game03.pk4.

 

This step won't be necessary later, but these files may have downloaded with a .html extension if using Safari. You'll need to rename this within a terminal window, i.e. in the darkmod folder (mv *.html *.pk4).

 

if you want to download a full 1.05 installation to this folder, run ./tdm_update directly from a terminal window, otherwise you can copy your existing 1.04 folder here, and then do a differential update afterwards.

 

Open TextEdit, and under Preferences you'll want to change it so new documents use Plain Text rather than RTF. Also, under Opening and Saving, uncheck the box that adds the .txt extension to the file (this is to avoid a .rtf or .txt extension getting added onto the end of the following scripts).

 

Create a new text file and enter the following then save it to the darkmod folder as "tdmlauncher_helper.command":

#!/bin/sh

export TDMDIR=`dirname "$0"`

exec "$TDMDIR/tdmlauncher.macosx" "$TDMDIR/../Doom 3.app/Contents/MacOS/Doom 3"

 

Do the same with the following and save it as "tdm_update_helper.command":

#!/bin/sh

export TDMDIR=`dirname "$0"`

cd "$TDMDIR"

exec ./tdm_update.macosx

 

The .command should automatically identify the files as terminal scripts, so you don't need to change which application opens them. Now all you should need to do is right click on each and choose 'Create Alias', then drag the alias / shortcut somewhere like your desktop or dock.

 

[Edit - Ninja'd]

Edited by Midnight
Link to post
Share on other sites

The 1.04 mac binary linked from the previous page is still available (right click and choose 'Download file as'): http://www.dramtheth.../tdm_game03.pk4

 

Greebo, let me know if you do get a 1.05 binary compiled so I can verify that a full 1.05 install works.

See above - the file you linked has been replaced with a 1.05 binary now, I overwrote the 1.04 one.

Link to post
Share on other sites

I assume that double-clicking the *.command files is supposed to run the shell script in the terminal.

 

I get "you don't have permission to access" errors when trying.

 

i have read/write permission on them.

 

How do I fix this?

Link to post
Share on other sites

Um, yeah, I know that.

 

But I'm pretending I'm a newbie, for the instructions' sake. I don't know how much unix experience we should assume in our players. I didn't know how Midnight wanted to account for the lack of permission, which is why I asked.

 

Anyhow, adding execute permission and running tdm_update_helper.command gets me this:

 

 

'/bin/sh: export: No such file or directory'

 

Since I already have 1.05 in place, I tried tdmlauncher_helper.command and nothing happened. No terminal output, either.

Link to post
Share on other sites

If we assume little or no experience (which is what I was going for), then we'd want to avoid messing around with permissions (or even renaming file extensions etc.).

 

Okay, here's a different approach, this link contains the update and launcher programs and the shell scripts (with execute already set) in a zip file called darkmod.zip.

1) Download the darkmod Mac updater (darkmod.zip) from the link provided

2) Locate "Doom 3.app" and copy the darkmod.zip file alongside this (we'll probably want a better description than this, since the .app is hidden, maybe a screen capture showing the icon?).

3) Now double click the zip file to extract the contents (it will automatically create a "darkmod" folder containing these files.

4) You can then double click the "tdm_update_helper.command" file to initiate a full installation (+/- 2GB).

5) Once this is done, double click the "tdmlauncher_helper.command" file and DarkMod should start.

6) Optionally, you can create shortcuts to the helper scripts by right/option clicking and choosing 'Create Alias'. These shortcuts can then be moved to somewhere more convenient, such as the dock or desktop.

 

I'm not 100% certain that the permissions etc that I've given these files will carry across to a different machine, so please let me know if this works as described above. Obviously for your test you can avoid following through with the full download, you can cancel this then test the updater and launcher with your existing 1.05 content.

 

 

 

As for the "no such file" error, I didn't notice the forum had messed up the line feeds so I've corrected these now, but this step would also be un-necessary if these are included in a download.

 

 

Edited by Midnight
Link to post
Share on other sites

Provided the scripts in your ZIP work out fine, I could add them to our main release such that Mac users already have them in-place. I can also extend the tdm_updater to ensure appropriate permissions, if they don't get carried over to the client machine.

 

It's also do-able to let tdm_update download an additional tdm_mac_stuff.zip on OSX platforms only, but that's probably overkill.

Link to post
Share on other sites

I used the updater to download 1.05, and it finished successfully.

 

The title screen comes up, then it crashes after a couple seconds. No error messages, and I can't find the Darkmod.log file, even using Spotlight.

 

tdmlauncher.log has this in it:

 

 

Path to tdmlauncher is /Users/rsphares/Desktop/Doom 3/darkmod/tdmlauncher.macosx

Darkmod directory is /Users/rsphares/Desktop/Doom 3/darkmod/

Trying default value for engine executable is /Users/rsphares/Desktop/Doom 3/Doom 3

Trying default Linux location for engine executable /usr/local/games/doom3/Doom 3

Could not find engine executable at default locations, will be searching command line arguments for a path to doom3 executable.

Reading engine executable from command line arguments: /Users/rsphares/Desktop/Doom 3/darkmod/../Doom 3.app/Contents/MacOS/Doom 3

Could not find 'currentfm.txt' file in /Users/rsphares/Desktop/Doom 3/darkmod/currentfm.txt

Current FM is:

Full argument string is: +set fs_game darkmod

Closing logfile.

 

 

 

 

Link to post
Share on other sites

Hm. The log file should be in ~/Library/Logs/DarkMod.log. I seem to recall that I tested that function and the tilde gets expanded correctly to a full path.

 

As for debugging the crash, can you try to attach gdb to the Doom 3 process perhaps?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...