# Building the gEDA/gaf git repository version

## General Instructions

To build the git repository version of gEDA/gaf, follow these instructions:

- Download and install all the following dependencies. You will probably want to use your distributions package management system (such as apt-get or yum) to install the dependencies.
  - A C/C++ compiler and standard library ( GCC and GNU Libc are recommended)
  - flex current
  - GNU awk current
  - automake 1.11.0 or later
  - autoconf 2.60 or later
  - libtool current
  - texinfo current
  - pkg-config current
  - gettext 0.18 or later
  - guile 2.0 or 2.2 (1.x is no longer supported)
  - gtk+ 2.18.0 or later
  - groff current
  - git 1.6.x or later
  - CPython 2.7
  - FAM or Gamin (Gamin is recommended)
  - freedesktop.org MIME info database current
  - freedesktop.org utilities for manipulating .desktop files current

- It is pretty important to have all of the above programs (especially automake, autoconf, libtool, gtk, and guile) installed in the same prefix (like /usr or /usr/local). If you do not have them all installed in the same prefix, then building and installing gEDA/gaf is much harder.

- Clone the source from the official git repository. For information on how to do this, read the gEDA SCM page

- Build the software by executing the following commands inside of the newly cloned git repository:

      $ ./autogen.sh
      $ ./configure --prefix=$HOME/geda --enable-silent-rules
      $ make
      $ make install

- If the above commands execute without any error messages, then you have successfully built and installed gEDA/gaf. If you encounter any errors, be sure to read the README and INSTALL files contained within the tarball.

- You can now run the various programs in the gEDA suite. Please read the toplevel README file which describes what is available.

- gschem is the schematic capture program and can be run by executing: `PATH_WHERE_gEDA_GAF_IS_INSTALLED/bin/gschem`

- It is recommended that you add `PATH_WHERE_gEDA_GAF_IS_INSTALLED/bin` to your PATH environment variable (typically done by modifying one of the following files: `$HOME/.bashrc`, `$HOME/.bash_profile`, or `$HOME/.profile`).

- It is highly recommended that you read the gEDA documentation at this point. You can access the gEDA documentation by running gschem and select Help/gEDA Documentation… from the top menu.

- If you want to get gEDA/gaf repository commit log e-mail messages, please subscribe to the geda-cvs mailing list. Please see the mailing lists page for info on how to do this.

- For build problems, please be sure to read the mailing list archives or search this site. Also look at the gEDA wiki for more hints.

## Distro-specific information

### Debian-based

This is tested on Crunchbang Linux but should work on Debian Wheezy and possibly Ubuntu also.

1. Install the build dependencies for the packaged version of gEDA:

       $ sudo apt-get build-dep geda

2. Install the packages that don't get pulled in by the above command:

       $ sudo apt-get install texinfo
       $ sudo apt-get install autopoint
       $ sudo apt-get install libtool

3. If you want to generate doxygen output, install it and the other prerequisites:

       $ sudo apt-get install doxygen
       $ sudo apt-get install imagemagick
       $ sudo apt-get install graphviz

4. Clone the source from the official git repository. For information on how to do this, read the gEDA SCM topic .
5. From inside the newly cloned repository, build gEDA/gaf:

       $ ./autogen.sh
       $ ./configure --prefix=$HOME/geda --enable-silent-rules [--enable-doxygen]
       $ make
       $ make install

### MacPorts

MacPorts is an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading open-source software on the Mac OS X operating system. MacPorts has a packaged installation of gEDA/gaf but occasionally one needs a more up-to-date version (such as that from git). The easiest way to build from git HEAD on MacPorts is to install the packaged version (at time of writing, 1.6.2) as a way of bringing most of the dependencies into the MacPorts tree.

1. Install MacPorts.
2. Install the MacPorts-packaged version of gEDA/gaf. As a happy side-effect, this brings in most of the build prerequisites. Also install autoconf and automake:

       $ sudo port install geda-gaf
       $ sudo port install autoconf
       $ sudo port install automake

3. If you want to generate doxygen output, install doxygen:

       $ sudo port install doxygen

4. Clone the source from the official git repository. For information on how to do this, read the gEDA SCM topic .
5. From inside the newly cloned repository, build gEDA/gaf:

       $ ./autogen.sh
       $ ./configure --prefix=$HOME/geda --disable-update-xdg-database --enable-silent-rules [--enable-doxygen]
       $ make
       $ make install

6. If you are running a recent release of OS X, X server is not included by default so you might need to install XQuartz
7. To run the software, you need to set an environment variable to allow Guile to load its shared libraries:

       $ export LTDL_LIBRARY_PATH=/opt/local/lib
       $ gschem