| Installing UNIX software on a Mac |
|
| Written by Darryn Lowe | ||||
| Sunday, 29 July 2007 | ||||
Page 2 of 2
Here we
go For this tutorial you will need the following pieces of software:
First if you haven't already installed XCode do so now. You can get away with the standard options but you may want to not install some things if you have limited space. The required parts will be unable to be de-selected. That being said you will need the GCC options and it's best to select all versions including the older stuff as some sources are designed to be compiled with older versions. Don't worry, they can all co-exist happily. Now install Darwin Ports. Once done open up Terminal and enter this line:
It will ask for an administrator account password. As it's using "sudo" you only need to enter your own password so long as you have administrator access. This command checks for updates on the internet to the software you have just installed. Depending on what needs updating this could take some time. The reason for this is simply because there are constant developments being done to the packaging system so this command will bring everything up to date. Still in Terminal enter the following command:
This is the directory where the source code or required binaries for each program will be installed. For those of you who are a little daunted by the Terminal fear not. I will explain what we are doing in detail in the appendix at the end of this tutorial. Chances are that this directory is not set to writeable so go back (or up) one directory level like so:
Now enter this command:
Be careful using this command. Don't go setting everything to 777 as this WILL cause serious issues. I'm only telling you to change this directory as this is the directory the source code will be downloaded to. Truth is that the "sudo ports" command will take care of this but I've had issues sometimes with this and setting 777 on this directory fixed it. Right, now you are pretty much ready to install something. For the purpose of this tutorial I will show you how to install a game that I played to death with my mates at school which got us into heaps of trouble. The game was Scorched Earth but the version we're going to install is called XScorch. On the right of the Darwin Ports website there are a number of categories. Go to Games and click on the XScorch link - http://xscorch.darwinports.com At the top of the page there is a line that reads like so: The raw portfile for xscorch 0.1.15 is located here: Below this is a link but you'll notice that portfile for xscorch is actually a link to the same file anyway. Don't click the link but instead right mouse click (control click for those with one button mice) and choose "Download Linked File" ("Save Link As" in FireFox). If you're using Safari it will save the file as "Portfile.txt" but this won't work. We'll fix this in a moment. Go back to Terminal and if you're still in the "dports" directory (you went into this directory when you entered "cd dports") then enter this command:
You don't need to use "sudo" as you have already set the permissions to read/write for everyone with the "chmod" command. Now type the following command: cd xscorch In this case the file is downloaded to my Public folder. Change Public to wherever you save your downloads to. You'll notice that the file "Portfile.txt" changes to simply "Portfile" in this example. For some reason Safari defaults to saving normal text files with the extension ".txt". Unfortunately Darwin Ports looks for a file called "Portfile" without the extension. There is no rename command in UNIX instead them MV command takes over this. It might not make sense to most people but bear in mind UNIX was developed with limited space in the day. In a strange way moving a file from one name to another does actually have some logic behind it. Now enter this command: sudo port install xscorch Whatever dependencies are required to get the program running, these will be downloaded automatically. This can take some time to download and build. It may also fail depending on availability of source or dependencies. To run XScorch you should be able to simply type:
Depending on the nature of the program you may need to use X11. This is because the application will need the XWindows system. Rumour has it that Leopard (the next version of the Mac operating system) will allow you to run applications natively without the need to have X11 but we'll find this out in October won't we? To recap let's look at the commands again in one hit. You can only run one at a time so just follow the list in order, waiting for each command to complete, and you should be right: sudo port -d selfupdate cd /opt/local/var/db/dports cd ../ sudo chmod -R 777 dports cd dports mkdir xscorch cd xscorch mv ~/Public/Portfile.txt ./Portfile sudo port install xscorch xscorch (this may need to be run from under X11. Run X11 and it the Term window isn't already running then choose xTerm from the menu then type xscorch and it should run) That's pretty much it. Darwin Ports is for all intensive purposes is an easy way to get UNIX apps on the Mac. There is a shareware GUI called PortAuthority that gives you a nice interface to getting the apps but personally I prefer getting my hands dirty. Related Articles
Set as favorite
Bookmark
Email This
Comments (0)
![]() Write comment
This content has been locked. You can no longer post any comment.
You must be logged in to a comment. Please register if you do not have an account yet.
|
||||
| Last Updated ( Sunday, 29 July 2007 ) | ||||




