From beat@FreeBSD.org  Sat Dec 11 14:46:54 2010
Return-Path: <beat@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 9510D106564A
	for <FreeBSD-gnats-submit@FreeBSD.org>; Sat, 11 Dec 2010 14:46:54 +0000 (UTC)
	(envelope-from beat@FreeBSD.org)
Received: from marvin.chruetertee.ch (marvin.chruetertee.ch [217.150.245.55])
	by mx1.freebsd.org (Postfix) with ESMTP id 242378FC13
	for <FreeBSD-gnats-submit@FreeBSD.org>; Sat, 11 Dec 2010 14:46:53 +0000 (UTC)
Received: from _HOSTNAME_ (111-92.76-83.cust.bluewin.ch [83.76.92.111])
	(authenticated bits=0)
	by marvin.chruetertee.ch (8.14.3/8.14.3) with ESMTP id oBBEkprw060343
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NO)
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 11 Dec 2010 14:46:51 GMT
	(envelope-from beat@FreeBSD.org)
Received: by _HOSTNAME_ (sSMTP sendmail emulation); Sat, 11 Dec 2010 15:46:54 +0100
Message-Id: <201012111446.oBBEkprw060343@marvin.chruetertee.ch>
Date: Sat, 11 Dec 2010 15:46:54 +0100
From: Beat Gtzi <beat@FreeBSD.org>
Reply-To: Beat Gtzi <beat@FreeBSD.org>
To: FreeBSD-gnats-submit@FreeBSD.org
Cc:
Subject: [PATCH] Mk/bsd.gecko.mk: Implement variables for Mozilla dependencies
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         153018
>Category:       ports
>Synopsis:       [PATCH] Mk/bsd.gecko.mk: Implement variables for Mozilla dependencies
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    beat
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 11 14:50:06 UTC 2010
>Closed-Date:    Sat Dec 18 11:17:25 UTC 2010
>Last-Modified:  Sat Dec 18 11:20:09 UTC 2010
>Originator:     Beat Gtzi
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD daedalus.network.local 8.1-RELEASE FreeBSD 8.1-RELEASE #18 r210472M: Sun Jul 25 19:44:08 CEST 2010 root@daedalus.network.local:/usr/obj/usr/src/sys/BEASTIE i386


	
>Description:
	- This patch implements new variables in bsd.gecko.mk to define runtime
	and/or buildtime dependencies on Mozilla ports.
	As this patch touches bsd.port.mk it needs portmgr's approval and
	maybe an exp-run.
>How-To-Repeat:
	
>Fix:

	

--- bsd.gecko.mk_USE_FOO.patch begins here ---
Index: bsd.gecko.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.gecko.mk,v
retrieving revision 1.25
diff -u -r1.25 bsd.gecko.mk
--- bsd.gecko.mk	30 Nov 2010 13:03:10 -0000	1.25
+++ bsd.gecko.mk	11 Dec 2010 14:31:27 -0000
@@ -168,6 +168,261 @@
 .endif
 .endif
 
+.elif !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include) && (defined(USE_FIREFOX) || defined(USE_FIREFOX_BUILD) || defined(USE_SEAMONKEY) || defined(USE_SEAMONKEY_BUILD) || defined(USE_THUNDERBIRD) || defined(USE_THUNDERBIRD_BUILD))
+Gecko_Pre_Include=			bsd.gecko.mk
+
+# Ports can use the following:
+#
+# USE_FIREFOX             Add runtime dependency on Firefox. If no version
+#                         is given by the maintainer via the port or by the
+#                         user via defined variable try to find the highest
+#                         stable installed version.
+#                         Available values: yes 36+ 35+ 36 35
+#                         NOTE:
+#                         default value 36 is used in case of USE_FIREFOX=yes
+#
+# USE_FIREFOX_BUILD       Add buildtime dependency on Firefox.
+#                         Available values: see USE_FIREFOX
+#
+# USE_SEAMONKEY           Add runtime dependency on SeaMonkey. If no
+#                         version is given by the maintainer via the port 
+#                         or by the user via defined variable try to find
+#                         the highest stable installed version.
+#                         Available values: yes 11+ 20+ 11 20
+#                         NOTE:
+#                         default value 20 is used in case of USE_SEAMONKEY=yes
+#
+# USE_SEAMONKEY_BUILD     Add buildtime dependency on SeaMonkey.
+#                         Available values: see USE_SEAMONKEY
+#
+# USE_THUNDERBIRD         Add runtime dependency on Thunderbird. If no 
+#                         version is given by the maintainer via the port 
+#                         or by the user via defined variable try to find 
+#                         the highest stable installed version.
+#                         Available values: yes 31+ 30+ 31 30
+#                         NOTE:
+#                         default value 31 is used in case of USE_THUNDERBIRD=yes
+#
+# USE_THUNDERBIRD_BUILD   Add buildtime dependency on Thunderbird.
+#                         Available values: see USE_THUNDERBIRD
+#
+
+#
+# Firefox part
+#
+.if defined(USE_FIREFOX) || defined(USE_FIREFOX_BUILD)
+
+# Process USE_FIREFOX_BUILD
+.if defined(USE_FIREFOX_BUILD)
+USE_FIREFOX:=				${USE_FIREFOX_BUILD}
+_FIREFOX_BUILD_DEPENDS=		yes
+.endif
+
+_FIREFOX_DEFAULT_VERSION=	36
+_FIREFOX_VERSIONS=			36 35
+_FIREFOX_RANGE_VERSIONS=	36+ 35+
+
+# For specifying [36, 35, ..]+
+_FIREFOX_35P=	35 ${_FIREFOX_36P}
+_FIREFOX_36P=	36
+
+# Set the default Firefox version and check if USE_FIREFOX=yes was given
+.if ${USE_FIREFOX} == "yes"
+USE_FIREFOX=	${_FIREFOX_DEFAULT_VERSION}
+.endif
+
+# Setting/finding Firefox version we want.
+.if exists(${LOCALBASE}/bin/firefox3)
+_FIREFOX_VER!=	${LOCALBASE}/bin/firefox3 --version | ${SED} -e 's/Mozilla Firefox \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.elif exists(${LOCALBASE}/bin/firefox)
+_FIREFOX_VER!=	${LOCALBASE}/bin/firefox --version | ${SED} -e 's/Mozilla Firefox \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.endif
+
+# Check if installed Firefox version matches the wanted one
+.if defined(_FIREFOX_VER)
+_SUPFIREFOX=		no
+.if ${USE_FIREFOX:C/[0-9][0-9]//} == "+"
+.for ver in ${_FIREFOX_RANGE_VERSIONS}
+.if ${USE_FIREFOX} == "${ver}"
+_MATCHED_FIREFOX_VER:=	${ver:S/+//}
+.for firefox in ${_FIREFOX_${_MATCHED_FIREFOX_VER}P}
+.if ${_FIREFOX_VER} == ${firefox}
+_SUPFIREFOX=		yes
+USE_FIREFOX=		${_FIREFOX_VER}
+.endif
+.endfor
+.endif
+.endfor
+.else
+.if ${_FIREFOX_VER} == ${USE_FIREFOX}
+_SUPFIREFOX=		yes
+.endif
+.endif
+.if ${_SUPFIREFOX} == no
+IGNORE=			cannot install: Firefox versions mismatch: firefox-${_FIREFOX_VER:C/([0-9])([0-9])/\1.\2/} is installed and wanted version is firefox-${USE_FIREFOX:C/([0-9])([0-9])/\1.\2/}
+.endif
+.endif
+
+.if !defined(_FIREFOX_${USE_FIREFOX:S/+//}P)
+IGNORE=			cannot install: unknown Firefox version: firefox-${USE_FIREFOX:C/([0-9])([0-9])/\1.\2/}
+.endif
+
+# Dependence lines for different Firefox versions
+36_DEPENDS=		${LOCALBASE}/lib/firefox3/firefox:${PORTSDIR}/www/firefox
+35_DEPENDS=		${LOCALBASE}/lib/firefox3/firefox:${PORTSDIR}/www/firefox35
+
+# Add dependencies
+.if defined(USE_FIREFOX)
+.if defined(_FIREFOX_BUILD_DEPENDS)
+BUILD_DEPENDS+= ${${USE_FIREFOX}_DEPENDS}
+.endif
+RUN_DEPENDS+=	${${USE_FIREFOX}_DEPENDS}
+.endif
+
+.endif # defined(USE_FIREFOX)
+#
+# SeaMonkey part
+#
+.if defined(USE_SEAMONKEY) || defined(USE_SEAMONKEY_BUILD)
+
+# Process USE_SEAMONKEY_BUILD
+.if defined(USE_SEAMONKEY_BUILD)
+USE_SEAMONKEY:=				${USE_SEAMONKEY_BUILD}
+_SEAMONKEY_BUILD_DEPENDS=	yes
+.endif
+
+_SEAMONKEY_DEFAULT_VERSION=	20
+_SEAMONKEY_VERSIONS=		11 20
+_SEAMONKEY_RANGE_VERSIONS=	11+ 20+
+
+# For specifying [20, 11, ..]+
+_SEAMONKEY_11P=	11 ${_SEAMONKEY_20P}
+_SEAMONKEY_20P=	20
+
+# Set the default SeaMonkey version and check if USE_SEAMONKEY=yes was given
+.if ${USE_SEAMONKEY} == "yes"
+USE_SEAMONKEY=	${_SEAMONKEY_DEFAULT_VERSION}
+.endif
+
+# Setting/finding SeaMonkey version we want.
+.if exists(${LOCALBASE}/bin/seamonkey)
+_SEAMONKEY_VER!=	${LOCALBASE}/bin/seamonkey --version | ${SED} -e 's/Mozilla SeaMonkey \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.endif
+
+# Check if installed SeaMonkey version matches the wanted one
+.if defined(_SEAMONKEY_VER)
+_SUPSEAMONKEY=		no
+.if ${USE_SEAMONKEY:C/[0-9][0-9]//} == "+"
+.for ver in ${_SEAMONKEY_RANGE_VERSIONS}
+.if ${USE_SEAMONKEY} == "${ver}"
+_MATCHED_SEAMONKEY_VER:=	${ver:S/+//}
+.for seamonkey in ${_SEAMONKEY_${_MATCHED_SEAMONKEY_VER}P}
+.if ${_SEAMONKEY_VER} == ${seamonkey}
+_SUPSEAMONKEY=		yes
+USE_SEAMONKEY=		${_SEAMONKEY_VER}
+.endif
+.endfor
+.endif
+.endfor
+.else
+.if ${_SEAMONKEY_VER} == ${USE_SEAMONKEY}
+_SUPSEAMONKEY=		yes
+.endif
+.endif
+.if ${_SUPSEAMONKEY} == no
+IGNORE=			cannot install: SeaMonkey versions mismatch: seamonkey-${_SEAMONKEY_VER:C/([0-9])([0-9])/\1.\2/} is installed and wanted version is seamonkey-${USE_SEAMONKEY:C/([0-9])([0-9])/\1.\2/}
+.endif
+.endif
+
+.if !defined(_SEAMONKEY_${USE_SEAMONKEY:S/+//}P)
+IGNORE=			cannot install: unknown SeaMonkey version: seamonkey-${USE_SEAMONKEY:C/([0-9])([0-9])/\1.\2/}
+.endif
+
+# Dependence lines for different SeaMonkey versions
+11_DEPENDS=		${LOCALBASE}/lib/seamonkey/seamonkey-bin:${PORTSDIR}/www/seamonkey
+20_DEPENDS=		${LOCALBASE}/lib/seamonkey/seamonkey:${PORTSDIR}/www/seamonkey2
+
+# Add dependencies
+.if defined(USE_SEAMONKEY)
+.if defined(_SEAMONKEY_BUILD_DEPENDS)
+BUILD_DEPENDS+= ${${USE_SEAMONKEY}_DEPENDS}
+.endif
+RUN_DEPENDS+=	${${USE_SEAMONKEY}_DEPENDS}
+.endif
+
+.endif # defined(USE_SEAMONKEY)
+#
+# Thunderbird part
+#
+.if defined(USE_THUNDERBIRD) || defined(USE_THUNDERBIRD_BUILD)
+
+# Process USE_THUNDERBIRD_BUILD
+.if defined(USE_THUNDERBIRD_BUILD)
+USE_THUNDERBIRD:=			${USE_THUNDERBIRD_BUILD}
+_THUNDERBIRD_BUILD_DEPENDS=		yes
+.endif
+
+_THUNDERBIRD_DEFAULT_VERSION=	31
+_THUNDERBIRD_VERSIONS=			31 30
+_THUNDERBIRD_RANGE_VERSIONS=	31+ 30+
+
+# For specifying [31, 30, ..]+
+_THUNDERBIRD_30P=	30 ${_THUNDERBIRD_31P}
+_THUNDERBIRD_31P=	31
+
+# Set the default Thunderbird version and check if USE_THUNDERBIRD=yes was given
+.if ${USE_THUNDERBIRD} == "yes"
+USE_THUNDERBIRD=	${_THUNDERBIRD_DEFAULT_VERSION}
+.endif
+
+# Setting/finding Thunderbird version we want.
+.if exists(${LOCALBASE}/bin/thunderbird)
+_THUNDERBIRD_VER!=	${LOCALBASE}/bin/thunderbird --version | ${SED} -e 's/ Thunderbird \([0-9]\)\.\([0-9]*\).*/\1\2/'
+.endif
+
+# Check if installed Thunderbird version matches the wanted one
+.if defined(_THUNDERBIRD_VER)
+_SUPTHUNDERBIRD=		no
+.if ${USE_THUNDERBIRD:C/[0-9][0-9]//} == "+"
+.for ver in ${_THUNDERBIRD_RANGE_VERSIONS}
+.if ${USE_THUNDERBIRD} == "${ver}"
+_MATCHED_THUNDERBIRD_VER:=	${ver:S/+//}
+.for thunderbird in ${_THUNDERBIRD_${_MATCHED_THUNDERBIRD_VER}P}
+.if ${_THUNDERBIRD_VER} == ${thunderbird}
+_SUPTHUNDERBIRD=		yes
+USE_THUNDERBIRD=		${_THUNDERBIRD_VER}
+.endif
+.endfor
+.endif
+.endfor
+.else
+.if ${_THUNDERBIRD_VER} == ${USE_THUNDERBIRD}
+_SUPTHUNDERBIRD=		yes
+.endif
+.endif
+.if ${_SUPTHUNDERBIRD} != yes
+IGNORE=			cannot install: Thunderbird versions mismatch: thunderbird-${_THUNDERBIRD_VER:C/([0-9])([0-9])/\1.\2/} is installed and wanted version is thunderbird-${USE_THUNDERBIRD:C/([0-9])([0-9])/\1.\2/}
+.endif
+.endif
+
+.if !defined(_THUNDERBIRD_${USE_THUNDERBIRD:S/+//}P)
+IGNORE=			cannot install: unknown Thunderbird version: thunderbird-${USE_THUNDERBIRD:C/([0-9])([0-9])/\1.\2/}
+.endif
+
+# Dependence lines for different Thunderbird versions
+31_DEPENDS=		${LOCALBASE}/lib/thunderbird/thunderbird:${PORTSDIR}/mail/thunderbird
+30_DEPENDS=		${LOCALBASE}/lib/thunderbird/thunderbird:${PORTSDIR}/mail/thunderbird3
+
+# Add dependencies
+.if defined(USE_THUNDERBIRD)
+.if defined(_THUNDERBIRD_BUILD_DEPENDS)
+BUILD_DEPENDS+= ${${USE_THUNDERBIRD}_DEPENDS}
+.endif
+RUN_DEPENDS+=	${${USE_THUNDERBIRD}_DEPENDS}
+.endif
+
+.endif # defined(USE_THUNDERBIRD)
+
 .else # split
 
 .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include)
Index: bsd.port.mk
===================================================================
RCS file: /home/pcvs/ports/Mk/bsd.port.mk,v
retrieving revision 1.661
diff -u -r1.661 bsd.port.mk
--- bsd.port.mk	9 Dec 2010 20:33:02 -0000	1.661
+++ bsd.port.mk	11 Dec 2010 11:11:39 -0000
@@ -1550,7 +1550,7 @@
 .include "${PORTSDIR}/Mk/bsd.qt.mk"
 .endif
 
-.if defined(WANT_GECKO) || defined(USE_GECKO)
+.if defined(WANT_GECKO) || defined(USE_GECKO) || defined(USE_FIREFOX) || defined(USE_FIREFOX_BUILD) || defined(USE_SEAMONKEY) || defined(USE_SEAMONKEY_BUILD) || defined(USE_THUNDERBIRD) || defined(USE_THUNDERBIRD_BUILD)
 .include "${PORTSDIR}/Mk/bsd.gecko.mk"
 .endif
 
--- bsd.gecko.mk_USE_FOO.patch ends here ---


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->gecko 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Dec 11 14:50:43 UTC 2010 
Responsible-Changed-Why:  
bsd.gecko.mk is gecko territory (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153018 
Responsible-Changed-From-To: gecko->portmgr 
Responsible-Changed-By: beat 
Responsible-Changed-When: Sat Dec 11 14:54:37 UTC 2010 
Responsible-Changed-Why:  
portmgr territory. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153018 
Responsible-Changed-From-To: portmgr->erwin 
Responsible-Changed-By: erwin 
Responsible-Changed-When: Sat Dec 11 14:59:11 UTC 2010 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153018 
Responsible-Changed-From-To: erwin->beat 
Responsible-Changed-By: erwin 
Responsible-Changed-When: Fri Dec 17 11:40:12 UTC 2010 
Responsible-Changed-Why:  
-exp run successfully completed, return to committer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153018 
State-Changed-From-To: open->closed 
State-Changed-By: beat 
State-Changed-When: Sat Dec 18 11:17:24 UTC 2010 
State-Changed-Why:  
Committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=153018 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/153018: commit references a PR
Date: Sat, 18 Dec 2010 11:15:38 +0000 (UTC)

 beat        2010-12-18 11:15:33 UTC
 
   FreeBSD ports repository
 
   Modified files:
     Mk                   bsd.gecko.mk bsd.port.mk 
   Log:
   - Add new variables to define buildtime and runtime dependencies on
     Mozilla ports:
   
     USE_FIREFOX: Add runtime dependency on Firefox.
     Available values: yes 36+ 35+ 36 35
     NOTE: Default value 36 is used in case of USE_FIREFOX=yes
   
     USE_FIREFOX_BUILD: Add buildtime dependency on Firefox.
     Available values: see USE_FIREFOX
   
     USE_SEAMONKEY: Add runtime dependency on SeaMonkey.
     Available values: yes 11+ 20+ 11 20
     NOTE: Default value 20 is used in case of USE_SEAMONKEY=yes. SeaMonkey
     1.1 is obsolete and will be replaced with SeaMonkey 2.1 soon.
   
     USE_SEAMONKEY_BUILD: Add buildtime dependency on SeaMonkey.
     Available values: see USE_SEAMONKEY
   
     USE_THUNDERBIRD: Add runtime dependency on Thunderbird.
     Available values: yes 31+ 30+ 31 30
     NOTE: Default value 31 is used in case of USE_THUNDERBIRD=yes
   
     USE_THUNDERBIRD_BUILD: Add buildtime dependency on Thunderbird.
     Available values: see USE_THUNDERBIRD
   
   PR:             ports/153018
   Exp-run by:     erwin
   Approved by:    portmgr (erwin)
   
   Revision  Changes    Path
   1.26      +256 -1    ports/Mk/bsd.gecko.mk
   1.664     +2 -2      ports/Mk/bsd.port.mk
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
