InstallingFromSource

From AWN Wiki

Jump to: navigation, search

Contents

[edit] AWN From Source

This guide explains how to install and update avant-window-navigator by compiling it from source code.

Note: Colored, monospaced font boxes imply that they are commands to run in a terminal unless otherwise noted.
Instructions specific to released versions are labeled like this: (Release)
Instructions specific to development versions are labeled like this: (Development)

[edit] Installation

There are actually two methods of installing from source code. You can either:

  • (Release) download a released version from Launchpad, or
  • (Development) retrieve a "bleeding edge" development version that may be unstable, but may also have features that are not in any of the releases.

[edit] Dependencies

There are a number of header/library packages needed to compile/install Awn. If you're running the Gnome desktop or Gnome applications, odds are that you have at least the libraries available. If you've installed other Gnome applications from source, then you probably have the header files as well.

(Development) Awn uses a distributed version control system named Bazaar to keep track of its source code. In order to retrieve the source, you need to have this installed.

The dependencies for Awn are listed on an easy to read matrix on a separate page.

[edit] Instructions

1.

(Release) (Development)
Unpack the tarball. For example:
tar -xzvf avant-window-navigator-0.0.tar.gz
Download the source from the Bazaar repository:
bzr co lp:awn

Alternatively, if you wish to test another branch of awn, look at the branch listing and replace the URL with the URL of the branch that's printed on the branch details page. For example, if Bob (launchpad username: bob) made a branch for awn named "foo", the branch details page would be at https://code.launchpad.net/~bob/awn/foo and the branch URL would be the "Location:". When in doubt, follow the Example command that is also listed on the branch details page.

2. Go to the source directory:

cd avant-window-navigator

3.

(Release) (Development)
Run the configure script:
./configure

By default, ./configure puts awn in the prefix /usr/local , so if you would like to install awn in a different location, you need to specify it like so:

./configure --prefix=[PREFIX] [other configure flags]

If you need to recompile awn so that you can file a bug for it, you should instead run the script like so:

CFLAGS="-ggdb" ./configure [configure flags]
Generate the build system files (Note: this also runs ./configure):
./autogen.sh

If you get an error during this step, make sure you have all of the dependencies installed, including development packages (if any exist for your distribution). Since autogen.sh runs ./configure, you can specify configure flags as arguments. For example:

./autogen.sh --prefix=[PREFIX] [other configure flags]

If you need to recompile awn so that you can file a bug for it, you should instead run the script like so:

CFLAGS="-ggdb" ./autogen.sh [configure flags]

If you are using a 64-bit version of the openSUSE distribution, add this option to ./configure or autogen.sh: --libdir=[PREFIX]/lib64

4. Compile awn and associated libraries/helper programs:

make


5. Install awn to the prefix specified in step 3 (if you didn't specify one, it is installed by default to /usr/local):

make install
Note: You may need to run this command with root privileges, that is, with sudo or su.

Next, run the following command:

ldconfig
Note: You most likely need to run this command with root privileges, that is, with sudo or su.

According to the man page:

ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld.so.conf, and in the trusted directories (/lib and /usr/lib). The cache is used by the run-time linker, ld.so or ld-linux.so. ldconfig checks the header and filenames of the libraries it encounters when determining which versions should have their links updated.


6a. Now that it is installed, type the following to run it (this only works if you installed avant-window-navigator in /usr or /usr/local):

avant-window-navigator &

If you did not install awn in /usr or /usr/local, you will need to add/modify some environment variables. In the following example, we will assume that you installed awn to the prefix /home/bob/programs/awn , and that you use the bash shell.

It is a good idea to put the following commands in your shell startup scripts, so that they don't have to be manually re-run each time you log in to X. This is done for bash by opening $HOME/.bash_profile in your favorite text editor. For example:

gedit $HOME/.bash_profile

Obviously, replace "gedit" with "vim", "nano", "mousepad", or any other program that lets you edit text files.

6b. Modify the environment variable PATH so that the system can find avant-window-navigator:

export PATH="$PATH:/home/bob/programs/awn/bin"

6c. Modify the environment variable LD_LIBRARY_PATH so that the system can find libawn.so and friends:

export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/home/bob/programs/awn/lib"

6d. Modify the environment variable PYTHONPATH so that the python interpreter and python-based applets can find the awn module:

AWN_PYVER=`python -c "import sys; print '%s.%s' % sys.version_info[:2]"`
export PYTHONPATH="$PYTHONPATH:/home/bob/programs/awn/lib/python$AWN_PYVER/site-packages"
unset AWN_PYVER

6e. Now you should be able to run the command in 6a without errors.


[edit] Troubleshooting

  • I'm getting errors during the make or make install sections!
    • Make sure all the dependencies are present.
    • Make sure you have paid attention to all of the warning (red) and notice (green) boxes.

[edit] Updating your installation (Development version only)

[edit] Manually

(Development) If you wish to sync your install with the latest updates from the branch you downloaded the source code from, follow these instructions:

1. Go to the location of the awn source that you downloaded in installation step 1.

cd /path/to/avant-window-navigator

2. Clean up your build environment from your previous compile session:

make distclean

3. Pull in any changes from awn's source repository:

bzr update

4. Repeat installation steps 3 through 6a.

[edit] Automated (With a script)

If you want to use a script to update AWN (possibly scheduling it to run every day or on boot) you can use GetAwn.sh or Script in Spanish

Personal tools