diff --git a/en/gnome/docs/porting.sgml b/en/gnome/docs/porting.sgml index aa23172687..3d0599e860 100644 --- a/en/gnome/docs/porting.sgml +++ b/en/gnome/docs/porting.sgml @@ -1,125 +1,140 @@ %includes; ]> &header;

General instructions can be found in the FreeBSD Porter's Handbook.

GNOME Makefile Macros

For ports that require GNOME, you should define the following in your port's Makefile:

 USE_GNOME=	yes
 USE_X_PREFIX=	yes
         

These will take care of the install prefix and requiring all the core GNOME dependencies. If your port can use GNOME, but it isn't required, you can define the following in your Makefile:

 WANT_GNOME=	yes
         

If the user has defined WITH_GNOME in their /etc/make.conf then GNOME components will be built. Other useful GNOME-related macros that can be define in your port's Makefile include:

  • USE_GLIB (WANT_GLIB) : The application requires (can use) Glib. Defining USE_GNOME or USE_GTK takes care of this option automatically.

  • USE_GTK (WANT_GTK) : The application may not be GNOME-compliant, but requires GTK+ widgets. This will take care of those dependencies. Note, this option should not be defined if USE_GNOME is defined.

  • USE_ESOUND (WANT_ESOUND) : The application requires (can use) esound. Normally, esound support is added by specifying USE_GNOME.

  • USE_IMLIB (WANT_IMLIB) : The application requires (can use) the Imlib image library. This is not needed if USE_GNOME is defined.

  • USE_GNOMELIBS (WANT_GNOMELIBS) : The application requires (can use) GNOME libraries. This does not import as many dependencies as USE_GNOME and should be used for applications that use GNOME, but do not need the GNOME Control Center, the GNOME capplet library, or anything from the GNOME Core.

  • USE_GNOMECTRL (WANT_GNOMECTRL) : The application requires (can use) all the GNOME libraries and the GNOME Control Center, but does not use anything from GNOME Core. This option is usually used for backend APIs.

GNOME Internationalization

GNOME relies on the gettext port to do internationalization (I18N). FreeBSD currently supports two versions of gettext: 0.10.35 and 0.10.40. Most ports can use 0.10.35. However, if, when compiling your port, you get an error building the .po translation files similar to the following you will need to use the newer version of gettext:

 /usr/local/bin/msgfmt -o zh_TW.mo zh_TW.po
 zh_TW.po:255: end-of-line within string
 zh_TW.po:912: illegal control sequence
 zh_TW.po:2806: end-of-line within string
 zh_TW.po:2856: end-of-line within string
 zh_TW.po:2879: illegal control sequence
 zh_TW.po:2982: end-of-line within string
 found 6 fatal errors
         

To use the newer gettext, add the following to your port's Makefile:

 BUILD_DEPENDS=  msgfmt-new:${PORTSDIR}/devel/gettext-devel
 CONFIGURE_ENV+= MSGFMT=${LOCALBASE}/bin/msgfmt-new \
 				XGETTEXT=${LOCALBASE}/bin/xgettext-new
 		

When installing GNOME applications, make sure the translation files are put in /usr/X11R6/share/locale and not /usr/X11R6/share/gnome/locale. To do this, add the following to your port's Makefile's pre-patch: section:

 pre-patch:
 	@find ${WRKSRC} -name "Makefile.in*" | xargs ${PERL} -pi -e \
 		's|\$\(datadir\)/gnome/|\$\(datadir\)/|g ; \
 		s|\$\(datadir\)/locale|\$\(prefix\)/share/locale|g'
         

Also, make sure the translation files are installed as .mo files and not .gmo files. To do this, you can generally use this patch.

+ +

If your port depends on iconv, make sure you substitute all + instances of iconv.h with giconv.h, and all + instances of -liconv with -lgiconv.

+ +

Libtool Issues

+ +

Most if not all GNOME applications depend on GNU's libtool. They + also use the GNU configure system. Newer versions of libtool have + a problem with FreeBSD's USE_LIBTOOL macro. Use of this + macro should be avoided. Instead, set GNU_CONFIGURE= yes, + and use the following patch + to prevent the installation of .la files.

+ +

The more ported applications we have, the better.

&footer;