English Sinhala
FreeBSD GNOME Project: How To Make a Port
This document assumes that you already know how the port system works, and therefore only provides GNOME-specific hints and tips. General instructions can be found in the link:{porters-handbook}[FreeBSD Porter's Handbook].
Example Makefile
There is an link:../example-makefile/[example Makefile] for a GNOME port, which uses many of the tricks outlined in this document. Please feel free to use it as a guide for creating your own ports.
GNOME Makefile Macros
GNOME applications under FreeBSD use the *USE_GNOME* infrastructure. To specify which components of the GNOME system your port needs in order to build, simply list them all as a space-separated list. For example:
USE_GNOME= gnomeprefix gnomehack libgnomeui
The *USE_GNOME* components are divided into the following two lists:
link:../gnome_porting/[GNOME desktop-version-independent components]
link:../gnome2_porting/[GNOME 2 components]
link:../gnome1_porting/[GNOME 1 components]
If your port needs only *GTK2* libraries, the following is the shortest way to define this:
USE_GNOME= gtk20
If your port needs only *GTK1* libraries, the following is the shortest way to define this:
USE_GNOME= gtk12
Even if your application needs only the GTK libraries, other *USE_GNOME* components may be useful. Please scan the entire list to make sure your port uses all relevant components.
Once you have finished with your port, it is a good idea to verify that your port depends on the correct list of components. To see a list of what packages your port will actually require, use the command `make package-depends` from within your port's directory.
To aid in creating the list of necessary components, it can be helpful to examine the output of `make configure`. At the end of the `checking for...` list, there will be a line similar to this:
checking for libgnomeui-2.0 >= 2.0.0 cspi-1.0 >= 1.1.7
libspi-1.0 >= 1.1.7 libbonobo-2.0 >= 2.0.0 atk >= 1.0.0
gtk+-2.0 >= 2.0.0 gail libwnck-1.0 esound... yes
This is a list of the components upon which this application relies to build. Pay close attention to the hierarchical layout of the *USE_GNOME* system; many components are implied from other *USE_GNOME* directives. In the above example, `USE_GNOME= libgnomeui` implies use of `libbonoboui`, which implies `libgnomecanvas`, which implies `libglade2`, which implies `gtk20`. Thus, even though `gtk+-2.0` appears in the list of requisite components, `gtk20` can be eliminated from the *USE_GNOME* list. There are a number of other such redundancies that can be eliminated from this list.