0

I am trying to install the latest version of GTK+ and I have downloaded all the packages listed here:

http://www.gtk.org/download-linux.html

In which directory should I extract each of the tar files and then install?

Note: the installation instructions (where there is an INSTALL file) are the standard ./configure, make and make install. It therefore seems to me that it's important where I extract each of the files.

Judith
  • 673
  • 4
  • 18
snooper
  • 157
  • 1
  • 3
  • 10

3 Answers3

1

You should extract them into and build them in a normal user's home directory. You should install them into /usr/local via sudo.

Ignacio Vazquez-Abrams
  • 111,361
  • 10
  • 201
  • 247
  • So you are saying I should just extract them into /home/administrator, but then you are just suppose to type "make install". Will this put it in the right directory? – snooper May 24 '11 at 02:57
  • First you extract them. The you read the `INSTALL` file that comes along with each. – Ignacio Vazquez-Abrams May 24 '11 at 02:59
  • Yes I've read the INSTALL file. So just following the instructions will put them in the right directory? And what would happen if I don't put them in the home directory? – snooper May 24 '11 at 03:01
  • Well, they don't *need* to be in the home directory per se, but really, as long as you can build them as a normal user that's fine. – Ignacio Vazquez-Abrams May 24 '11 at 03:04
  • Would /usr/src be another option? – snooper May 24 '11 at 03:09
  • If the normal user has write access to each extracted directory under there, sure. – Ignacio Vazquez-Abrams May 24 '11 at 03:10
  • After I've extracted the files there, why would it be necessary to have write access? – snooper May 24 '11 at 03:13
  • If I've extracted the files to /usr/src, I'm able to write using sudo & then each user will just run the program. So it is still necessary for each user to have write access? – snooper May 24 '11 at 03:23
  • Software should not be built as root, so that any rogue processes don't end up causing damage to the system. Yes, it is still possible to cause damage during `sudo make install`, but it is likely that any traps existing in tampered software would just be done triggered during the build for simplicity, which would catch less-experienced people. – Ignacio Vazquez-Abrams May 24 '11 at 03:28
  • Ok thanks. So it seems resolved we can extract the files in any directory as long as we can build there but it's best not do in directories requiring us to build as root. I've also found I needed to do the following: [1] After installing glib, run ldconfig (I had an old version of glib installed). [2] After installing pango, set PKG_CONFIG_PATH="/opt/gtk/lib/pkgconfig:/pango-1.28.4 i.e. add the directory containing pango.pc to PKG_CONFIG_PATH" – snooper May 24 '11 at 04:18
  • `make install` should put the .pc files in the appropriate place already. – Ignacio Vazquez-Abrams May 24 '11 at 04:26
  • Ok I figured out the problem. I had followed the instructions here http://developer.gnome.org/gtk3/3.0/gtk-building.html to set the environment variables to install in gtk3 in /opt/gtk (e.g. you can see the /opt/grk/lib/pkgconfig in PKG_CONFIG_PATH above) but I wasn't installing in /opt/gtk, I was just running ./config without the prefix variable. – snooper May 24 '11 at 07:55
1

Yes so just following the instructions in the INSTALL file: ./configure, make, make install; works fine. It gets installed by default into /usr/local/share

I prefer to extract it to the home folder just in case the tar is needed again in the future.

Gaff
  • 18,569
  • 15
  • 57
  • 68
snooper
  • 157
  • 1
  • 3
  • 10
0

The classic method to use when building from source is:

  1. Extract the package to a working directory (/tmp is an easy default choice)

    tar -xzf package-src.tgz -C /tmp/
    
  2. Change to the extracted directory:

    cd /tmp/package-src
    
  3. Configure the makefile as needed for your platform/environment (setting the base dir to /usr/local as well is a good idea):

    ./configure
    
  4. Compile the app, run the makefile's tests and finally install the finalized files using chained commands:

    make && make test && sudo make install
    
Gaff
  • 18,569
  • 15
  • 57
  • 68
Sasha
  • 11
  • 1