2014-04-09 10:28:23 +00:00
# $FreeBSD$
#
# Handle dependency of different gecko based applications
#
# MAINTAINER: gecko@FreeBSD.org
#
# Feature: gecko
# Usage: USES=gecko or USES=gecko:ARGS
# Valid ARGS: libxul, firefox, seamonkey, thunderbird
# in case the first argument is not libxul
# The following arguments are available
# - build: also add the dependency as a build
# dependency
# - [0-9][0-9][+]?: a version optionnally
# followed by a +
#
. i f ! d e f i n e d ( _ I N C L U D E _ U S E S _ G E C K O _ M K )
_INCLUDE_USES_GECKO_MK = yes
2014-09-28 16:36:31 +00:00
. i f e m p t y ( g e c k o _ A R G S )
gecko_ARGS = libxul
2014-04-09 10:28:23 +00:00
. e n d i f
2014-09-28 16:36:31 +00:00
_GECKO_VERSION = ${ gecko_ARGS : M [0-9][0-9]* }
2014-04-09 10:28:23 +00:00
2014-09-28 16:36:31 +00:00
.if ${gecko_ARGS : Mlibxul }
2014-04-09 10:28:23 +00:00
# Compat with older versions
GECKO = libxul
GECKO_CONFING ?= ${ LOCALBASE } /bin/${ GECKO } -config
XPIDL ?= ${ LOCALBASE } /lib/${ GECKO } /xpidl
XPIDL_INCL ?= ` ${ GECKO_CONFIG } --idlflags`
2014-10-15 15:48:16 +00:00
BUILD_DEPENDS += libxul>= 31:${ PORTSDIR } /www/libxul
RUN_DEPENDS += libxul>= 31:${ PORTSDIR } /www/libxul
2014-04-09 10:28:23 +00:00
2014-09-28 16:36:31 +00:00
.elif ${gecko_ARGS : Mfirefox }
2014-04-09 10:28:23 +00:00
2014-09-09 06:16:35 +00:00
_GECKO_DEFAULT_VERSION = 31
2014-10-15 15:48:16 +00:00
_GECKO_VERSIONS = 31 33
2014-04-09 10:28:23 +00:00
_GECKO_TYPE = firefox
# Dependence lines for different Firefox versions
2014-09-09 06:16:35 +00:00
31_DEPENDS = ${ LOCALBASE } /lib/firefox/firefox:${ PORTSDIR } /www/firefox-esr
2014-10-15 15:48:16 +00:00
33_DEPENDS = ${ LOCALBASE } /lib/firefox/firefox:${ PORTSDIR } /www/firefox
2014-04-09 10:28:23 +00:00
. i f e x i s t s ( $ { L O C A L B A S E } / b i n / f i r e f o x )
_GECKO_INSTALLED_VER != ${ LOCALBASE } /bin/firefox --version 2>/dev/null
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : M [0-9][0-9]* : C /([0-9][0-9]).*/ \1 /g }
. e n d i f
2014-09-28 16:36:31 +00:00
.elif ${gecko_ARGS : Mseamonkey }
2014-04-09 10:28:23 +00:00
2014-10-18 10:23:53 +00:00
_GECKO_DEFAULT_VERSION = 30
_GECKO_VERSIONS = 30
2014-04-09 10:28:23 +00:00
_GECKO_TYPE = seamonkey
. i f e x i s t s ( $ { L O C A L B A S E } / b i n / s e a m o n k e y )
_GECKO_INSTALLED_VER != ${ LOCALBASE } /bin/seamonkey --version 2>/dev/null
2014-05-06 19:13:09 +00:00
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : M [0-9]* : C /[0-9].([0-9][0-9]).*/ \1 /g }
2014-04-09 10:28:23 +00:00
. e n d i f
# Dependence lines for different Seamonkey versions
2014-10-18 10:23:53 +00:00
30_DEPENDS = ${ LOCALBASE } /lib/seamonkey/seamonkey:${ PORTSDIR } /www/seamonkey
2014-04-09 10:28:23 +00:00
2014-09-28 16:36:31 +00:00
.elif ${gecko_ARGS : Mthunderbird }
2014-04-09 10:28:23 +00:00
2014-08-04 09:11:25 +00:00
_GECKO_DEFAULT_VERSION = 31
_GECKO_VERSIONS = 31
2014-04-09 10:28:23 +00:00
_GECKO_TYPE = thunderbird
. i f e x i s t s ( $ { L O C A L B A S E } / b i n / t h u n d e r b i r d )
_GECKO_INSTALLED_VER != ${ LOCALBASE } /bin/thunderbird --version 2>/dev/null
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : M [0-9][0-9]* : C /([0-9][0-9]).*/ \1 /g }
. e n d i f
2014-04-09 12:37:53 +00:00
# Dependence lines for different Thunderbird versions
2014-08-04 09:11:25 +00:00
31_DEPENDS = ${ LOCALBASE } /lib/thunderbird/thunderbird:${ PORTSDIR } /mail/thunderbird
2014-04-09 10:28:23 +00:00
. e l s e
IGNORE = Unknown type of gecko dependency you may specify either libxul, firefox, seamonkey or thunderbird
. e n d i f
. i f d e f i n e d ( _ G E C K O _ T Y P E )
.if ${_GECKO_VERSION : M *+}
_GECKO_MIN_VERSION := ${ _GECKO_VERSION : S /+// }
_GECKO_WANTED_VERSIONS := ${ _GECKO_DEFAULT_VERSION }
. e n d i f
.if ${_GECKO_VERSION : M [0-9][0-9]}
_GECKO_WANTED_VERSIONS := ${ _GECKO_VERSION : M [0-9][0-9] }
. e n d i f
_GECKO_WANTED_VERSIONS ?= ${ _GECKO_DEFAULT_VERSION }
. i f d e f i n e d ( _ G E C K O _ M I N _ V E R S I O N )
. f o r _ v i n _ G E C K O _ V E R S I O N S
. i f $ { _ G E C K O _ M I N _ V E R S I O N } < = $ { _ v }
_GECKO_WANTED_VERSIONS += ${ _v }
. e n d i f
. e n d f o r
. e n d i f
.for _v in ${_GECKO_WANTED_VERSIONS : O :u }
_GECKO_HIGHEST_VERSION := ${ _v }
. i f d e f i n e d ( _ G E C K O _ I N S T A L L E D _ V E R ) & & ${_GECKO_INSTALLED_VER} = = ${ _v }
_GECKO_WANTED_VERSION := ${ _v }
. e n d i f
. e n d f o r
. i f ! d e f i n e d ( _ G E C K O _ W A N T E D _ V E R S I O N )
. i f d e f i n e d ( _ G E C K O _ I N S T A L L E D _ V E R )
IGNORE = cannot install: ${ _GECKO_TYPE } versions mismatch: ${ _GECKO_TYPE } -${ _GECKO_INSTALLED_VER } is installed and wanted version is ${ _GECKO_TYPE } -${ _GECKO_VERSION : M [0-9][0-9] }
. e l s e
_GECKO_WANTED_VERSION := ${ _GECKO_HIGHEST_VERSION }
. e n d i f
. e n d i f
2014-09-28 16:36:31 +00:00
.if ${gecko_ARGS : Mbuild }
2014-04-09 10:28:23 +00:00
BUILD_DEPENDS += ${ ${ _GECKO_WANTED_VERSION } _DEPENDS }
. e n d i f
RUN_DEPENDS += ${ ${ _GECKO_WANTED_VERSION } _DEPENDS }
. e n d i f
. e n d i f