diff --git a/en/gnome/docs/porting.sgml b/en/gnome/docs/porting.sgml index 2973aa0043..5b899dee24 100644 --- a/en/gnome/docs/porting.sgml +++ b/en/gnome/docs/porting.sgml @@ -1,239 +1,319 @@ - + %gnomeincludes; %includes; ]> &header; - -

Note, this document is out-of-date. A new - porting process is in the works, and this document will be updated - when it is formalized.

This document assumes that you already know how port system works, and therefore only provides GNOME-specific hints and tips. 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:

+

Recently, the GNOME porting infrastructure has undergone some + changes so that GNOME 1 applications can coexist with the GNOME + 2 desktop and vice versa. This new infrastructure is called + GNOMENG. The GNOME team is working to port the + applications using the old infrastructure over to GNOMENG. + Currently, all of the GNOME 1 desktop and the GNOME Fifth Toe + have been ported.

+ +

The majority of this section applies to GNOME 1 ports. + GNOME 2 ports still have not bee fully brought under GNOMENG. + For those ports, simply listing out the BUILD, RUN, and LIB + DEPENDS is sufficient for the time being.

+ +

The old infrastructure used the following Makefile macros + for building GNOME or GTK ports:

+ +
+USE_ESOUND
+USE_GLIB
+USE_GNOMECTRL
+USE_GNOMELIBS
+USE_GTK
+USE_IMLIB
+
+WANT_ESOUND
+WANT_GLIB
+WANT_GNOMECTRL
+WANT_GNOMELIBS
+WANT_GTK
+WANT_IMLIB
+	  
-
-USE_GNOME=	yes
+	  

These are now deprecated. In GNOMENG, the way the specify + which GNOME components your port requires is to add the + following to your port's Makefile:

+ +
 USE_X_PREFIX=	yes
-          
+USE_GNOMENG= yes +USE_GNOME= <list of GNOME components> +
-

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:

+

The list of GNOME components consists of one or more of + the following separated by a single space:

-
-WANT_GNOME=	yes
-          
+ +
    +
  • gnomehack : This is a collection of common + GNOME Makefile substitutions that is almost required for + every GNOME port to fit into the proper mtree structure. + For a specific list, please refer to + ${PORTSDIR}/Mk/bsd.gnomeng.mk. Note: + Including this option adds a pre-patch target to + your Makefile. Therefore, if you already have a + pre-patch target in your Makefile, you must + change it to post-patch.

  • + +
  • gnomeprefix : This is a collection of + CONFIGURE_ARGS needed for every GNOME port that + has to have its data placed under the GNOME hierarchy. It + also includes some useful arguments that allow GNOME ports + to build in the presence of gtk-doc, and maintain + PREFIX safety.

  • + +
  • gnomehier : This adds a dependency on + misc/gnomehier. gnomehier installs all the + directories needed for both the GNOME 1 and 2 desktops. Only + include this option if your port calls @dirrm on + one of the directories listed in the plist for + gnomehier.

  • + +
  • gnomeaudio : This adds a dependency on + audio/gnomeaudio.

  • + +
  • esound : This adds a dependency on + audio/esound (replaces USE_ESOUND).

  • + +
  • libghttp : This adds a dependency on + www/libghttp.

  • + +
  • glib12 : This adds a dependency on + devel/glib12 (replaces USE_GLIB).

  • + +
  • gtk12 : This adds a dependency on + x11-toolkits/gtk12 (replaces USE_GTK).

  • + +
  • libxml : This adds a dependency on + textproc/libxml.

  • + +
  • gdkpixbuf : This adds a dependency on + graphics/gdk-pixbuf.

  • + +
  • imlib : This adds a dependency on + graphics/imlib (replaces USE_IMLIB).

  • + +
  • orbit : This adds a dependency on + devel/ORBit.

  • + +
  • gnomelibs : This adds a dependency on + x11/gnomelibs (replaces USE_GNOMELIBS).

  • + +
  • gnomecanvas : This adds a dependency on + graphics/gnomecanvas.

  • + +
  • oaf : This adds a dependency on + devel/oaf.

  • + +
  • gnomemimedata : This adds a dependency on + misc/gnomemimedata.

  • + +
  • gconf : This adds a dependency on + devel/gconf.

  • + +
  • gnomevfs : This adds a dependency on + devel/gnomevfs.

  • + +
  • libcapplet : This adds a dependency on + x11/libcapplet (replaces USE_GNOMECTRL). + If your port installs a configuration applet (or capplet), + you must include this option.

  • + +
  • gnomeprint : This adds a dependency on + print/gnomeprint.

  • + +
  • bonobo : This adds a dependency on + devel/bonobo.

  • + +
  • libgda : This adds a dependency on + databases/libgda.

  • + +
  • gnomedb : This adds a dependency on + databases/gnomedb.

  • + +
  • libglade : This adds a dependency on + devel/libglade.

  • + +
  • gal : This adds a dependency on + x11-toolkits/gal.

  • + +
  • glibwww : This adds a dependency on + www/glibwww.

  • + +
  • gtkhtml : This adds a dependency on + www/gtkhtml.

  • + +
  • libpanel : This adds a dependency on + x11/libpanel. Use this if your port installs + an applet that can be placed in the GNOME 1 panel. Note: + that even though you can have GNOME 1 applets in a + GNOME 2 desktop environment, they will not work + with the GNOME 2 panel.

  • +
-

If the ports system detects GNOME installed on the system - then GNOME components will be built. Other useful GNOME-related - macros that can be define in your port's Makefile include:

+

Let us take an example:

- -
    -
  • 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.

  • -
- -

If your port can optionally use GNOME, you must set - WANT_GNOME= yes in your Makefile, then check to see if - HAVE_GNOME is set. Since this is a conditional - evaluation, you need to stick it between bsd.port.pre.mk - and bsd.port.post.mk. For example:

- -
+	  
+USE_X_PREFIX=	yes
+USE_GNOMENG=	yes
+USE_GNOME=	gnomeprefix gnomehack gnomelibs bonobo libglade gal
+
+post-patch:
+	@${REINPLACE_CMD} -e 's|-lpthread|${PTHREAD_LIBS}|g ; \
+		s|DATADIRNAME=lib|DATADIRNAME=share|g' ${WRKSRC}/configure
+	  
+ +

This port makes use of the new GNOMENG infrastructure. It + installs into the GNOME mtree, and uses the gnomehack to + remove some common Makefile Linuxisms. Since it uses gnomehack, + the pre-install target has been changed to a + post-install target. If this is not done, then the + pre-install target from gnomehack will be overwritten. + The port also requires gnomelibs, bonobo, libglade, and gal. +

+ +

If your port can optionally use GNOME, you must set + WANT_GNOME= yes in your Makefile, then check to see if + HAVE_GNOME is set for each component from the list + above that your port can use. Since this is a conditional + evaluation, you need to stick it between bsd.port.pre.mk + and bsd.port.post.mk. For example:

+ +
 WANT_GNOME=	yes
 
 .include <bsd.port.pre.mk>
 
-.if defined(HAVE_GNOME)
-USE_GNOME=	yes
+.if ${HAVE_GNOME:Mlibpanel}!=""
+USE_GNOME+=	libpanel
 CONFIGURE_ARGS+=	--with-gnome
+PKGNAMESUFFIX=	-gnome
 .else
 CONFIGURE_ARGS+=	--without-gnome
 .endif
 
 .include <bsd.port.post.mk>
           
-

What happens here is WANT_GNOME tells the ports system - to check for the existence of gnome-config. If it - exists, HAVE_GNOME is set. If not, HAVE_GNOME - remains unset. By setting USE_GNOME after checking for - HAVE_GNOME the port will register all the GNOME - dependencies properly.

- -

When building GNOME ports, remember that many applications - require shared directories in ${PREFIX}/share/gnome. Ports - should be constructed in a way such that files placed in these - directories are removed before the package which created the - directories (i.e. the package that has an appropriate - @dirrm in its pkg-plist). For GNOME, the principle - parent port is gnomecore. If your port incudes - USE_GNOME= yes you should be fine. If you're - uncertain if you need to require any other packages, you can use - the script ${PORTSDIR}/Tools/scripts/gnomedepends.py - to examine your port's pkg-plist:

- -
-# cd /usr/ports/x11/mygnomeport
-# /usr/ports/Tools/scripts/gnomedepends.py
-According to the contents of pkg-plist the port depends on the following GNOME
-port(s):
-
-/usr/ports/mail/gmail, for directories:
-	share/gnome/help
-	share/gnome/apps
-	share/gnome
-
-/usr/ports/sysutils/gnomecontrolcenter, for directories:
-	share/gnome/apps/Settings
-	share/gnome/apps
-
-/usr/ports/textproc/scrollkeeper, for directories:
-	share/gnome/omf
-	share/gnome
-
-/usr/ports/x11/gnomecore, for directories:
-	share/gnome/apps/System
-
-/usr/ports/x11/gnomelibs, for directories:
-	share/gnome/pixmaps
-	share/gnome/help
-          
- -

To see a list of what packages your port will actually require, - use the command make package-depends.

- - - -

GNOME Internationalization

-

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

- -

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

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

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:

+

What happens here is WANT_GNOME tells the ports system + to check for the existence of the various GNOME components + listed above. For each component found, HAVE_GNOME + is updated with the name of component. Since this port + specifically can use libpanel, we check + HAVE_GNOME to see if it contains libpanel + (for more on the :Mpattern make syntax, please refer to + make(1) manpage). + If libpanel is found, then it is added the list of + USE_GNOME dependencies, and the port-specific + --with-gnome CONFIGURE_ARG is passed. + In the old GNOME infrastructure, PKGNAMESUFFIX was + automatically adjusted by the proper USE_* macro. + In GNOMENG, it is up to the individual porter to do this. + Our example port appends -gnome to the port name + to indicate it has been built with GNOME support. +

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

To enforce use of optional GNOME dependencies no matter what, + you can add WITH_GNOME= yes to /etc/make.conf + or on the make command line. This makes GNOMENG always return + true when checking for optional GNOME dependencies. If you + want GNOMENG to always return false when checking for optional + GNOME dependencies, you can add WITHOUT_GNOME= yes + to /etc/make.conf or to the make command line. +

-

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

+

Once you have finished with your port, it is a good idea to + verify 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.

- +

More information on GNOMENG can be found my looking at the source + and comments of ${PORTSDIR}/Mk/bsd.gnomeng.mk.

+

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. - This patch prevents the installation of .la files, prevents - the building and installation of static archive libraries, and - ensures that -pthread will be passed to the linker.

+ also use the GNU configure system. If your port installs + shared libraries, you should add USE_LIBTOOL= yes to + your port's Makefile. This takes care of most of the libtool + requirements, but will not prevent things such as .la files + from being installed. To ensure a proper shared library + installation, also consider adding the following line to your + port's configure script directly below the line + LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh":

+ +
+$ac_aux_dir/ltconfig $LIBTOOL_DEPS
+	    
+ +

This prevents the installation of .la files and + ensures that ${PTHREAD_LIBS} will be passed to the linker.

Distfiles

-

As GNOME 2.0 gains developer momentum, things must be done to sort - out the new GNOME 2.0 distfiles from the GNOME 1.0 distfiles, as well - as do our part to keep the distfiles directory clean. To do - this, GNOME 1.0 ports that download their distfiles from - ${MASTER_SITE_GNOME} must add the following to their +

Things must be done to sort out the new GNOME 2 distfiles from + the GNOME 1 distfiles, as well as do our part to keep the + distfiles directory clean. To do this, GNOME 1 ports that + download their distfiles from ${MASTER_SITE_GNOME} must + add the following to their Makefile:

-
+          
 DIST_SUBDIR=    gnome
-      
+
-

GNOME 2.0 ports that download their distfiles from +

GNOME 2 ports that download their distfiles from ${MASTER_SITE_GNOME} must include the following in their Makefile:

 DIST_SUBDIR=    gnome2
 	  

Some GNOME distfiles come in both tar gzip as well as tar bzip2 format. To save time when downloading distfiles over slow links, you should use the bzip2 distfiles whenever possible. To do this, add the following to your port's Makefile:

 USE_BZIP2=  yes
 	  

If you still need help with your port, have a look at some of - the existing ports for examples. - The freebsd-gnome mailing - list is also there for you.

+ the existing ports for examples. + The freebsd-gnome mailing + list is also there for you.

&footer;