From owner-freebsd-doc@FreeBSD.ORG Mon Nov 13 22:22:47 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 3AC3316A4B3 for ; Mon, 13 Nov 2006 22:22:47 +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 3166343D81 for ; Mon, 13 Nov 2006 22:20:17 +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 kADMK6KL057272 for ; Mon, 13 Nov 2006 22:20:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id kADMK6Kk057271; Mon, 13 Nov 2006 22:20:06 GMT (envelope-from gnats) Resent-Date: Mon, 13 Nov 2006 22:20:06 GMT Resent-Message-Id: <200611132220.kADMK6Kk057271@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-doc@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "Alejandro Pulver" Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E7A6E16A4D8 for ; Mon, 13 Nov 2006 22:11:31 +0000 (UTC) (envelope-from alepulver@FreeBSD.org) Received: from relay01.pair.com (relay01.pair.com [209.68.5.15]) by mx1.FreeBSD.org (Postfix) with SMTP id 850A943DA1 for ; Mon, 13 Nov 2006 22:11:03 +0000 (GMT) (envelope-from alepulver@FreeBSD.org) Received: (qmail 66590 invoked from network); 13 Nov 2006 22:10:42 -0000 Received: from unknown (HELO phobos.mars.bsd) (unknown) by unknown with SMTP; 13 Nov 2006 22:10:42 -0000 Message-Id: <1163455839.24155@phobos.mars.bsd> Date: Mon, 13 Nov 2006 19:10:39 -0300 From: "Alejandro Pulver" To: "FreeBSD gnats submit" X-Send-Pr-Version: gtk-send-pr 0.4.7 Cc: Subject: docs/105494: [PATCH] PH: rewrite WxWidgets entry X-BeenThere: freebsd-doc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Documentation project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Nov 2006 22:22:47 -0000 >Number: 105494 >Category: docs >Synopsis: [PATCH] PH: rewrite WxWidgets entry >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-doc >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Mon Nov 13 22:20:06 GMT 2006 >Closed-Date: >Last-Modified: >Originator: Alejandro Pulver >Release: FreeBSD 6.1-RELEASE-p1 i386 >Organization: >Environment: System: FreeBSD 6.1-RELEASE-p1 #3: Mon Jun 19 14:49:35 ART 2006 root@phobos.mars.bsd:/usr/obj/usr/src/sys/ATHLON-PHOBOS >Description: - Rewrite WxWidgets entry. >How-To-Repeat: >Fix: --- patch_wx.diff begins here --- Index: book.sgml =================================================================== RCS file: /home/dcvs/doc/en_US.ISO8859-1/books/porters-handbook/book.sgml,v retrieving revision 1.765 diff -u -r1.765 book.sgml --- book.sgml 3 Nov 2006 21:04:09 -0000 1.765 +++ book.sgml 12 Nov 2006 14:12:29 -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 found the expected version. Fortunately most of the + applications call the wx-config script to + determine the necessary compiler and linker flags, which is named + differently for all the available versions, and the majority of them + also have a variable or accept a parameter to allow modifying + it. Otherwise the applications could be modified to use one of + them. + + + + 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 + port 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 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 added when you select each component can be + manually specified by adding a suffix separated by a + :, or a default value will be used. The available + dependency types are: + + + 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 defined after defining one of the + variables 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 differen 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 Lua 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 + Lua interpreter 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. + +
--- patch_wx.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted: