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
2018-06-22 22:21:29 +00:00
# Valid ARGS: firefox, seamonkey, thunderbird
2014-04-09 10:28:23 +00:00
# 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
_GECKO_VERSION = ${ gecko_ARGS : M [0-9][0-9]* }
2014-04-09 10:28:23 +00:00
2018-06-22 22:21:29 +00:00
.if ${gecko_ARGS : Mfirefox }
2014-04-09 10:28:23 +00:00
2018-06-20 00:22:05 +00:00
_GECKO_DEFAULT_VERSION = 60
2018-12-04 00:54:38 +00:00
_GECKO_VERSIONS = 60 64
2014-04-09 10:28:23 +00:00
_GECKO_TYPE = firefox
# Dependence lines for different Firefox versions
2018-06-20 00:22:05 +00:00
60_DEPENDS = ${ LOCALBASE } /lib/firefox/firefox:www/firefox-esr
2018-12-04 00:54:38 +00:00
64_DEPENDS = ${ LOCALBASE } /lib/firefox/firefox: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 )
2018-06-17 16:50:30 +00:00
_GECKO_INSTALLED_VER != ${ PKG_QUERY } %v firefox firefox-esr
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : C / \. .*// }
2014-04-09 10:28:23 +00:00
. 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
2017-10-05 09:39:08 +00:00
_GECKO_DEFAULT_VERSION = 49
_GECKO_VERSIONS = 49
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 )
2018-06-17 16:50:30 +00:00
_GECKO_INSTALLED_VER != ${ PKG_QUERY } %v seamonkey
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : C /[0-9]* \. // : C / \. .*// }
2014-04-09 10:28:23 +00:00
. e n d i f
# Dependence lines for different Seamonkey versions
2017-10-05 09:39:08 +00:00
49_DEPENDS = ${ LOCALBASE } /lib/seamonkey/seamonkey: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
2018-07-19 00:00:51 +00:00
_GECKO_DEFAULT_VERSION = 60
_GECKO_VERSIONS = 60
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 )
2018-06-17 16:50:30 +00:00
_GECKO_INSTALLED_VER != ${ PKG_QUERY } %v thunderbird
_GECKO_INSTALLED_VER := ${ _GECKO_INSTALLED_VER : C / \. .*// }
2014-04-09 10:28:23 +00:00
. e n d i f
2014-04-09 12:37:53 +00:00
# Dependence lines for different Thunderbird versions
2018-07-19 00:00:51 +00:00
60_DEPENDS = ${ LOCALBASE } /lib/thunderbird/thunderbird:mail/thunderbird
2014-04-09 10:28:23 +00:00
. e l s e
2018-06-22 22:21:29 +00:00
IGNORE = Unknown type of gecko dependency you may specify either firefox, seamonkey or thunderbird
2014-04-09 10:28:23 +00:00
. 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 )
2014-12-03 14:55:25 +00:00
. f o r _ v i n $ { _ G E C K O _ V E R S I O N S }
2014-04-09 10:28:23 +00:00
. 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