2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"). You may
4 # only use this file in accordance with the terms of the CDDL.
6 # A full copy of the text of the CDDL should have accompanied this
7 # source. A copy of the CDDL is also available via the Internet at
8 # http://www.illumos.org/license/CDDL.
12 # Copyright 2013, EveryCity Ltd. All rights reserved.
13 # Copyright 2022 Niklas Poslovski
14 # Copyright 2022,2024 Friedrich Kink. All rights reserved.
17 include ..
/..
/..
/..
/make-rules
/shared-macros.mk
20 COMPONENT_MJR_VERSION
= 8.2
21 COMPONENT_MNR_VERSION
= 26
22 COMPONENT_SUMMARY
= PHP
8.2
23 COMPONENT_DESCRIPTION
= PHP is a popular general-purpose scripting language that is especially suited to web development.
24 COMPONENT_VERSION
= $(COMPONENT_MJR_VERSION
).
$(COMPONENT_MNR_VERSION
)
25 COMPONENT_PROJECT_URL
= https
://www.php.net
/
26 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
27 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.bz2
28 COMPONENT_ARCHIVE_HASH
= sha256
:be57c347d451c905bcb4336832a864d9928dd0e20989b872705fea0ba6476c6b
29 COMPONENT_ARCHIVE_URL
= https
://www.php.net
/distributions
/$(COMPONENT_ARCHIVE
)
30 #COMPONENT_SIG_URL= https://www.php.net/distributions/$(COMPONENT_ARCHIVE).asc
31 COMPONENT_FMRI
= web
/$(COMPONENT_NAME
)-82
32 COMPONENT_CLASSIFICATION
=Meta Packages
/Group Packages
33 COMPONENT_LICENSE
= PHP License
34 COMPONENT_LICENSE_FILE
= LICENSE
36 include $(WS_MAKE_RULES
)/common.mk
39 AP_PREFIX
= /usr
/apache2
/2.4
40 AP_SYSCONFDIR
= /etc
/apache2
/2.4
43 PHP_PREFIX
= /usr
/php
/$(COMPONENT_MJR_VERSION
)
44 PHP_SYSCONFDIR
= /etc
/php
/$(COMPONENT_MJR_VERSION
)
45 PHP_DATADIR
= /var
/php
/$(COMPONENT_MJR_VERSION
)
47 # -D__solaris__ is very important to trigger patched file TSRM.h
48 # otherwise mod_php82.so is crashing
49 CFLAGS
+= $(CC_BITS
) -D_XPG4_2
-D__EXTENSIONS__
-D__solaris__
50 CFLAGS
+= -I
/usr
/include/openldap
51 CPPFLAGS
+= $(CPP_XPG6MODE
)
54 # build with the system default libjpeg
55 CFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CFLAGS
)
56 CXXFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CXXFLAGS
)
57 CPPFLAGS
+= $(JPEG_CPPFLAGS
)
58 LDFLAGS
+= $(JPEG_LDFLAGS
)
61 CONFIGURE_OPTIONS
= --prefix=$(PHP_PREFIX
)
62 CONFIGURE_OPTIONS
+= --bindir=$(PHP_PREFIX
)/bin
63 CONFIGURE_OPTIONS
+= --sbindir
=$(PHP_PREFIX
)/bin
64 CONFIGURE_OPTIONS
+= --libdir=$(PHP_PREFIX
)/lib
/$(MACH64
)
65 CONFIGURE_OPTIONS
+= --libexecdir
=$(PHP_PREFIX
)/libexec
66 CONFIGURE_OPTIONS
+= --includedir=$(PHP_PREFIX
)/include
67 CONFIGURE_OPTIONS
+= --sysconfdir
=$(PHP_SYSCONFDIR
)
68 CONFIGURE_OPTIONS
+= --datadir=$(PHP_DATADIR
)
69 CONFIGURE_OPTIONS
+= --mandir=$(PHP_PREFIX
)/share
/man
70 CONFIGURE_OPTIONS
+= --localstatedir
=$(PHP_DATADIR
)
71 CONFIGURE_OPTIONS
+= OPENSSL_CFLAGS
=-I
$(OPENSSL_INCDIR
)
72 CONFIGURE_OPTIONS
+= OPENSSL_LIBS
="-L$(OPENSSL_LIBDIR) -lssl -lcrypto"
73 CONFIGURE_OPTIONS
+= KERBEROS_CFLAGS
=-I
/usr
/include/kerberosv5
74 CONFIGURE_OPTIONS
+= KERBEROS_LIBS
="-L/usr/lib/$(MACH64) -lgss -lkrb5"
75 CONFIGURE_OPTIONS
+= PCRE2_CFLAGS
="-I/usr/include/pcre"
76 CONFIGURE_OPTIONS
+= ODBC_CFLAGS
="-I/usr/include/odbc"
79 CONFIGURE_OPTIONS
+= --with-apxs2
=$(AP_PREFIX
)/bin
/apxs
80 CONFIGURE_OPTIONS
+= --enable-fpm
82 ifeq ($(strip $(MACH
)),i386
)
83 CONFIGURE_OPTIONS
+= --build
=x86_64-pc-solaris
$(SOLARIS_VERSION
)
84 CONFIGURE_OPTIONS
+= --with-external-pcre
86 CONFIGURE_OPTIONS
+= --build
=sparcv9-sun-solaris
$(SOLARIS_VERSION
)
87 CONFIGURE_OPTIONS
+= --with-pcre-jit
=no
90 CONFIGURE_OPTIONS
+= --with-config-file-path
=$(PHP_SYSCONFDIR
)
91 CONFIGURE_OPTIONS
+= --with-config-file-scan-dir
=$(PHP_SYSCONFDIR
)/conf.d
92 CONFIGURE_OPTIONS
+= --with-pear
=$(PHP_PREFIX
)/share
/PEAR
94 CONFIGURE_OPTIONS
+= --with-layout
=PHP
96 CONFIGURE_OPTIONS
+= --with-cdb
97 CONFIGURE_OPTIONS
+= --with-kerberos
98 CONFIGURE_OPTIONS
+= --with-readline
99 CONFIGURE_OPTIONS
+= --enable-dtrace
100 CONFIGURE_OPTIONS
+= --enable-mysqlnd
103 CONFIGURE_OPTIONS
+= --with-gettext
=shared
104 CONFIGURE_OPTIONS
+= --with-zlib
=shared
105 CONFIGURE_OPTIONS
+= --with-openssl
=shared
106 CONFIGURE_OPTIONS
+= --with-pdo-sqlite
=shared
107 CONFIGURE_OPTIONS
+= --with-ldap
=shared
108 CONFIGURE_OPTIONS
+= --with-bz2
=shared
109 CONFIGURE_OPTIONS
+= --with-iconv
=shared
110 CONFIGURE_OPTIONS
+= --with-tidy
=shared
111 CONFIGURE_OPTIONS
+= --with-mhash
=shared
112 CONFIGURE_OPTIONS
+= --with-xsl
=shared
113 CONFIGURE_OPTIONS
+= --with-curl
=shared
114 CONFIGURE_OPTIONS
+= --with-pspell
=shared
115 CONFIGURE_OPTIONS
+= --with-imap
=shared
116 CONFIGURE_OPTIONS
+= --with-imap-ssl
117 CONFIGURE_OPTIONS
+= --with-zip
=shared
118 CONFIGURE_OPTIONS
+= --with-sodium
=shared
119 CONFIGURE_OPTIONS
+= --enable-bcmath
=shared
120 CONFIGURE_OPTIONS
+= --enable-ctype
=shared
121 CONFIGURE_OPTIONS
+= --enable-calendar
=shared
122 CONFIGURE_OPTIONS
+= --enable-tokenizer
=shared
123 CONFIGURE_OPTIONS
+= --enable-exif
=shared
124 CONFIGURE_OPTIONS
+= --enable-dom
=shared
125 CONFIGURE_OPTIONS
+= --enable-ftp
=shared
126 CONFIGURE_OPTIONS
+= --enable-intl
=shared
127 CONFIGURE_OPTIONS
+= --enable-pdo
=shared
128 CONFIGURE_OPTIONS
+= --enable-mbstring
=shared
129 CONFIGURE_OPTIONS
+= --enable-xmlreader
=shared
130 CONFIGURE_OPTIONS
+= --enable-xmlwriter
=shared
131 CONFIGURE_OPTIONS
+= --enable-soap
=shared
132 CONFIGURE_OPTIONS
+= --enable-sockets
=shared
133 CONFIGURE_OPTIONS
+= --enable-mysqlnd
=shared
134 CONFIGURE_OPTIONS
+= --with-snmp
=shared
135 # tests are looking very ugly with mysqli enabled
136 #CONFIGURE_OPTIONS += --with-mysqli=shared,mysqlnd
137 CONFIGURE_OPTIONS
+= --with-pdo-mysql
=shared
,mysqlnd
139 # Extensions, dependent on other packages
140 CONFIGURE_OPTIONS
+= --with-pgsql
=shared
,$(PG_BINDIR
)
141 CONFIGURE_OPTIONS
+= --with-pdo-pgsql
=shared
,$(PG_BINDIR
)
143 # Disabled extensions & Options
144 CONFIGURE_OPTIONS
+= --disable-static
145 CONFIGURE_OPTIONS
+= --disable-dba
146 CONFIGURE_OPTIONS
+= --disable-debug
147 CONFIGURE_OPTIONS
+= --disable-libgcc
148 CONFIGURE_OPTIONS
+= --without-dbm
151 CONFIGURE_OPTIONS
+= --enable-zts
152 CONFIGURE_OPTIONS
+= --enable-re2c-cgoto
153 CONFIGURE_OPTIONS
+= --enable-cli
154 CONFIGURE_OPTIONS
+= --enable-cgi
155 CONFIGURE_OPTIONS
+= --with-ffi
156 CONFIGURE_OPTIONS
+= --enable-shared
157 CONFIGURE_OPTIONS
+= --enable-filter
158 CONFIGURE_OPTIONS
+= --enable-gd-jis-conv
159 CONFIGURE_OPTIONS
+= --enable-short-tags
160 CONFIGURE_OPTIONS
+= --enable-pcntl
161 CONFIGURE_OPTIONS
+= --enable-shmop
162 CONFIGURE_OPTIONS
+= --enable-sysvmsg
163 CONFIGURE_OPTIONS
+= --enable-sysvsem
164 CONFIGURE_OPTIONS
+= --enable-sysvshm
165 CONFIGURE_OPTIONS
+= --enable-simplexml
166 CONFIGURE_OPTIONS
+= --enable-session
167 CONFIGURE_OPTIONS
+= --enable-opcache
168 CONFIGURE_OPTIONS
+= --with-mhash
169 CONFIGURE_OPTIONS
+= --enable-gd
170 CONFIGURE_OPTIONS
+= --with-external-gd
171 CONFIGURE_OPTIONS
+= --with-webp
172 CONFIGURE_OPTIONS
+= --with-jpeg
173 CONFIGURE_OPTIONS
+= --with-xpm
174 CONFIGURE_OPTIONS
+= --with-freetype
175 CONFIGURE_OPTIONS
+= --with-gmp
176 CONFIGURE_OPTIONS
+= --with-enchant
177 CONFIGURE_OPTIONS
+= --with-unixODBC
178 CONFIGURE_OPTIONS
+= --with-openssl-dir
=$(OPENSSL_PREFIX
)
180 # remove EXTRA_FLAGS to get the right ssl and crypto libs
181 # now with fix to cover all EXTRA_LDFLAGS conditions
182 COMPONENT_POST_CONFIGURE_ACTION
= \
184 $(GSED
) -i
-e
's:^EXTRA_LDFLAGS = .*:EXTRA_LDFLAGS = -avoid-version -module:' -e
's:-L/usr/lib/$(MACH64) ::' \
185 -e
'/^CFLAGS_CLEAN/s/-Wl,-Wl,//' -e
's:-R/usr/lib/$(MACH64) ::' Makefile
)
187 # Installation Arguments
188 COMPONENT_INSTALL_ARGS
+= INSTALL_ROOT
=$(PROTO_DIR
)
190 # Pre-Install Actions
191 COMPONENT_PRE_INSTALL_ACTION
+= \
192 ( $(MKDIR
) -p
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
; \
193 echo
"Creating fake modules.load and httpd.conf" ; \
194 echo
"\# LoadModule foo_module libexec/mod_foo.so" >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
195 echo
"\# " >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
196 echo
"LoadModule foo_module libexec/mod_foo.so " >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
197 cp
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/httpd.conf \
200 # Environment Variables
201 CONFIGURE_ENV
+= EXTENSION_DIR
=$(PHP_PREFIX
)/extensions
202 CONFIGURE_ENV
+= ICU_CONFIG
=/usr
/bin
/icu-config
203 CONFIGURE_ENV
+= PG_CONFIG
=$(PG_BINDIR
)/pg_config
204 CONFIGURE_ENV
+= MYSQL_CONFIG
=$(MYSQL_CONFIG
)
205 CONFIGURE_ENV
+= PKG_CONFIG_PATH
=$(OPENSSL_PREFIX
)/lib
/$(MACH64
)/pkgconfig
207 COMPONENT_TEST_TARGETS
= test
209 COMPONENT_TEST_ENV
+= NO_INTERACTION
=yes
211 # Test results are unstable between runs but still useful for humans.
212 # test failures; keep going
213 COMPONENT_TEST_ARGS
+= -k
-i
214 COMPONENT_TEST_TRANSFORMS
+= \
216 '-e "/^Time taken/d" ' \
217 '-e "/^TEST RESULT SUMMARY$$/,\$$p" ' \
220 # Manually added build dependencies
221 REQUIRED_PACKAGES
+= $(PG_DEVELOPER_PKG
)
222 REQUIRED_PACKAGES
+= $(PG_SERVICE_PKG
)
223 REQUIRED_PACKAGES
+= web
/server
/apache-24
225 # Auto-generated dependencies
226 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
227 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
228 REQUIRED_PACKAGES
+= $(ICU_LIBRARY_PKG
)
229 REQUIRED_PACKAGES
+= $(OPENSSL_PKG
)
230 REQUIRED_PACKAGES
+= $(PG_LIBRARY_PKG
)
231 REQUIRED_PACKAGES
+= $(READLINE_PKG
)
232 REQUIRED_PACKAGES
+= SUNWcs
233 REQUIRED_PACKAGES
+= compress
/bzip2
234 REQUIRED_PACKAGES
+= database
/sqlite-3
235 REQUIRED_PACKAGES
+= library
/gd
236 REQUIRED_PACKAGES
+= library
/gmp
237 REQUIRED_PACKAGES
+= library
/libffi
238 REQUIRED_PACKAGES
+= library
/libxml2
239 REQUIRED_PACKAGES
+= library
/libxslt
240 REQUIRED_PACKAGES
+= library
/libzip
241 REQUIRED_PACKAGES
+= library
/openldap
242 REQUIRED_PACKAGES
+= library
/pcre2
243 REQUIRED_PACKAGES
+= library
/security
/libsodium
244 REQUIRED_PACKAGES
+= library
/spell-checking
/enchant
245 REQUIRED_PACKAGES
+= library
/unixodbc
246 REQUIRED_PACKAGES
+= library
/uw-imap
247 REQUIRED_PACKAGES
+= library
/zlib
248 REQUIRED_PACKAGES
+= shell/ksh93
249 REQUIRED_PACKAGES
+= system
/library
250 REQUIRED_PACKAGES
+= system
/library
/math
251 REQUIRED_PACKAGES
+= system
/management
/snmp
/net-snmp
252 REQUIRED_PACKAGES
+= text
/aspell
253 REQUIRED_PACKAGES
+= text
/oniguruma
254 REQUIRED_PACKAGES
+= text
/tidy
255 REQUIRED_PACKAGES
+= web
/curl