PDA

View Full Version : Installing non-Fink X11 Apps


ClarkGoble
01-20-2003, 02:26 AM
There are three classes of X11 applications for the Mac.

The first is the easiest to deal with. Those are from fink and are typically installed with "sudo deselect", "sudo fink install x" or using Fink Commander. (The latter unfortunately isn't working on my system at the moment)

The next is, in some ways even easier. In others not so easy. These are packaged installers. These typically come in a .dmg file which launches a traditional OSX installer. Examples of this are the Open Office OSX beta, the Aqua version of TCL/TK, and several others. In general if you find it listed on a place like Version Tracker rather than Fink, it will install automatically for you. Why this is sometimes a bad thing we'll get to later.

The final is the hardest. These are programs which, even if ported to OSX, come with no default installer. The authors assume that if you want to install if you may know enough Unix to install it yourself. If you download files from SourceForge, you'll probably end up with a few of these.

Fortunately these files are not really that hard to deal with. I'll go through an example of one of these later. However here's the brief general solution.

The files come as .tar.gz or something like that. (There are a few other extensions, but they are all pretty much the same and Stuffit will unstuff all of them) Double click on them to unstuff the file to a directory.

Open up a terminal window and go to the directory you just unstuffed. (The shortcut is to type cd and then drag the folder to the terminal window) The first thing you should do is open up the file called README. You'll probably have to drag and drop it on a text editor like TextEdit or BBEdit. If there is anything unusual, it'll probably be here.

Most Unix programs use a program called Make which both compiles the program and typically installs it.

To start type ./config or in other cases ./configure
This will setup the compilation process. It may ask you for a directory to place the files. Read through the rest of this hint before deciding where to put it.

Now type make depend
In most programs this will just give you an error. Occasionally though it will set up anything that the compilation depends upon. Some programs use a different term. If so, the README will say.

Next type make
The computer will chug and a bunch of compilation messages will flash across the screen. If there is an error you can elect to try and figure out what went wrong. However since you are reading this tutorial you probably don't know enough to fix it, so just skip it and hope an OSX version comes out soon.

Finally type make install
This installs the files. They typically are copied over to /usr/bin or /usr/local/bin. In some cases it may just make a full directory and then put what is called a symlink (basically an alias) in one of those locations.

If you feel uncomfortable putting files in those system directories there typically are ways to change the location. However those are generally fixed by modifying the make files. We'll not cover that. Typically it is fairly self-explanatory where to put the directory you wish things to go in. However Unix programmers are an odd lot and clarity of presentation isn't a buzzword amongst them. (Unless it is something clear to other Unix developers)

If you are going to have a unique directory structure, like Fink does, I'd suggest making your own Fink-like directory. The advantage of this is that if Fink ever ports the program you compiled, you won't have half of it already in the /sw directories confusing Fink. Further you can also keep things straight. This is also, btw, an advantage of not putting things in Apple's directories. Often installers, especially OSX package installers, do this. Then your programs that assume a version in /bin /usr or so forth suddenly stop working. (As has happened to me more than once)

If you are making your own directory try something like /mysw.

The final thing I'll bring up is the rather common case where the program doesn't install itself anywhere. Typically in these cases they commands are still there in the directory you compiled. In these cases you have to copy them yourselves.

If you choose to put them in your own directory, make sure that you update your path in your .tcshrc file.

For instance I put most programs I compile into ~/bin. Because I set my .tchsrc the way Apple suggested, I simply add the directory to ~/Library/initi/tcsh/path. So for me I have the following in my path file:

tenv PATH ~/bin:${PATH}:/usr/local/bin:/usr/local/sbin

Probably you don't want the /usr/local/sbin in yours, unless you are going to be doing administration work. Look in that directory before taking it out though. There may be some commands you want.

I suggest putting commands others don't use in ~/bin. I like it and tend to put my own shell scripts there. Metrowerks puts their commands there too, I notice, as does Stuffit.

sao
01-20-2003, 02:55 AM
ClarkGoble wrote:
Those are from fink and are typically installed with "sudo deselect", "sudo fink install x" or using Fink Commander.
You forgot the easiest of all, with Fink you can use the *apt* tool.

Just run, 'sudo apt-get install packagename', to install precompiled binary packages. Fink 'dselect' is a bit confusing for beginners.

Good work, ClarkGoble.

sao
01-20-2003, 05:33 AM
The reason I prefer to install with Fink, besides that it saves me tons of time to be able to do 'apt-get install packagename' rather than finding the source, figure out how to configure it and then compile it, is that keeps my system clean as it installs everything in /sw.

It's a great choice as nothing uses it. It's an "island" well isolated from other critical areas. And safe from conflicting with other packaging systems and will not 'pollute' the Apple system like some unix installers do.

Some 'systems' similar to Fink use /opt, probably for the same reason that Fink uses /sw. Then, /opt is used already by DarwinPorts, so there is a very small risk. In this case, then, /sw is still a better choice.

/sw it's easy to mv to a new volume and symlink it to continue and not lose any info. And it's easy to delete Fink if you desire so, and not have to reinstall OSX. You can try that on FreeBSD. The reason why FreeBSD can install into /usr/local is they don't have .pkg and other native ports using none native installed libs being installed on it to muck everything up.

Still, /sw is just the 'recommended' install and the 'binary' location. It's not required. It is possible to install Fink into /usr/local. The installation script will warn you explicitly, but proceed once you acknowledge that you're doing this at your own risk. Then, after you install into say ./usr/local, do a 'fink install sdl' then install 'OSXMplayer' and see what happens...

Glanz
01-20-2003, 07:04 AM
I have installed many "/opt" -centric apps to /usr/local/bin by using the "--prefix" command during the "./configure" stage of the installation. In other words, insteas of issuing "./configure", I issue "./configure --prefix = /usr/local" then "make" then "sudo make install".... Don't forget the "sudo" folks.

ClarkGoble
01-20-2003, 02:13 PM
You forgot the easiest of all, with Fink you can use the *apt* tool. Just run, 'sudo apt-get install packagename',

The problem I have with this is that often, you don't know what the name is. By browsing with deselect or better yet fink commander you can see things you might otherwise miss.

I also prefer sudo fink install name as I like to recompile just in case anything has changed on my system. Typically this isn't necessary. And the downside is that compiling can take a long time. KDE will take all night, for instance.

sao
01-23-2003, 01:43 AM
ClarkGoble wrote:
By browsing with deselect or better yet fink commander you can see things you might otherwise miss.
Yes, you are right. dselect and FinkCommander both work well for that.

Also, you can check:

http://prdownloads.sourceforge.net/fink/direct_download/dists

and go into the appropriate distribution (e.g. 0.5.1).