MTG Salvation Forums
Home Articles Zendikar Spoiler (249/249) Radar Forums Blogs Wiki Writing/Contests Chat About

Go Back   MTG Salvation Forums > Technical Support > Testing Grounds
Register Blogs Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
Old 05-17-2007, 07:04 PM   #1
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default Installing Mindless Automaton on a Mac

Mindless Automaton on a Mac


This tutorial applies to Max OS X 10.3-10.5 only, requires the use of an Administrator account, and has been tested on 10.4.10 Intel and 10.5.1 Intel. Current versions apply to the date of this post (Mindless Automaton 1.6). Your version of OS X can be found by clicking "About this Mac" under the Apple Menu. Also, this tutorial looks complex, but do not be afraid. At worst you will have to delete everything you installed (see the last appendix), and you might learn a little something about using your computer along the way.

Mindless Automaton is a Linux client that can connect to players that use Apprentice. It is not a native Macintosh application (what you are installing is a port), and thus there are a few caveats in installing it.

Installing X11

Note: if you have 10.5 Leopard, you can skip this section. You already have a copy of X11 installed on your Mac.

X11 is an application that provides an environment to run your X-windows applications, such as your future port of Mindless Automaton.

Insert the installation disk (1) that came with your computer. If a window does not appear, double-click the CD on the desktop.

Scroll down until you see the "Optional Installs" package and double-click to run the installer.

You may notice Xcode Tools. Though the next section involves Xcode Tools, you do not want this version. Ignore it.

At the "Installation Type" step, check the box for "X11" under "Applications" and continue the installation.

Once X11 is installed, select "Software Update" from the Apple Menu to get the current version of X11.

You will not need the installation disk from now on.

Installing XCode Tools

XCode Tools is a set of development tools Apple provides for developers. You will need them because you will be building Mindless Automaton into a binary application from its raw source code.

Go to Apple's developer site.

You will need to join ADC by clicking "Join Now" and following the instructions. This is free and works the same way as a forum registration (email confirmation). Despite the focus on developers, this registration is open to everyone. You do not need to use your real name, only a valid email.

Once your registration is confirmed and you are logged in, go to the Downloads page and find and download the appropriate version of XCode Tools. If you are on OS X 1.3 or 10.4, you want version 2.5. OS X 10.5 users want the latest version 3.

If the downloaded disk image does not automatically mount, double-click it. Double-click the XCodeTools.mpkg inside of the virtual disk to run the installer.

When the installer reaches the "Installation Type" step, click the "Customize" button. Expand "Software Development Kits" and make sure that "X11" is checked. This should be checked by default.

Continue the installation until completion. You may unmount the disk image you downloaded and delete it.

Getting Ready for a Macports Install

These steps make certain that your computer plays nice with MacPorts in the next section.

Open Terminal, an application in the Utilities folder of your main Applications folder.

You will see a text-based console. Take deep breaths and do not freak out. You can do this.

Type or paste the following (exactly) into the prompt and press return:

Code:
sudo nano ~/.profile
If you are familiar with Unix, you may be confused by the use of sudo for a file in the Home directory. I can't explain it, but apparently some people are getting permissions errors when writing out their .profiles without using sudo. Chalk it up to Apple being lazy with permissions, I guess.

You will be prompted for your administrator password. This is the same as your account password if your account has administrator privileges. You will not be able to see your password as you type it (completely invisible). This is normal behavior.

You will see a blank document open within the Terminal. You are now in the nano text-editing program. Paste the following code into the document:

Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
export DISPLAY=:0.0
Press Control-O to save and Control-X to exit.

Open a new Terminal window by pressing Command-N and enter the following command into the terminal prompt:

Code:
env
You will get a bit of output. Make sure the following is part of the PATH output:

Code:
/opt/local/bin:/opt/local/sbin
If the output does not contain the above somewhere, you have done the editing in nano incorrectly in the previous step.

Installing MacPorts

MacPorts is a manager for open-source applications that have been ported to the Mac. You will be using it to automate the downloading and building of Mindless Automaton.

Go to the Macports downloads site and download the most current version. Currently, this is "Macports 1.4.0." Download the file ending in .dmg that corresponds to your version of OS X (10.3 or 10.4).

If the disk image doesn't automatically mount once downloaded, double-click it. Double-click the Macports pkg file in the mounted image to run the installer. Do the default "Easy" install.

Once the installation is finished, you may unmount and delete the disk image.

Installing Mindless Automaton

Return to the Terminal application. Open a new window and enter the following command into the prompt:

Code:
sudo port selfupdate
You must again enter your password. This will update your installation of Macports. this may take a few seconds or quite a while depending on what version you initially installed.

Install Mindless Automaton by entering the following command:

Code:
sudo port install mindless
This will take a while, as MacPorts is downloading, configuring, and building the application from source code (as well as various other thigs that Mindless requires to run). When the process is over (after the "cleaning mindless" step), you will receive a normal command prompt.

Getting a Current Version of Mindless

The version of mindless you just installed is actually outdated. But worry not! You still needed all of those other things that it requires to run, so you haven't wasted effort.

Click this link or go here to get the latest version of the mindless source code. Leave it where you downloaded it for the next steps.

Images that Work

Inside the mindless folder you just downloaded, there is an "ICONS" folder. These images need to be changed to .pngs. You can also get png versions of the files here, hosted courtesy of mtgsalvation. Delete the old files in the ICONS folder and replace them with the pngs.

If for some reason that download isn't working, you can use an image editor to change the file types. If you want a recommendation, I like Seashore because it's free. Download it and it's svg importer from this page. Once the svg importer is installed, the files can be opened and File > Export can be used to save png versions.

Compiling

Oooh, scary. But not really.

Open a terminal window. You need to use the "cd" command to move yourself into the mindless folder you downloaded. That command looks like this, assuming your folder is on the desktop:

Code:
cd ~/Desktop/mindless-1.6
Now we must drop hints to the compiler that we are using pngs. Enter the following in the same window:

Code:
mv Makefile Makefile.bak
Now, enter this (again, same window):

Code:
cat Makefile.bak | sed -e 's/\.svg/\.png/g' > Makefile
Finally, we compile by entering the following into the same window:

Code:
make
Executable

So now what? Look into the downloaded folder, and you will see something that wasn't there before: a file simply named "mindless" with no extension. This is your executable file; the only one you need. The rest of that folder is useless to you now. Double-click your mindless file. If all goes well, it should launch X11 and the program should pop up.

Appendix 1: Cards

When you launch Mindless Automaton, it asks you for a card database. Not sure where to find one? I like to go to Gatherer and copy the output from Oracle Export searches into a plain text (.txt) file. TextEdit using Format > Make Plain Text does this nicely.

You can also find oracle text databases here:

http://www.yawgatog.com/resources/oracle/

To make a deck, just put numbers and card names into another plain text file, except this one will have a .dec extension. Here's a quick example, complete with sideboard, from the MA site:

http://mindless.sourceforge.net/tinker.dec

Appendix 2: X11

You may find it annoying that X11 opens a terminal window every time you open mindless (if you have Leopard, this problem is solved already, since a terminal will only open if you double-click X11.app). Do these three commands:

Code:
sudo cp /etc/X11/xinit/xinitrc ~/.xinitrc
Code:
sudo chown $USER:$USER ~/.xinitrc
Code:
chmod u+rw ~/.xinitrc
Again, Unix people are scratching their heads. All I can say is that sometimes, these files just refuse to write, and that chown knows best.

Now we need to remove a line from a file (the one that tells a terminal to launch). Remember nano?

Code:
nano ~/.xinitrc
Hit the down arrow until you see this line:

Code:
xterm &
Delete the entire line. press Ctrl-O to save and Ctrl-X to exit.

You may also be annoyed that X11 warns you every time you try to quit. To quit without a warning, enter tone of these into a Terminal window:

--OS X 10.3-10.4 users:
Code:
defaults write com.apple.x11 no_quit_alert true
--10.5 users:
Code:
defaults write org.x.x11 no_quit_alert true
To go back to the warning, repeat the command with "false" instead of "true"

Appendix 3: Dot App

You may notice that executable files have annoying quirks. They can't be put on the "Application" side of the dock, and Quicksilver won't open them properly. This can be fixed with some quick Applescript.

Open Script Editor, which is in the Applescript folder of your Applications folder. Paste the following code into the editor (the file path to mindless may change, depending on where you put it. For this example, it's in a folder within the Applications folder--I'm assuming you want the executable and the final app in the same folder):

Code:
do shell script "open '/Applications/Mindless Automaton/mindless'"
Save this file. When the save dialog appears, choose "application bundle" from the "File Format" drop-down menu, and uncheck all of the "Options" checkboxes. Name it whatever you like.

You now have a tiny application file that sits correctly in the dock. It still just launches mindless in X11, though (I'm not a miracle worker).

If the "opens, then quickly disappears" aspect of the script application annoys you, freeware utility Dock Dodger has your back.

Appendix 4: Icon

You may think that the mindless executable file looks very out of place. Fear not! These things are easily changed. Find an icon that you like (here and here are good places to look).

Once downloaded, click the icon you want. Choose Get Info from the Finder's File menu. Get Info for your mindless file as well.

Click the little picture of the icon in the upper-left of the Get Info panel of the icon that you want. Copy it (Cmd-C). Click the corresponding icon on the mindless Get Info panel and paste (Cmd-V).

Nifty, eh? This of course works for any type of file.

Appendix 5: Deleting Everything

Note: only do this if you no longer want to use Mindless Automaton

If you want to uninstall Macports, the following command (yes, that's all one command) will do the trick when entered into the Terminal:

Code:
sudo rm -rf \
/opt/local \
/Applications/MacPorts \
/Library/Tcl/macports1.0 \
/Library/LaunchDaemons/org.macports.* \
/Library/StartupItems/DarwinPortsStartup
This should be obvious, but do not alter the above command unless you know what you're doing. It deletes things.

The developer tools can be uninstalled by entering this into a Terminal window:

Code:
sudo /Developer/Tools/uninstall-devtools.pl
To uninstall X11, enter the following long command into a Terminal window (be very careful with this command as well):

Code:
sudo rm -rf /Applications/Utilities/X11.app /private/etc/X11 /usr/X11R6 /usr/bin/open-x11 /usr/lib/X11 /Library/Receipts/X11User.pkg
Now all that's left is your mindless binary file, which is probably in your Applications folder, unless you put it somewhere else. Move it to the trash.

End of Tutorial
Attached Files
File Type: zip icons.zip (15.5 KB, 106 views)

Last edited by mdmunoz : 05-09-2008 at 08:45 AM.
mdmunoz is offline   Reply With Quote
Old 09-30-2007, 12:58 PM   #2
Åôz
Ascended Mage
 
Join Date: Jan 2007
Posts: 416
Default

For some reason, both Fink and Macports install version 1.5 which does not work with the current apprentice~ is there a way to fix this?
__________________
Turn 3 Kill r
Åôz is offline   Reply With Quote
Old 09-30-2007, 03:07 PM   #3
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

Well, don't I look stupid! The only thing I can think of is spamming the port maintainer to update it at his email:

marco [dot] bonetti [at] poste [dot] it

I guess before I went through all the trouble typing this out, I should have used it for something other than goldfishing. *Le sigh*

I'll edit the post...
mdmunoz is offline   Reply With Quote
Old 09-30-2007, 04:33 PM   #4
Åôz
Ascended Mage
 
Join Date: Jan 2007
Posts: 416
Default

I suppose though, you can use macports/fink to install the required packages along with 1.5 and then cd and make v1.6.
__________________
Turn 3 Kill r
Åôz is offline   Reply With Quote
Old 09-30-2007, 09:38 PM   #5
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

In my experience, it never turns out to be that easy, but I will try anyway. If all goes well, I'll update the tutorial.

Edit: it works if these instructions are followed:

http://sourceforge.net/forum/forum.p...forum_id=50372

Post updated with instructions for compiling newest version, added appendices with tips to make X11 less annoying, etc.

Aoz, can you connect to Apprentice clients with v1.6?

Last edited by mdmunoz : 10-01-2007 at 12:01 AM.
mdmunoz is offline   Reply With Quote
Old 10-02-2007, 05:32 PM   #6
Åôz
Ascended Mage
 
Join Date: Jan 2007
Posts: 416
Default

Nope, can't seem to get it to connect. Might require hamachi, however I'm having errors with that also.
__________________
Turn 3 Kill r
Åôz is offline   Reply With Quote
Old 10-02-2007, 08:06 PM   #7
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

Quote:
Originally Posted by Aoz View Post
Nope, can't seem to get it to connect. Might require hamachi, however I'm having errors with that also.
Well, I'll leave the how-to up as-is until someone can confirm or deny. I probably should test it myself, but there's no way I can host and nobody on Apprentice can be bothered to do anything but test their T2 Tarmogoyf deck.

Edit: connection is confirmed for 1.6 (check the firewall, maybe?).

Last edited by mdmunoz : 10-07-2007 at 12:10 AM.
mdmunoz is offline   Reply With Quote
Old 01-18-2008, 05:11 PM   #8
Hiruc
Just Getting Started
 
Hiruc's Avatar
 
Join Date: Jan 2008
Location: quito, ecuador
Posts: 0

Ecuador

Default Compilation error

Hi, mdmunoz!

I followed your instructions in a religious way, and it works perfectly until I reach the compilation step. When I hit "make", there comes an absurd amount of errors (about 1000 lines) of this kind:

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
mindless.c:16:21: error: gtk/gtk.h: No such file or directory
mindless.c:17:28: error: gdk/gdkkeysyms.h: No such file or directory
In file included from mindless.c:18:
game.h:23: error: parse error before 'GtkWidget'
game.h:23: warning: no semicolon at end of struct or union
game.h:24: warning: type defaults to 'int' in declaration of 'message_box'

... then a lot of lines containing "game.h:" and then...

mindless.c:29: error: parse error before '*' token
mindless.c:30: error: parse error before '*' token
mindless.c:31: error: parse error before '*' token
mindless.c:33: error: parse error before '*' token
mindless.c:34: error: parse error before '*' token

... and then a lot more.

Can you please tell me what am I doing wrong?
I have an Imac Intel CoreDuo with Mac OS 10.4.11

Thanks!
Hiruc is offline   Reply With Quote
Old 01-19-2008, 01:44 AM   #9
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

Quote:
Originally Posted by Hiruc View Post
Hi, mdmunoz!

I followed your instructions in a religious way, and it works perfectly until I reach the compilation step. When I hit "make", there comes an absurd amount of errors (about 1000 lines) of this kind:

Package gtk+-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-2.0' found
mindless.c:16:21: error: gtk/gtk.h: No such file or directory
mindless.c:17:28: error: gdk/gdkkeysyms.h: No such file or directory
In file included from mindless.c:18:
game.h:23: error: parse error before 'GtkWidget'
game.h:23: warning: no semicolon at end of struct or union
game.h:24: warning: type defaults to 'int' in declaration of 'message_box'

... then a lot of lines containing "game.h:" and then...

mindless.c:29: error: parse error before '*' token
mindless.c:30: error: parse error before '*' token
mindless.c:31: error: parse error before '*' token
mindless.c:33: error: parse error before '*' token
mindless.c:34: error: parse error before '*' token

... and then a lot more.

Can you please tell me what am I doing wrong?
I have an Imac Intel CoreDuo with Mac OS 10.4.11

Thanks!
I can't reproduce these errors, but it looks like your shell environment can't see gtk 2, which is required for mindless to run (it should have been automatically been installed when installing mindless through Macports).

I'm thinking it could be one of two things: gtk isn't there at all, or the shell just can't "see" that it's there. We'll start with the second possibility.

Try this again

Code:
sudo nano ~/.profile
And make certain the two lines you edited in are there, especially this one:

Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
The point of this line to tell your command prompt that it should consider the things in those folders part of the shell environment. If they aren't there, try adding and saving them again (Ctrl-O to save).

Whether they're there or not, try opening a new terminal window (this is important because the settings changed in that file don't go into effect until you open a new shell) and try again, starting from the "Compiling" section.

If you keep getting the same errors, we'll try that first possibility: go to the Finder and press Cmd-Shift-G. You'll see a drop-down sheet. Paste "/opt/local/bin/" (no quotes) and hit go. You should see a whole bunch of executable files, a few of which start with "gtk." It should look something like this:



If you don't, this means the mindless install didn't go correctly and the files aren't actually there (which would explain why the compiler didn't find them).

If that's the problem, you should try "sudo port install mindless" again, paying attention to what happens. This step should have taken quite a while the first time around, which means there might have been problems somewhere between all those lines of "installing..., cleaning..., staging..." If you see any errors when you try again, those could be helpful in figuring out why gtk is missing.

I'm sorry that you're having trouble after getting so far into it. If this doesn't solve your issues, post again and I'll try to figure out what's going on.

Last edited by mdmunoz : 01-19-2008 at 01:49 AM.
mdmunoz is offline   Reply With Quote
Old 01-20-2008, 09:05 PM   #10
Hiruc
Just Getting Started
 
Hiruc's Avatar
 
Join Date: Jan 2008
Location: quito, ecuador
Posts: 0

Ecuador

Default

aparently, there was an initial error during the first installation i made
now, it works perfect!
thanks!
Hiruc is offline   Reply With Quote
Old 01-20-2008, 11:19 PM   #11
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

Quote:
Originally Posted by Hiruc View Post
aparently, there was an initial error during the first installation i made
now, it works perfect!
thanks!
Good to hear.

A general update: I just found out about a new GUI tool for MacPorts (the old one cost money, so I didn't put it in the tutorial). It makes the "Installing Mindless Automaton" section slightly easier, but it doesn't mean you can avoid the Terminal altogether.

Porticus

If you want to use Porticus, you can selfupdate Macports with "Self Update..." under the ports menu. To install mindless, search for it under All Ports, select it, and click the install button.

Nice and easy, but it only really helps with those two steps.
mdmunoz is offline   Reply With Quote
Old 05-09-2008, 08:23 AM   #12
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

I added a small detail to Appendix 2 to avoid confusion about the command for moving the .xinitrc file not working in Leopard. To make a long story short, Apple changed the way this part works and you don't need to worry about it.

If you're on Leopard and you open mindless, you don't get a terminal by default (unless you opened X11 first, and you wouldn't do that unless you wanted a terminal).

Also, since Apple switched X11 to x.org, the preferences file has a different name and I added the new command for 10.5 users to disable the quit warning.

Last edited by mdmunoz : 05-09-2008 at 08:47 AM.
mdmunoz is offline   Reply With Quote
Old 11-25-2008, 07:20 PM   #13
OEMPlus
Just Getting Started
 
Join Date: Nov 2008
Posts: 0
Default

Thanks for the writeup!

I'm having a bit of an issue that I was hoping you could help with, my online searches for solutions were futile!

When I open Mindless, it merely opens up a new terminal window and displays as follows:



And that is all! Anyone have any ideas what could be wrong?

Sorry to dig up an old thread but I would love to get this to work!
OEMPlus is offline   Reply With Quote
Old 11-26-2008, 11:53 PM   #14
mdmunoz
Supreme Bio-Vizier
 
mdmunoz's Avatar
 
Join Date: Jan 2006
Posts: 1,113

United States

Send a message via AIM to mdmunoz
Default

It sounds like a variable (display) for the X11 environment hasn't been set.

I hadn't thought of it, but maybe X11 sets the environment variables only after you open it for the first time. Have you tried opening X11 (Applications>Utilities)?

If that doesn't work, try opening mindless after entering "export DISPLAY=:0" into the terminal. If that doesn't work, at least it rules out what I'm guessing.
mdmunoz is offline   Reply With Quote
Old 07-10-2009, 05:10 PM   #15
Åôz
Ascended Mage
 
Join Date: Jan 2007
Posts: 416
Default

Version 1.7 is available in the repository.

Code:
svn co https://mindless.svn.sourceforge.net/svnroot/mindless mindless
browse to trunk and use
Code:
make
Copy "mindless" to your install directory for safe keeping and enjoy!
__________________
Turn 3 Kill r
Åôz is offline   Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -6. The time now is 09:22 PM.


vBulletin, Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.