Sun Mar 7 13:40:10 2021 UTC ()
lang/php: add php80 support

Add php80 (PHP 8.0.x) support.


(taca)
diff -r1.321 -r1.322 pkgsrc/lang/php/phpversion.mk

cvs diff -r1.321 -r1.322 pkgsrc/lang/php/phpversion.mk (expand / switch to unified diff)

--- pkgsrc/lang/php/phpversion.mk 2021/03/06 13:29:02 1.321
+++ pkgsrc/lang/php/phpversion.mk 2021/03/07 13:40:10 1.322
@@ -1,134 +1,139 @@ @@ -1,134 +1,139 @@
1# $NetBSD: phpversion.mk,v 1.321 2021/03/06 13:29:02 taca Exp $ 1# $NetBSD: phpversion.mk,v 1.322 2021/03/07 13:40:10 taca Exp $
2# 2#
3# This file selects a PHP version, based on the user's preferences and 3# This file selects a PHP version, based on the user's preferences and
4# the installed packages. It does not add a dependency on the PHP 4# the installed packages. It does not add a dependency on the PHP
5# package. 5# package.
6# 6#
7# === User-settable variables === 7# === User-settable variables ===
8# 8#
9# PHP_VERSION_DEFAULT 9# PHP_VERSION_DEFAULT
10# The PHP version to choose when more than one is acceptable to 10# The PHP version to choose when more than one is acceptable to
11# the package. 11# the package.
12# 12#
13# Possible: 56 73 74 13# Possible: 56 73 74 80
14# Default: 73 14# Default: 73
15# 15#
16# === Infrastructure variables === 16# === Infrastructure variables ===
17# 17#
18# PHP_VERSION_REQD 18# PHP_VERSION_REQD
19# PHP version to use. This variable should not be set in 19# PHP version to use. This variable should not be set in
20# packages. Normally it is used by bulk build tools. 20# packages. Normally it is used by bulk build tools.
21# 21#
22# Possible: ${PHP_VERSIONS_ACCEPTED} 22# Possible: ${PHP_VERSIONS_ACCEPTED}
23# Default: ${PHP_VERSION_DEFAULT} 23# Default: ${PHP_VERSION_DEFAULT}
24# 24#
25# === Package-settable variables === 25# === Package-settable variables ===
26# 26#
27# PHP_VERSIONS_ACCEPTED 27# PHP_VERSIONS_ACCEPTED
28# The PHP versions that are accepted by the package. 28# The PHP versions that are accepted by the package.
29# 29#
30# Possible: 56 73 74 30# Possible: 56 73 74 80
31# Default: 73 56 74 31# Default: 73 56 74 80
32# 32#
33# PHP_VERSIONS_INCOMPATIBLE 33# PHP_VERSIONS_INCOMPATIBLE
34# The PHP versions that are not supported by the package. 34# The PHP versions that are not supported by the package.
35# 35#
36# Possible: 56 73 74 36# Possible: 56 73 74 80
37# Default: (empty) 37# Default: (empty)
38# 38#
39# PHP_CHECK_INSTALLED 39# PHP_CHECK_INSTALLED
40# Check installed version of PHP. Should be used by lang/php56, 40# Check installed version of PHP. Should be used by lang/php56,
41# lang/php73 or lang/php74 only. 41# lang/php73, lang/php74 and lang/php80 only.
42# 42#
43# Possible: Yes No 43# Possible: Yes No
44# Default: Yes 44# Default: Yes
45# 45#
46# === Variables defined by this file === 46# === Variables defined by this file ===
47# 47#
48# PKG_PHP_VERSION 48# PKG_PHP_VERSION
49# The selected PHP version. 49# The selected PHP version.
50# 50#
51# Possible: 56 73 74 51# Possible: 56 73 74 80
52# Default: ${PHP_VERSION_DEFAULT} 52# Default: ${PHP_VERSION_DEFAULT}
53# 53#
54# PHP_BASE_VERS 54# PHP_BASE_VERS
55# The selected PHP's full version depends on PKG_PHP_VERSION 55# The selected PHP's full version depends on PKG_PHP_VERSION
56# 56#
57# PKG_PHP_MAJOR_VERS 57# PKG_PHP_MAJOR_VERS
58# The selected PHP's major version. 58# The selected PHP's major version.
59# 59#
60# Possible: 5 7 60# Possible: 5 7 8
61# Default: 7 61# Default: 7
62# 62#
63# PKG_PHP 63# PKG_PHP
64# The same as ${PKG_PHP_VERSION}, prefixed with "php-". 64# The same as ${PKG_PHP_VERSION}, prefixed with "php-".
65# 65#
66# PHPPKGSRCDIR 66# PHPPKGSRCDIR
67# The directory of the PHP implementation, relative to the 67# The directory of the PHP implementation, relative to the
68# package directory. 68# package directory.
69# 69#
70# Example: ../../lang/php73 70# Example: ../../lang/php73
71# 71#
72# PHP_PKG_PREFIX 72# PHP_PKG_PREFIX
73# The prefix that is prepended to the package name. 73# The prefix that is prepended to the package name.
74# 74#
75# Example: php56 php73 php74 75# Example: php56 php73 php74 php80
76# 76#
77# PHP_EXTENSION_DIR 77# PHP_EXTENSION_DIR
78# Relative path to ${PREFIX} for PHP's extensions. It is derived from 78# Relative path to ${PREFIX} for PHP's extensions. It is derived from
79# initial release of major version. 79# initial release of major version.
80# 80#
81# Example: lib/php/20181200 81# Example: lib/php/20181200
82# 82#
83# Keywords: php 83# Keywords: php
84# 84#
85 85
86.if !defined(PHPVERSION_MK) 86.if !defined(PHPVERSION_MK)
87PHPVERSION_MK= defined 87PHPVERSION_MK= defined
88 88
89# Define each PHP's version. 89# Define each PHP's version.
90PHP56_VERSION= 5.6.40 90PHP56_VERSION= 5.6.40
91PHP73_VERSION= 7.3.27 91PHP73_VERSION= 7.3.27
92PHP74_VERSION= 7.4.16 92PHP74_VERSION= 7.4.16
 93PHP80_VERSION= 8.0.3
93 94
94# Define initial release of major version. 95# Define initial release of major version.
95PHP56_RELDATE= 20140828 96PHP56_RELDATE= 20140828
96PHP73_RELDATE= 20181200 97PHP73_RELDATE= 20181200
97PHP74_RELDATE= 20191128 98PHP74_RELDATE= 20191128
 99PHP80_RELDATE= 20201124
98 100
99_VARGROUPS+= php 101_VARGROUPS+= php
100_USER_VARS.php= PHP_VERSION_DEFAULT 102_USER_VARS.php= PHP_VERSION_DEFAULT
101_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD 103_PKG_VARS.php= PHP_VERSIONS_ACCEPTED PHP_VERSION_REQD
102_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \ 104_SYS_VARS.php= PKG_PHP_VERSION PKG_PHP PHPPKGSRCDIR PHP_PKG_PREFIX \
103 PKG_PHP_MAJOR_VERS 105 PKG_PHP_MAJOR_VERS
104 106
105.include "../../mk/bsd.prefs.mk" 107.include "../../mk/bsd.prefs.mk"
106 108
107PHP_VERSION_DEFAULT?= 73 109PHP_VERSION_DEFAULT?= 73
108PHP_VERSIONS_ACCEPTED?= 73 74 56 110PHP_VERSIONS_ACCEPTED?= 73 74 56 80
109.for pv in ${PHP_VERSIONS_ACCEPTED} 111.for pv in ${PHP_VERSIONS_ACCEPTED}
110. if empty(PHP_VERSIONS_INCOMPATIBLE:M${pv}) 112. if empty(PHP_VERSIONS_INCOMPATIBLE:M${pv})
111_PHP_VERSIONS_ACCEPTED+= ${pv} 113_PHP_VERSIONS_ACCEPTED+= ${pv}
112. endif 114. endif
113.endfor 115.endfor
114 116
115# transform the list into individual variables 117# transform the list into individual variables
116.for pv in ${_PHP_VERSIONS_ACCEPTED} 118.for pv in ${_PHP_VERSIONS_ACCEPTED}
117_PHP_VERSION_${pv}_OK= yes 119_PHP_VERSION_${pv}_OK= yes
118.endfor 120.endfor
119 121
120# check what is installed 122# check what is installed
121.if exists(${LOCALBASE}/lib/php/${PHP74_RELDATE}) 123.if exists(${LOCALBASE}/lib/php/${PHP80_RELDATE})
 124_PHP_VERSION_80_INSTALLED= yes
 125_PHP_INSTALLED= yes
 126.elif exists(${LOCALBASE}/lib/php/${PHP74_RELDATE})
122_PHP_VERSION_74_INSTALLED= yes 127_PHP_VERSION_74_INSTALLED= yes
123_PHP_INSTALLED= yes 128_PHP_INSTALLED= yes
124.elif exists(${LOCALBASE}/lib/php/${PHP73_RELDATE}) 129.elif exists(${LOCALBASE}/lib/php/${PHP73_RELDATE})
125_PHP_VERSION_73_INSTALLED= yes 130_PHP_VERSION_73_INSTALLED= yes
126_PHP_INSTALLED= yes 131_PHP_INSTALLED= yes
127.elif exists(${LOCALBASE}/lib/php/${PHP56_RELDATE}) 132.elif exists(${LOCALBASE}/lib/php/${PHP56_RELDATE})
128_PHP_VERSION_56_INSTALLED= yes 133_PHP_VERSION_56_INSTALLED= yes
129_PHP_INSTALLED= yes 134_PHP_INSTALLED= yes
130.endif 135.endif
131 136
132# if a version is explicitely required, take it 137# if a version is explicitely required, take it
133.if defined(PHP_VERSION_REQD) 138.if defined(PHP_VERSION_REQD)
134_PHP_VERSION= ${PHP_VERSION_REQD} 139_PHP_VERSION= ${PHP_VERSION_REQD}
@@ -175,46 +180,50 @@ PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([ @@ -175,46 +180,50 @@ PKG_PHP:= PHP${_PHP_VERSION:C/([0-9])([
175PKG_PHP_MAJOR_VERS:= ${_PHP_VERSION:C/^([0-9]).*/\1/} 180PKG_PHP_MAJOR_VERS:= ${_PHP_VERSION:C/^([0-9]).*/\1/}
176 181
177PHP_CHECK_INSTALLED?= Yes 182PHP_CHECK_INSTALLED?= Yes
178 183
179# if installed PHP isn't compatible with required PHP, bail out 184# if installed PHP isn't compatible with required PHP, bail out
180.if empty(PHP_CHECK_INSTALLED:M[nN][oO]) 185.if empty(PHP_CHECK_INSTALLED:M[nN][oO])
181.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED) 186.if defined(_PHP_INSTALLED) && !defined(_PHP_VERSION_${_PHP_VERSION}_INSTALLED)
182PKG_FAIL_REASON+= "Package accepts ${PKG_PHP}, but different version is installed" 187PKG_FAIL_REASON+= "Package accepts ${PKG_PHP}, but different version is installed"
183.endif 188.endif
184.endif 189.endif
185 190
186MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ 191MESSAGE_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \
187 PKG_PHP=${PKG_PHP} 192 PKG_PHP=${PKG_PHP}
188PLIST_SUBST+= PKG_PHP_VERSION=${PKG_PHP_VERSION} \ 193PLIST_SUBST+= PHP_PKG_PREFIX=${PHP_PKG_PREFIX} \
 194 PKG_PHP_VERSION=${PKG_PHP_VERSION} \
189 PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \ 195 PKG_PHP_MAJOR_VERS=${PKG_PHP_MAJOR_VERS} \
190 PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR} 196 PHP_EXTENSION_DIR=${PHP_EXTENSION_DIR}
191 197
192# force the selected PHP version for recursive builds 198# force the selected PHP version for recursive builds
193PHP_VERSION_REQD:= ${PKG_PHP_VERSION} 199PHP_VERSION_REQD:= ${PKG_PHP_VERSION}
194 200
195# 201#
196# set variables for the version we decided to use: 202# set variables for the version we decided to use:
197# 203#
198.if ${_PHP_VERSION} == "56" 204.if ${_PHP_VERSION} == "56"
199PHP_VERSION= ${PHP56_VERSION} 205PHP_VERSION= ${PHP56_VERSION}
200PHP_INITIAL_TEENY= 3 206PHP_INITIAL_TEENY= 3
201PHP_EXTENSION_DIR= lib/php/${PHP56_RELDATE} 207PHP_EXTENSION_DIR= lib/php/${PHP56_RELDATE}
202.elif ${_PHP_VERSION} == "73" 208.elif ${_PHP_VERSION} == "73"
203PHP_VERSION= ${PHP73_VERSION} 209PHP_VERSION= ${PHP73_VERSION}
204PHP_EXTENSION_DIR= lib/php/${PHP73_RELDATE} 210PHP_EXTENSION_DIR= lib/php/${PHP73_RELDATE}
205.elif ${_PHP_VERSION} == "74" 211.elif ${_PHP_VERSION} == "74"
206PHP_VERSION= ${PHP74_VERSION} 212PHP_VERSION= ${PHP74_VERSION}
207PHP_EXTENSION_DIR= lib/php/${PHP74_RELDATE} 213PHP_EXTENSION_DIR= lib/php/${PHP74_RELDATE}
 214.elif ${_PHP_VERSION} == "80"
 215PHP_VERSION= ${PHP80_VERSION}
 216PHP_EXTENSION_DIR= lib/php/${PHP80_RELDATE}
208.else 217.else
209# force an error 218# force an error
210PKG_FAIL_REASON+= "${PKG_PHP} is not a valid package" 219PKG_FAIL_REASON+= "${PKG_PHP} is not a valid package"
211.endif 220.endif
212 221
213PHP_INITIAL_TEENY?= 0 222PHP_INITIAL_TEENY?= 0
214PHPPKGSRCDIR= ../../lang/php${PKG_PHP_VERSION} 223PHPPKGSRCDIR= ../../lang/php${PKG_PHP_VERSION}
215PHP_PKG_PREFIX= php${PKG_PHP_VERSION} 224PHP_PKG_PREFIX= php${PKG_PHP_VERSION}
216 225
217_PHP_VER_MAJOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/} 226_PHP_VER_MAJOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\1/}
218_PHP_VER_MINOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/} 227_PHP_VER_MINOR= ${PHP_VERSION:C/([0-9]+)\.([0-9]+)\.([0-9]+)/\2/}
219 228
220PHP_BASE_VERS= ${_PHP_VER_MAJOR}.${_PHP_VER_MINOR}.${PHP_INITIAL_TEENY} 229PHP_BASE_VERS= ${_PHP_VER_MAJOR}.${_PHP_VER_MINOR}.${PHP_INITIAL_TEENY}