Date: Thu, 19 Sep 2013 08:16:43 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r327602 - in head/Mk: . Uses Message-ID: <201309190816.r8J8Gh4w014829@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Thu Sep 19 08:16:43 2013 New Revision: 327602 URL: http://svnweb.freebsd.org/changeset/ports/327602 Log: Introduce the one-true-way to handle multi version ports This defines a new macros for end users! DEFAULT_VERSIONS. This macros is used to end-users to define what version they want to be the default version for the whole ports tree (for ports allowing that) Syntax is the following: DEFAULT_VERSIONS= perl5=5.18 ruby=2.0 Swith bsd.ruby.mk to use it[1], switch Uses/perl5.mk to use it[2] If you are maintaining settable multi version port, please change it so it uses DEFAULT_VERSIONS. Reviewed by: ruby (swills) [1], perl (az) [2] Approved by: ruby (swills) [1], perl (az) [2] Added: head/Mk/bsd.default-versions.mk (contents, props changed) Modified: head/Mk/Uses/perl5.mk head/Mk/bsd.ruby.mk Modified: head/Mk/Uses/perl5.mk ============================================================================== --- head/Mk/Uses/perl5.mk Thu Sep 19 08:05:05 2013 (r327601) +++ head/Mk/Uses/perl5.mk Thu Sep 19 08:16:43 2013 (r327602) @@ -46,7 +46,18 @@ USE_PERL5?= run build PERL_VERSION!= perl -e 'printf "%vd\n", $$^V;' .endif .else -PERL_VERSION?= 5.14.4 +.include "${PORTSDIR}/Mk/bsd.default-versions.mk" +.if ${PERL5_DEFAULT} == 5.12 +PERL_VERSION= 5.12.5 +.elif ${PERL5_DEFAULT} == 5.14 +PERL_VERSION= 5.14.4 +.elif ${PERL5_DEFAULT} == 5.16 +PERL_VERSION= 5.16.3 +.elif ${PERL5_DEFAULT} == 5.18 +PERL_VERSION= 5.18.1 +.else +IGNORE= Invalid perl5 version ${PERL5_DEFAULT} +.endif .endif PERL_VER?= ${PERL_VERSION:C/\.[0-9]+$//} Added: head/Mk/bsd.default-versions.mk ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/bsd.default-versions.mk Thu Sep 19 08:16:43 2013 (r327602) @@ -0,0 +1,23 @@ +# $FreeBSD$ +# +# MAINTAINER: ports@FreeBSD.org +# +# Handle the default versions for users chosable multi versions. +# +# It expects users to define DEFAULT_VERSIONS in there make.conf +# Syntax is the following: +# +# DEFAULT_VERSION= perl5=5.18 ruby=2.0 + +.if !defined(_INCLUDE_BSD_DEFAULT_VERSIONS_MK) +_INCLUDE_BSD_DEFAULT_VERSIONS_MK= yes + +.for lang in ${DEFAULT_VERSIONS} +_l= ${lang:C/=.*//g} +${_l:U}_DEFAULT= ${lang:C/.*=//g} +.endfor + +PERL5_DEFAULT?= 5.14 +RUBY_DEFAULT?= 1.9 + +.endif Modified: head/Mk/bsd.ruby.mk ============================================================================== --- head/Mk/bsd.ruby.mk Thu Sep 19 08:05:05 2013 (r327601) +++ head/Mk/bsd.ruby.mk Thu Sep 19 08:16:43 2013 (r327602) @@ -137,7 +137,13 @@ Ruby_Include_MAINTAINER= ruby@FreeBSD.or # RUBY_ELISPDIR - Installation path for emacs lisp files. # -RUBY_DEFAULT_VER?= 1.9 +.include "${PORTSDIR}/Mk/bsd.default-versions.mk" + +.if defined(RUBY_DEFAULT_VER) +WARNING+= "Using RUBY_DEFAULT_VER in make.conf, consider using DEFAULT_VERSION=ruby=${RUBY_DEFAULT_VER}" +.endif + +RUBY_DEFAULT_VER?= ${RUBY_DEFAULT} RUBY_VER?= ${RUBY_DEFAULT_VER}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309190816.r8J8Gh4w014829>