aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralepulver <alepulver@FreeBSD.org>2006-11-14 05:15:38 +0800
committeralepulver <alepulver@FreeBSD.org>2006-11-14 05:15:38 +0800
commitcdbf5b60b607060eaffbdda9a4a56daf54f5bb7e (patch)
tree5226f82e22b959b3e53dabf6d7dd64871f861f22
parentb25f8e7ce6ebeda8c9a479c2977efb2175aa56ca (diff)
downloadfreebsd-ports-gnome-cdbf5b60b607060eaffbdda9a4a56daf54f5bb7e.tar.gz
freebsd-ports-gnome-cdbf5b60b607060eaffbdda9a4a56daf54f5bb7e.tar.zst
freebsd-ports-gnome-cdbf5b60b607060eaffbdda9a4a56daf54f5bb7e.zip
- Some comment fixes.
- Change dependency type separator from "_" to ":". - Add WX_PREMK, WANT_UNICODE, WITHOUT_UNICODE, WXRC_CMD. - Fix dependencies when using multiple components.
-rw-r--r--Mk/bsd.wx.mk203
1 files changed, 87 insertions, 116 deletions
diff --git a/Mk/bsd.wx.mk b/Mk/bsd.wx.mk
index 9bb53321af25..21fb6aa6ff75 100644
--- a/Mk/bsd.wx.mk
+++ b/Mk/bsd.wx.mk
@@ -14,7 +14,7 @@
# components (with run and/or build dependencies). It can be used after and/or
# before bsd.port.pre.mk, but Python components will only work if Python
# variables (e.g. USE_PYTHON) are defined before it (this is a bsd.python.mk
-# limitation).
+# limitation), at least it is manually included.
# USE_WX - Set to the list of WxWidgets versions that can be used by
# the port. The syntax allows the following elements:
# - Single version (e.g. "2.4").
@@ -29,7 +29,7 @@
# WX_COMPS - Set to the list of WxWidgets components the port uses.
# Several components can be specified separated by spaces. By
# default it will have the value of "wx". Suffixes in the form
-# "_xxx" may be added to the components to determine the
+# ":xxx" may be added to the components to determine the
# dependency type.
# The available components are:
# wx - The WxWidgets library.
@@ -41,20 +41,23 @@
# build - Requires component for building.
# lib - Requires component for building and running.
# run - Requires component for running.
-# If no suffix is present then "lib" will be used.
+# If no suffix is present then "run" will be used for "python"
+# and "lib" for others.
# WX_CONF_ARGS - Set to "absolute" or "relative" if the port needs configure
# arguments in addition to the WX_CONFIG environment variable.
# It determines the type of parameters that have to be passed
# to the configure script. In the first case it adds
-# "--with-wx-config=${WX_CONFIG}" (absolute path of WX_CONFIG),
-# and in second one "--with-wx=${X11BASE}" and
+# "--with-wx-config=${WX_CONFIG}" (absolute path of
+# WX_CONFIG), and in second one "--with-wx=${X11BASE}" plus
# "--with-wx-config=${WX_CONFIG:T} (prefix and name).
-# WX_UNICODE - Set to "yes" (or anything) if the port needs the Unicode
-# version of the WxWidgets library and/or contributed
-# libraries.
+# WX_PREMK - Define to determine version and define WX_CONFIG/WX_VERSION
+# after <bsd.port.pre.mk> (in case the port needs to manually run
+# the script).
+# WX_UNICODE - Define if the port needs the Unicode version of the
+# WxWidgets library and/or contributed libraries.
# NOTE: this should NOT be used for ports that can be compiled
-# with Unicode or not, but for the ones that require it. The
-# first case is handled by the user variable WITH_UNICODE.
+# with Unicode or not, but for the ones that require it.
+# WANT_UNICODE - Define if the port prefers Unicode, but doesn't require it.
# WANT_WX - Set to "yes" or a valid single version (no ranges, etc).
# In both cases it will detect the installed WxWidgets
# components and add them to the variable HAVE_WX. If a
@@ -70,23 +73,23 @@
#
# The following variables are intended for the user and can be defined in
# make.conf.
-# WITH_UNICODE - If the variable is defined and both the running FreeBSD
-# version and the selected WxWidgets version support Unicode,
-# then the Unicode version of WxWidgets is used.
-# WITH_WX_VER - If the variable is defined the version it contains will be
-# used as the default for ports that support multiple
-# WxWidgets versions. It can contain multiple versions, and
-# the last possible one will be used.
+# WITH_UNICODE - Define if you prefer the Unicode version when available.
+# WITHOUT_UNICODE
+# - Define if you prefer the non Unicode version (this
+# variable disables WITH_UNICODE and WANT_UNICODE).
+# WITH_WX_VER - Define to the list of prefered versions in reverse order.
#
# The following variables are defined by this file, to be read from the port.
+# WX_CONFIG - The path to the wx-config program (with different name).
+# WXRC_CMD - The path to the wxrc program (with different name).
+# WX_VERSION - The WxWidgets version that is going to be used.
# WX_UNICODE - If this variable is not defined by the port (which means it
# requires the Unicode version of WxWidgets), it will be
# defined in the case the Unicode version is used (enabled by
-# the user through WITH_UNICODE).
-# WX_VERSION - The WxWidgets version that is going to be used.
+# WITH_UNICODE or WANT_UNICODE).
# HAVE_WX - The list of WxWidgets components installed, if WANT_WX was
# defined. The components will have version suffix if it was
-# set to "yes").
+# set to "yes".
#
# Examples:
# - A port that needs WxWidgets 2.6 and contributed libraries with Unicode.
@@ -96,11 +99,11 @@
# - A port that needs WxPython 2.4 for running.
# USE_PYTHON= yes
# USE_WX= 2.4
-# WX_COMPS= python_run
+# WX_COMPS= python:run
# - A port that needs WxPython 2.4 or 2.6 for building.
# USE_PYTHON= yes
# USE_WX= 2.4 2.6
-# WX_COMPS= python_build
+# WX_COMPS= python:build
# - A port that needs WxWidgets version 2.4 or higher and contributed
# libraries.
# USE_WX= 2.4+
@@ -108,11 +111,6 @@
# - A port that needs WxWidgets of any version other than 2.4.
# USE_WX_NOT= 2.4
#
-# Notes:
-# - The version is processed on each inclusion, so USE_WX, USE_WX_NOT and
-# WX_UNICODE can be modified before and after including bsd.port.pre.mk.
-# After determining the version and Unicode, WX_CONFIG will be defined.
-#
WX_Include_MAINTAINER= alepulver@FreeBSD.org
@@ -129,20 +127,14 @@ _WX_Definitions_Done= yes
# _WX_DEP_TYPES_ALL - List of valid dependency types.
# _WX_VERS_ALL - List of supported versions.
# _WX_VERS_UC_ALL - List of Unicode capable versions.
-# _WX_CHANGE_VARS - List of variables allowed to change between pre and
-# post inclusions (related to version).
-# _WX_LISTS_ORDER - Reverse lists preference order.
-# _WX_AUTO_VARS - Variables defined sometimes that may have to be
-# redefined later.
+# _WX_VERS_LISTS - Reverse lists preference order.
#
_WX_COMPS_ALL= wx contrib python mozilla svg
_WX_DEP_TYPES_ALL= build lib run
_WX_VERS_ALL= 2.4 2.6
_WX_VERS_UC_ALL= 2.6
-_WX_CHANGE_VARS= USE_WX USE_WX_NOT WX_UNICODE
-_WX_LISTS_ORDER= _WX_VER_FINAL WANT_WX_VER WITH_WX_VER
-_WX_AUTO_VARS= USE_WX WX_CONFIG
+_WX_VERS_LISTS= WANT_WX_VER WITH_WX_VER
#
# Variables used to determine what is needed:
@@ -150,55 +142,74 @@ _WX_AUTO_VARS= USE_WX WX_CONFIG
# _WX_LIB_comp_ver - Name of the shared library (optional).
# _WX_SHVER_comp_ver - Shared library version (optional).
# _WX_FILE_comp_ver - File installed by that component.
+# _WX_DEPTYPE_comp_ver - Default dependency type (optional).
#
-_WX_PORT_wx_2.4= wxgtk24
+_WX_PORT_wx_2.4= x11-toolkits/wxgtk24
_WX_LIB_wx_2.4= wx_gtk2-2.4
-_WX_PORT_contrib_2.4= wxgtk24-contrib
+_WX_PORT_contrib_2.4= x11-toolkits/wxgtk24-contrib
_WX_LIB_contrib_2.4= wx_gtk2_canvas-2.4
-_WX_PORT_python_2.4= py-wxPython24
+_WX_PORT_python_2.4= x11-toolkits/py-wxPython24
_WX_FILE_python_2.4= ${PYTHON_SITELIBDIR}/wx/__init__.py
-_WX_PORT_mozilla_2.4= wxmozilla
+_WX_PORT_mozilla_2.4= x11-toolkits/wxmozilla
_WX_LIB_mozilla_2.4= wxmozilla_gtk2-2.4
-_WX_PORT_wx_2.6= wxgtk26${_WX_UCL}
+_WX_PORT_wx_2.6= x11-toolkits/wxgtk26${_WX_UCL}
_WX_LIB_wx_2.6= wx_base${_WX_UC}-2.6
-_WX_PORT_contrib_2.6= wxgtk26${_WX_UCL}-contrib
+_WX_PORT_contrib_2.6= x11-toolkits/wxgtk26${_WX_UCL}-contrib
_WX_LIB_contrib_2.6= wx_gtk2${_WX_UC}_animate-2.6
-_WX_PORT_python_2.6= py-wxPython26${_WX_UCL}
+_WX_PORT_python_2.6= x11-toolkits/py-wxPython26${_WX_UCL}
_WX_FILE_python_2.6= ${PYTHON_SITELIBDIR}/wx-2.6-gtk2${_WX_PYSUFX}/wx/__init__.py
-_WX_PORT_svg_2.6= wxsvg
+_WX_PORT_svg_2.6= x11-toolkits/wxsvg
_WX_LIB_svg_2.6= wxsvg
# Set _WX_SHVER_comp_ver to 0 and _WX_FILE_comp_ver for libs appropiately.
+# Set _WX_DEPTYPE_comp_ver for "python" to "run", and others to "lib".
.for comp in ${_WX_COMPS_ALL}
+_WX_COMP= ${comp}
. for ver in ${_WX_VERS_ALL}
. if defined(_WX_LIB_${comp}_${ver})
_WX_SHVER_${comp}_${ver}= 0
_WX_FILE_${comp}_${ver}= ${X11BASE}/lib/lib${_WX_LIB_${comp}_${ver}}.so.${_WX_SHVER_${comp}_${ver}}
. endif
+. if ${_WX_COMP} == "python"
+_WX_DEPTYPE_${comp}_${ver}= run
+. else
+_WX_DEPTYPE_${comp}_${ver}= lib
+. endif
. endfor
.endfor
.endif # !_WX_Defined_Done
#
+# Check if the user/port wants Unicode.
+#
+
+.if ${OSVERSION} >= 500000 && (!defined(WITHOUT_UNICODE) && \
+ (defined(WITH_UNICODE) || defined(WANT_UNICODE)))
+_WX_UC_AVAILABLE= yes
+.else
+.undef _WX_UC_AVAILABLE
+.endif
+
+#
# Check for present components.
#
-.if !defined(AFTERPORTMK) && defined(WANT_WX)
+.if defined(WANT_WX) && defined(BEFOREPORTMK)
# Check if Unicode will be used.
. for __WANT_WX in ${WANT_WX}
-. if defined(WITH_UNICODE) && ${OSVERSION} >= 500000 && \
+. if defined(_WX_UC_AVAILABLE) && \
(${_WX_VERS_UC_ALL:M${__WANT_WX}} != "" || ${WANT_WX:L} == "yes")
_WX_WANT_UNICODE= yes
. endif
@@ -247,50 +258,17 @@ HAVE_WX+= ${comp}
IGNORE?= selected an invalid value for WANT_WX: ${__WANT_WX}
. endif
. endfor
-.endif # ! AFTERPORTMK && WANT_WX
-
-#
-# Check if the version has changed between inclusions.
-#
-
-.if defined(_WX_Version_Done)
-. undef _WX_HAS_CHANGED
-
-. for var in ${_WX_CHANGE_VARS}
-. if (defined(${var}) && !defined(_WX_OLD_${var})) || \
- (!defined(${var}) && defined(_WX_OLD_${var})) || \
- (defined(_WX_OLD_${var}) && ${_WX_OLD_${var}} != ${${var}})
-_WX_HAS_CHANGED= yes
-. endif
-. endfor
-.endif # _WX_Version_Done
+.endif # WANT_WX && BEFOREPORTMK
#
# Select WxWidgets version.
#
-.if (!defined(_WX_Version_Done) || defined(_WX_HAS_CHANGED)) && \
- (defined(USE_WX) || defined(USE_WX_NOT))
+.if !defined(_WX_Version_Done) && (defined(_POSTMKINCLUDED) || \
+ (defined(WX_PREMK) && defined(BEFOREPORTMK) && \
+ (defined(USE_WX) || defined(USE_WX_NOT))))
_WX_Version_Done= yes
-# Handle automatic variables.
-
-.for var in ${_WX_AUTO_VARS}
-. if defined(_WX_${var}_DEFINED)
-. undef ${var}
-. endif
-. if !defined(${var})
-_WX_${var}_DEFINED= yes
-. endif
-.endfor
-
-# Reset old variable values.
-
-.if defined(_WX_HAS_CHANGED)
-. undef _WX_VER
-. undef _WX_IGNORE
-.endif
-
# Set defaults (if one isn't present).
USE_WX?= ${_WX_VERS_ALL}
@@ -349,7 +327,7 @@ _WX_VER_MERGED+= ${ver}
# Check for a null version.
.if empty(_WX_VER_MERGED)
-_WX_IGNORE?= selected a null or invalid WxWidgets version
+IGNORE?= selected a null or invalid WxWidgets version
.endif
#
@@ -365,9 +343,9 @@ _WX_VER_UC+= ${ver}
. endif
.endfor
-# Requested by the user (optional).
+# Requested by the user or port (optional).
-.if defined(WITH_UNICODE) && ${OSVERSION} >= 500000
+.if defined(_WX_UC_AVAILABLE)
. for ver in ${_WX_VER_UC}
. if ${_WX_VERS_UC_ALL:M${ver}} != ""
WX_UNICODE= yes
@@ -379,9 +357,9 @@ WX_UNICODE= yes
.if defined(WX_UNICODE)
. if ${OSVERSION} < 500000
-_WX_IGNORE?= requires FreeBSD versions >= 5.X (because of Unicode)
+IGNORE?= requires FreeBSD versions >= 5.X (because of Unicode)
. elif empty(_WX_VER_UC)
-_WX_IGNORE?= selected a WxWidgets version which does not support Unicode: ${_WX_VER_MERGED}
+IGNORE?= selected a WxWidgets version which does not support Unicode: ${_WX_VER_MERGED}
. endif
.endif
@@ -410,7 +388,7 @@ _WX_PYSUFX= -ansi
# 3) _WX_VER_FINAL - Available versions.
#
-.for list in ${_WX_LISTS_ORDER}
+.for list in _WX_VER_FINAL ${_WX_VERS_LISTS}
. if defined(${list})
. for ver in ${${list}}
. if ${_WX_VER_FINAL:M${ver}} != ""
@@ -424,29 +402,18 @@ _WX_VER= ${ver}
# Set variables.
#
-WX_VERSION= ${_WX_VER}
WX_CONFIG?= ${X11BASE}/bin/wxgtk2${_WX_UC}-${_WX_VER}-config
+WXRC_CMD?= ${X11BASE}/bin/wxrc-gtk2${_WX_UC}-${_WX_VER}
+WX_VERSION?= ${_WX_VER}
-# Define old values for detecting changes.
-
-.for var in ${_WX_CHANGE_VARS}
-. if defined(${var})
-_WX_OLD_${var}:= ${${var}}
-. endif
-.endfor
-
-.endif # ! _WX_Version_Done || _WX_HAS_CHANGED
+.endif # !_WX_Version_Done && (_POSTMKINCLUDED || \
+# (WX_PREMK && BEFOREPORTMK && (USE_WX || USE_WX_NOT)))
#
# Process components list and add dependencies, variables, etc.
#
-.if !defined(BEFOREPORTMK)
-# Error check.
-
-.if defined(_WX_IGNORE)
-IGNORE?= ${_WX_IGNORE}
-.endif
+.if defined(_POSTMKINCLUDED)
#
# Component parsing.
@@ -466,10 +433,11 @@ WX_COMPS?= wx
_WX_COMPS_FINAL= #
.for comp in ${WX_COMPS}
-_WX_COMP= ${comp:C/_([[:alpha:]]+)$//}
-_WX_DEP_TYPE= ${comp:C/.+_([[:alpha:]]+)$/\1/}
+_WX_COMP= ${comp:C/:([[:alpha:]]+)$//}
. if ${_WX_COMP} == ${comp}
-_WX_DEP_TYPE= lib
+_WX_DEP_TYPE= ${_WX_DEPTYPE_${comp}_${_WX_VER}}
+. else
+_WX_DEP_TYPE= ${comp:C/.+:([[:alpha:]]+)$/\1/}
. endif
_WX_COMP_NEW= ${_WX_COMP}_${_WX_DEP_TYPE}
. for __WX_COMP in ${_WX_COMP}
@@ -501,16 +469,19 @@ _WX_COMPS_FINAL+= ${newcomp}
.for comp in ${_WX_COMPS_FINAL}
_WX_COMP= ${comp:C/_([[:alpha:]]+)$//}
_WX_DEP_TYPE= ${comp:C/.+_([[:alpha:]]+)$/\1/}
-. if ${_WX_DEP_TYPE} == "lib"
-. if defined(_WX_LIB_${_WX_COMP}_${_WX_VER})
-LIB_DEPENDS+= ${_WX_LIB_${_WX_COMP}_${_WX_VER}}:${PORTSDIR}/x11-toolkits/${_WX_PORT_${_WX_COMP}_${_WX_VER}}
+# XXX Need a .for loop here so the variable is expanded before the assignment.
+. for comp_part in ${_WX_COMP}
+. if ${_WX_DEP_TYPE} == "lib"
+. if defined(_WX_LIB_${_WX_COMP}_${_WX_VER})
+LIB_DEPENDS+= ${_WX_LIB_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
+. else
+BUILD_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
+RUN_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
+. endif
. else
-BUILD_DEPENDS+= ${_WX_FILE_${_WX_COMP}_${_WX_VER}}:${PORTSDIR}/x11-toolkits/${_WX_PORT_${_WX_COMP}_${_WX_VER}}
-RUN_DEPENDS+= ${_WX_FILE_${_WX_COMP}_${_WX_VER}}:${PORTSDIR}/x11-toolkits/${_WX_PORT_${_WX_COMP}_${_WX_VER}}
+${_WX_DEP_TYPE:U}_DEPENDS+= ${_WX_FILE_${comp_part}_${_WX_VER}}:${PORTSDIR}/${_WX_PORT_${comp_part}_${_WX_VER}}
. endif
-. else
-${_WX_DEP_TYPE:U}_DEPENDS+= ${_WX_FILE_${_WX_COMP}_${_WX_VER}}:${PORTSDIR}/x11-toolkits/${_WX_PORT_${_WX_COMP}_${_WX_VER}}
-. endif
+. endfor
.endfor
#
@@ -531,4 +502,4 @@ IGNORE?= selected an invalid WxWidgets configure argument type: ${WX_CONF_ARG
. endif
.endif
-.endif # ! BEFOREPORTMK
+.endif # _POSTMKINCLUDED