From owner-freebsd-doc@FreeBSD.ORG Wed Nov 15 00:10:30 2006 Return-Path: X-Original-To: freebsd-doc@hub.freebsd.org Delivered-To: freebsd-doc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 98CC416A47C for ; Wed, 15 Nov 2006 00:10:30 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFF7943D8E for ; Wed, 15 Nov 2006 00:10:15 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id kAF0AFqx019291 for ; Wed, 15 Nov 2006 00:10:15 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kAF0AFln019290; Wed, 15 Nov 2006 00:10:15 GMT (envelope-from gnats) Date: Wed, 15 Nov 2006 00:10:15 GMT Message-Id: <200611150010.kAF0AFln019290@freefall.freebsd.org> To: freebsd-doc@FreeBSD.org From: Alejandro Pulver Cc: Subject: Re: docs/105494: [PATCH] PH: rewrite WxWidgets entry X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Alejandro Pulver List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Nov 2006 00:10:30 -0000 The following reply was made to PR docs/105494; it has been noted by GNATS. From: Alejandro Pulver To: pav@FreeBSD.org Cc: bug-followup@FreeBSD.org Subject: Re: docs/105494: [PATCH] PH: rewrite WxWidgets entry Date: Tue, 14 Nov 2006 21:06:20 -0300 O.K., here is a new one. Index: book.sgml =================================================================== RCS file: /home/dcvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v retrieving revision 1.767 diff -u -r1.767 book.sgml --- book.sgml 13 Nov 2006 22:31:33 -0000 1.767 +++ book.sgml 15 Nov 2006 00:05:12 -0000 @@ -6182,85 +6182,580 @@ - Using wxWidgets + Using <application>wxWidgets</application> - If your port uses wxWidgets - cross-platform toolkit, define USE_WX. - A specific version must be requested by setting - USE_WX=2.6. Ranges (2.4-2.6) - and partial ranges (-2.4, 2.6+) - are also possible. - - List of required wxWidgets components can be set as - WX_COMPS. Unless specified otherwise, port will - depend on wxWidgets library (wx). Available - components are: - - - Possible values for <makevar>WX_COMPS</makevar> - - - - - Value - - Means - - - - - - wx - - wxWidget libraries - - - - contrib - - wxWidget contributed libraries - - - - python - - wxPython - - - - mozilla - - wxMozilla (only available for 2.4) - - - - svg - - wxSVG (only available for 2.6) - - - -
- - If locating wxWidget libraries needs a configure argument in - addition to the WX_CONFIG variable, define - WX_CONF_ARGS in your port. Possible values - are absolute resulting in - --with-wx-config=${WX_CONFIG}, and - relative resulting in - --with-wx=${X11BASE} --with-wx-config=${WX_CONFIG} - being added to configure script arguments. - - Define WX_UNICODE=yes if your port needs - the Unicode version of the wxWidgets libraries. - - Example of port requiring Unicode versions of wxWidgets 2.6 and - contrib libraries: - - USE_WX= 2.6 -WX_COMPS= wx contrib -WX_UNICODE= yes + This section describes the status of the + wxWidgets libraries in the ports tree and + its integration with the ports system. + + + Introduction + + There are many versions of the + wxWidgets libraries which conflict + between them (install files under the same name). In the ports tree + this problem has been solved by installing each version under a + different name using version number suffixes. + + The obvious disadvantage of this is that each application has to + be modified to find the expected version. Fortunately, most of the + applications call the wx-config script to + determine the necessary compiler and linker flags. The script is + named differently for every available version. Majority of + applications respect an environment variable, or accept a configure + argument, to specify which wx-config script to + call. Otherwise they have to be patched. + + + + Version selection + + To make your port use a specific version of + wxWidgets there are two variables + available for defining (if only one is defined the other will be set + to a default value): + + + Variables to select <application>wxWidgets</application> + versions + + + + + Variable + + Description + + Default value + + + + + + USE_WX + + List of versions the port can use + + All available versions + + + + USE_WX_NOT + + List of versions the port can not use + + None + + + +
+ + The following is a list of available + wxWidgets versions and the corresponding + ports in the tree: + + + Available <application>wxWidgets</application> + versions + + + + + Version + + Port + + + + + + 2.4 + + x11-toolkits/wxgtk24 + + + + 2.6 + + x11-toolkits/wxgtk26 + + + +
+ + + The 2.6 version also comes in Unicode + version and is installed by the slave port x11-toolkits/wxgtk26-unicode, but this + can be handled with variables (see ). + + + The variables in can be set + to one or more of the following combinations separated by + spaces: + + + <application>wxWidgets</application> version + specifications + + + + Description + + Example + + + + + + Single version + + 2.4 + + + + Ascending range + + 2.4+ + + + + Descending range + + 2.6- + + + + Full range (must be ascending) + + 2.4-2.6 + + + +
+ + There are also some variables to select the preferred versions + from the available ones. They can be set to a list of versions, the + first ones will have higher priority. + + + Variables to select preferred + <application>wxWidgets</application> versions + + + + + Name + + Designed for + + + + + + WANT_WX_VER + + the port + + + + WITH_WX_VER + + the user + + + +
+ + + Component selection + + There are other applications that, while not being + wxWidgets libraries, are related to them. + These applications can be specified in the + WX_COMPS variable. The following components are + available: + + + Available <application>wxWidgets</application> + components + + + + + Name + + Description + + Version restriction + + + + + + wx + + main library + + none + + + + contrib + + contributed libraries + + none + + + + python + + wxPython + (Python bindings) + + none + + + + mozilla + + wxMozilla + + 2.4 + + + + svg + + wxSVG + + 2.6 + + + +
+ + The dependency type can be selected for each component by adding + a suffix separated by a semicolon. If not present then a default + type will be used (see ). The + following types are available: + + + Available <application>wxWidgets</application> dependency + types + + + + + Name + + Description + + + + + + build + + Component is required for building, equivalent to + BUILD_DEPENDS + + + + run + + Component is required for running, equivalent to + RUN_DEPENDS + + + + lib + + Component is required for building and running, + equivalent to LIB_DEPENDS + + + +
+ + The default values for the components are detailed in the + following table: + + + Default <application>wxWidgets</application> dependency + types + + + + + Component + + Dependency type + + + + + + wx + + lib + + + + contrib + + lib + + + + python + + run + + + + mozilla + + lib + + + + svg + + lib + + + +
+ + + Selecting <application>wxWidgets</application> + components + + The following fragment corresponds to a port which uses + wxWidgets version + 2.4 and its contributed libraries. + + USE_WX= 2.4 +WX_COMPS= wx contrib + +
+ + Unicode + + The wxWidgets library supports + Unicode since version 2.5. In the ports tree + both versions are available and can be selected with the following + variables: + + + Variables to select Unicode in + <application>wxWidgets</application> + versions + + + + + Variable + + Description + + Designed for + + + + + + WX_UNICODE + + The port works only with the + Unicode version + + the port + + + + WANT_UNICODE + + The port works with both versions but prefers the + Unicode one + + the port + + + + WITH_UNICODE + + The port will use the Unicode version + + the user + + + + WITHOUT_UNICODE + + The port will use the normal version if + supported (when WX_UNICODE is not + defined) + + the user + + + +
+ + + Do not use WX_UNICODE for ports that can + use both Unicode and normal versions. If you want the port to use + Unicode by default define WANT_UNICODE + instead. + +
+ + + Detecting installed versions + + To detect an installed version you have to define + WANT_WX. If you do not set it to a specific + version then the components will have a version suffix. The + HAVE_WX variable will be filled after + detection. + + + Detecting installed <application>wxWidgets</application> + versions and components + + The following fragment can be used in a port that uses + wxWidgets if it is installed, or an + option is selected. + + WANT_WX= yes + +.include <bsd.port.pre.mk> + +.if defined(WITH_WX) || ${HAVE_WX:Mwx-2.4} != "" +USE_WX= 2.4 +CONFIGURE_ARGS+=--enable-wx +.endif + + The following fragment can be used in a port that enables + wxPython support if it is installed or + if an option is selected, in addition to + wxWidgets, both version + 2.6. + + USE_WX= 2.6 +WX_COMPS= wx +WANT_WX= 2.6 + +.include <bsd.port.pre.mk> + +.if defined(WITH_WXPYTHON) || ${HAVE_WX:Mpython} != "" +WX_COMPS+= python +CONFIGURE_ARGS+=--enable-wxpython +.endif + + + + + Defined variables + + The following variables are available in the port (after + defining one from ). + + + Variables defined for ports that use + <application>wxWidgets</application> + + + + + Name + + Description + + + + + + WX_CONFIG + + The path to the wxWidgets + wx-config script (with different + name) + + + WXRC_CMD + + The path to the wxWidgets + wxrc program (with different + name) + + + WX_VERSION + + The wxWidgets version that + is going to be used (e.g., 2.6) + + + + WX_UNICODE + + If not defined but Unicode is going to be used then it + will be defined + + + +
+
+ + + Processing in <filename>bsd.port.pre.mk</filename> + + If you need to use the variables for running commands right + after including bsd.port.pre.mk you need to + define WX_PREMK. + + + If you define WX_PREMK, then the version, + dependencies, components and defined variables will not change if + you modify the wxWidgets port variables + after including + bsd.port.pre.mk. + + + + Using <application>wxWidgets</application> variables in + commands + + The following fragment illustrates the use of + WX_PREMK by running the + wx-config script to obtain the full version + string, assign it to a variable and pass it to the program. + + USE_WX= 2.4 +WX_PREMK= yes + +.include <bsd.port.pre.mk> + +.if exists(${WX_CONFIG}) +VER_STR!= ${WX_CONFIG} --release + +PLIST_SUB+= VERSION="${VER_STR}" +.endif + + + + The wxWidgets variables can be + safely used in commands when they are inside targets without the + need of WX_PREMK. + +