diff --git a/en/gnome/docs/porting.sgml b/en/gnome/docs/porting.sgml index b448c9c0e5..2e660c6ab9 100644 --- a/en/gnome/docs/porting.sgml +++ b/en/gnome/docs/porting.sgml @@ -1,358 +1,380 @@ - + %gnomeincludes; %includes; ]> &header;
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 MacrosRecently, 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 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> The list of GNOME components consists of one or more of the following separated by a single space:
Let us take an 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 ${HAVE_GNOME:Mlibpanel}!="" USE_GNOME+= gnomeprefix libpanel CONFIGURE_ARGS+= --with-gnome PKGNAMESUFFIX= -gnome PLIST_SUB= DATADIR="share/gnome" .else CONFIGURE_ARGS+= --without-gnome PLIST_SUB= DATADIR="share" .endif .include <bsd.port.post.mk> 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, its name is appended to HAVE_GNOME. Since this port can use libpanel, we check HAVE_GNOME to see if it contains libpanel (for more on the :Mpattern make syntax, please refer to the 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. The same is true for the DATADIR PLIST_SUB. In GNOMENG, the individual porter must decide when do the DATADIR substitution. A good rule of thumb is to add the DATADIR PLIST_SUB when using the gnomeprefix component. +Note: You cannot add extra default USE_GNOME + components after the .include <bsd.port.pre.mk>. + That is, the following is wrong + : + ++.include <bsd.port.pre.mk> + +.if ${HAVE_GNOME:Mgnomelibs}!="" +USE_GNOME+= gnomelibs +.else +USE_GNOME+= gtk12 # WRONG! +.endif ++ + This will make GNOMENG think that GNOME is desired, and + mark the pkg-plist accordingly thus breaking package + builds. If you need to add default USE_GNOME + components, do so above the + .include <bsd.port.pre.mk> line. + +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. 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 by looking at the source and comments of ${PORTSDIR}/Mk/bsd.gnomeng.mk. Note: GNOMENG is temporary. That is, it was put in place so that ports could be gradually migrated from the old infrastructure to the new one. Once all ports have been migrated, the old porting infrastructure as well as the USE_GNOMENG macro will be removed. Libtool IssuesMost if not all GNOME applications depend on GNU's libtool. They 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. DistfilesThings 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 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. |