![]() |
|
| Home Articles Zendikar Spoiler (249/249) Radar Forums Blogs Wiki Writing/Contests Chat About | |
|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
Supreme Bio-Vizier
|
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 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 Open a new Terminal window by pressing Command-N and enter the following command into the terminal prompt: Code:
env Code:
/opt/local/bin:/opt/local/sbin 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 Install Mindless Automaton by entering the following command: Code:
sudo port install mindless 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 Code:
mv Makefile Makefile.bak Code:
cat Makefile.bak | sed -e 's/\.svg/\.png/g' > Makefile Code:
make 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 Now we need to remove a line from a file (the one that tells a terminal to launch). Remember nano? Code:
nano ~/.xinitrc Code:
xterm & 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 Code:
defaults write org.x.x11 no_quit_alert 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'" 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 The developer tools can be uninstalled by entering this into a Terminal window: Code:
sudo /Developer/Tools/uninstall-devtools.pl Code:
sudo rm -rf /Applications/Utilities/X11.app /private/etc/X11 /usr/X11R6 /usr/bin/open-x11 /usr/lib/X11 /Library/Receipts/X11User.pkg End of Tutorial Last edited by mdmunoz : 05-09-2008 at 08:45 AM. |
|
|
|
|
|
#2 |
|
Ascended Mage
Join Date: Jan 2007
Posts: 416
|
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?
|
|
|
|
|
|
#3 |
|
Supreme Bio-Vizier
|
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... |
|
|
|
|
|
#4 |
|
Ascended Mage
Join Date: Jan 2007
Posts: 416
|
I suppose though, you can use macports/fink to install the required packages along with 1.5 and then cd and make v1.6.
|
|
|
|
|
|
#5 |
|
Supreme Bio-Vizier
|
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. |
|
|
|
|
|
#6 |
|
Ascended Mage
Join Date: Jan 2007
Posts: 416
|
Nope, can't seem to get it to connect. Might require hamachi, however I'm having errors with that also.
|
|
|
|
|
|
#7 | |
|
Supreme Bio-Vizier
|
Quote:
Edit: connection is confirmed for 1.6 (check the firewall, maybe?). Last edited by mdmunoz : 10-07-2007 at 12:10 AM. |
|
|
|
|
|
|
#8 |
|
Just Getting Started
Join Date: Jan 2008
Location: quito, ecuador
Posts: 0
![]() |
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! |
|
|
|
|
|
#9 | |
|
Supreme Bio-Vizier
|
Quote:
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 Code:
export PATH=/opt/local/bin:/opt/local/sbin:$PATH 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. |
|
|
|
|
|
|
#10 |
|
Just Getting Started
Join Date: Jan 2008
Location: quito, ecuador
Posts: 0
![]() |
aparently, there was an initial error during the first installation i made
now, it works perfect! thanks! |
|
|
|
|
|
#11 | |
|
Supreme Bio-Vizier
|
Quote:
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. |
|
|
|
|
|
|
#12 |
|
Supreme Bio-Vizier
|
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. |
|
|
|
|
|
#13 |
|
Just Getting Started
Join Date: Nov 2008
Posts: 0
|
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! |
|
|
|
|
|
#14 |
|
Supreme Bio-Vizier
|
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. |
|
|
|
|
|
#15 |
|
Ascended Mage
Join Date: Jan 2007
Posts: 416
|
Version 1.7 is available in the repository.
Code:
svn co https://mindless.svn.sourceforge.net/svnroot/mindless mindless Code:
make |
|
|
|