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 Friedrich Kink. All rights reserved.
14 # Copyright 2022 Niklas Poslovski
18 include ..
/..
/..
/..
/make-rules
/shared-macros.mk
21 COMPONENT_MJR_VERSION
= 8.1
22 COMPONENT_MNR_VERSION
= 27
23 COMPONENT_SUMMARY
= PHP
8.1
24 COMPONENT_DESCRIPTION
= PHP is a popular general-purpose scripting language that is especially suited to web development.
25 COMPONENT_VERSION
= $(COMPONENT_MJR_VERSION
).
$(COMPONENT_MNR_VERSION
)
26 COMPONENT_PROJECT_URL
= https
://www.php.net
/
27 COMPONENT_SRC
= $(COMPONENT_NAME
)-$(COMPONENT_VERSION
)
28 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.bz2
29 COMPONENT_ARCHIVE_HASH
= sha256
:a15fd73ea44f2df30b07d24786e07d1948b0ea3eed0b8b845735d500dc28bff1
30 COMPONENT_ARCHIVE_URL
= https
://www.php.net
/distributions
/$(COMPONENT_ARCHIVE
)
31 #COMPONENT_SIG_URL= https://www.php.net/distributions/$(COMPONENT_ARCHIVE).asc
32 COMPONENT_FMRI
= web
/$(COMPONENT_NAME
)-81
33 COMPONENT_CLASSIFICATION
=Meta Packages
/Group Packages
34 COMPONENT_LICENSE
= PHP License
35 COMPONENT_LICENSE_FILE
= LICENSE
37 include $(WS_MAKE_RULES
)/common.mk
39 MYSQL_DIR
= $(MYSQL_HOME
)
42 AP_PREFIX
= /usr
/apache2
/2.4
43 AP_SYSCONFDIR
= /etc
/apache2
/2.4
46 PHP_PREFIX
= /usr
/php
/$(COMPONENT_MJR_VERSION
)
47 PHP_SYSCONFDIR
= /etc
/php
/$(COMPONENT_MJR_VERSION
)
48 PHP_DATADIR
= /var
/php
/$(COMPONENT_MJR_VERSION
)
50 # -D__solaris__ is very important to trigger patched file TSRM.h
51 # otherwise mod_php81.so is crashing
52 CFLAGS
+= $(CC_BITS
) -D_XPG4_2
-D__EXTENSIONS__
-D__solaris__
53 CFLAGS
+= -I
/usr
/include/openldap
54 CPPFLAGS
+= $(CPP_XPG6MODE
)
56 CPPFLAGS
+= -I
$(MYSQL_INCDIR
)
57 CFLAGS
+= -I
$(MYSQL_INCDIR
)
58 LDFLAGS
+= -L
$(MYSQL_LIBDIR
)
60 # build with the system default libjpeg
61 CFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CFLAGS
)
62 CXXFLAGS
+= $(JPEG_CPPFLAGS
) $(JPEG_CXXFLAGS
)
63 CPPFLAGS
+= $(JPEG_CPPFLAGS
)
64 LDFLAGS
+= $(JPEG_LDFLAGS
)
67 CONFIGURE_OPTIONS
= --prefix=$(PHP_PREFIX
)
68 CONFIGURE_OPTIONS
+= --bindir=$(PHP_PREFIX
)/bin
69 CONFIGURE_OPTIONS
+= --sbindir
=$(PHP_PREFIX
)/bin
70 CONFIGURE_OPTIONS
+= --libdir=$(PHP_PREFIX
)/lib
/$(MACH64
)
71 CONFIGURE_OPTIONS
+= --libexecdir
=$(PHP_PREFIX
)/libexec
72 CONFIGURE_OPTIONS
+= --includedir=$(PHP_PREFIX
)/include
73 CONFIGURE_OPTIONS
+= --sysconfdir
=$(PHP_SYSCONFDIR
)
74 CONFIGURE_OPTIONS
+= --datadir=$(PHP_DATADIR
)
75 CONFIGURE_OPTIONS
+= --mandir=$(PHP_PREFIX
)/share
/man
76 CONFIGURE_OPTIONS
+= --localstatedir
=$(PHP_DATADIR
)
77 CONFIGURE_OPTIONS
+= OPENSSL_CFLAGS
=-I
$(OPENSSL_INCDIR
)
78 CONFIGURE_OPTIONS
+= OPENSSL_LIBS
="-L$(OPENSSL_LIBDIR) -lssl -lcrypto"
79 CONFIGURE_OPTIONS
+= KERBEROS_CFLAGS
=-I
/usr
/include/kerberosv5
80 CONFIGURE_OPTIONS
+= KERBEROS_LIBS
="-L/usr/lib/$(MACH64) -lgss -lkrb5"
81 CONFIGURE_OPTIONS
+= PCRE2_CFLAGS
="-I/usr/include/pcre"
82 CONFIGURE_OPTIONS
+= ODBC_CFLAGS
="-I/usr/include/odbc"
85 CONFIGURE_OPTIONS
+= --with-apxs2
=$(AP_PREFIX
)/bin
/apxs
86 CONFIGURE_OPTIONS
+= --enable-fpm
88 ifeq ($(strip $(MACH
)),i386
)
89 CONFIGURE_OPTIONS
+= --build
=x86_64-pc-solaris
$(SOLARIS_VERSION
)
90 CONFIGURE_OPTIONS
+= --with-external-pcre
92 CONFIGURE_OPTIONS
+= --build
=sparcv9-sun-solaris
$(SOLARIS_VERSION
)
93 CONFIGURE_OPTIONS
+= --with-pcre-jit
=no
96 CONFIGURE_OPTIONS
+= --with-config-file-path
=$(PHP_SYSCONFDIR
)
97 CONFIGURE_OPTIONS
+= --with-config-file-scan-dir
=$(PHP_SYSCONFDIR
)/conf.d
98 CONFIGURE_OPTIONS
+= --with-pear
=$(PHP_PREFIX
)/share
/PEAR
100 CONFIGURE_OPTIONS
+= --with-layout
=PHP
102 CONFIGURE_OPTIONS
+= --with-cdb
103 CONFIGURE_OPTIONS
+= --with-kerberos
104 CONFIGURE_OPTIONS
+= --with-readline
105 CONFIGURE_OPTIONS
+= --enable-dtrace
108 CONFIGURE_OPTIONS
+= --with-gettext
=shared
109 CONFIGURE_OPTIONS
+= --with-zlib
=shared
110 CONFIGURE_OPTIONS
+= --with-openssl
=shared
111 CONFIGURE_OPTIONS
+= --with-pdo-sqlite
=shared
112 CONFIGURE_OPTIONS
+= --with-ldap
=shared
113 CONFIGURE_OPTIONS
+= --with-bz2
=shared
114 CONFIGURE_OPTIONS
+= --with-iconv
=shared
115 CONFIGURE_OPTIONS
+= --with-tidy
=shared
116 CONFIGURE_OPTIONS
+= --with-mhash
=shared
117 CONFIGURE_OPTIONS
+= --with-xsl
=shared
118 CONFIGURE_OPTIONS
+= --with-curl
=shared
119 CONFIGURE_OPTIONS
+= --with-pspell
=shared
120 CONFIGURE_OPTIONS
+= --with-imap
=shared
121 CONFIGURE_OPTIONS
+= --with-imap-ssl
122 CONFIGURE_OPTIONS
+= --with-zip
=shared
123 CONFIGURE_OPTIONS
+= --with-sodium
=shared
124 CONFIGURE_OPTIONS
+= --enable-bcmath
=shared
125 CONFIGURE_OPTIONS
+= --enable-ctype
=shared
126 CONFIGURE_OPTIONS
+= --enable-calendar
=shared
127 CONFIGURE_OPTIONS
+= --enable-tokenizer
=shared
128 CONFIGURE_OPTIONS
+= --enable-exif
=shared
129 CONFIGURE_OPTIONS
+= --enable-dom
=shared
130 CONFIGURE_OPTIONS
+= --enable-ftp
=shared
131 CONFIGURE_OPTIONS
+= --enable-intl
=shared
132 CONFIGURE_OPTIONS
+= --enable-pdo
=shared
133 CONFIGURE_OPTIONS
+= --enable-mbstring
=shared
134 CONFIGURE_OPTIONS
+= --enable-xmlreader
=shared
135 CONFIGURE_OPTIONS
+= --enable-xmlwriter
=shared
136 CONFIGURE_OPTIONS
+= --enable-soap
=shared
137 CONFIGURE_OPTIONS
+= --enable-sockets
=shared
138 CONFIGURE_OPTIONS
+= --enable-mysqlnd
=shared
139 CONFIGURE_OPTIONS
+= --with-snmp
=shared
141 # Extensions, dependent on other packages
143 CONFIGURE_OPTIONS
+= --with-mysqli
=shared
,$(MYSQL_BINDIR
)/mysql_config
144 CONFIGURE_OPTIONS
+= --with-pdo-mysql
=shared
,$(MYSQL_DIR
)
145 CONFIGURE_OPTIONS
+= --with-pgsql
=shared
,$(PG_BINDIR
)
146 CONFIGURE_OPTIONS
+= --with-pdo-pgsql
=shared
,$(PG_BINDIR
)
148 # Disabled extensions & Options
149 CONFIGURE_OPTIONS
+= --disable-static
150 CONFIGURE_OPTIONS
+= --disable-dba
151 CONFIGURE_OPTIONS
+= --disable-debug
152 CONFIGURE_OPTIONS
+= --disable-libgcc
153 CONFIGURE_OPTIONS
+= --without-dbm
156 CONFIGURE_OPTIONS
+= --enable-zts
157 CONFIGURE_OPTIONS
+= --enable-re2c-cgoto
158 CONFIGURE_OPTIONS
+= --enable-cli
159 CONFIGURE_OPTIONS
+= --enable-cgi
160 CONFIGURE_OPTIONS
+= --with-ffi
161 CONFIGURE_OPTIONS
+= --enable-shared
162 CONFIGURE_OPTIONS
+= --enable-filter
163 CONFIGURE_OPTIONS
+= --enable-gd-jis-conv
164 CONFIGURE_OPTIONS
+= --enable-short-tags
165 CONFIGURE_OPTIONS
+= --enable-pcntl
166 CONFIGURE_OPTIONS
+= --enable-shmop
167 CONFIGURE_OPTIONS
+= --enable-sysvmsg
168 CONFIGURE_OPTIONS
+= --enable-sysvsem
169 CONFIGURE_OPTIONS
+= --enable-sysvshm
170 CONFIGURE_OPTIONS
+= --enable-simplexml
171 CONFIGURE_OPTIONS
+= --enable-session
172 CONFIGURE_OPTIONS
+= --enable-opcache
173 CONFIGURE_OPTIONS
+= --with-mhash
174 CONFIGURE_OPTIONS
+= --enable-gd
175 CONFIGURE_OPTIONS
+= --with-external-gd
176 CONFIGURE_OPTIONS
+= --with-webp
177 CONFIGURE_OPTIONS
+= --with-jpeg
178 CONFIGURE_OPTIONS
+= --with-xpm
179 CONFIGURE_OPTIONS
+= --with-freetype
180 CONFIGURE_OPTIONS
+= --with-gmp
181 CONFIGURE_OPTIONS
+= --with-enchant
182 CONFIGURE_OPTIONS
+= --with-unixODBC
183 CONFIGURE_OPTIONS
+= --with-openssl-dir
=$(OPENSSL_PREFIX
)
185 # remove EXTRA_FLAGS to get the right ssl and crypto libs
186 # now with fix to cover all EXTRA_LDFLAGS conditions
187 COMPONENT_POST_CONFIGURE_ACTION
= \
189 $(GSED
) -i
-e
's:^EXTRA_LDFLAGS = .*:EXTRA_LDFLAGS = -avoid-version -module:' -e
's:-L/usr/lib/$(MACH64) ::' -e
's:-R/usr/lib/$(MACH64) ::' Makefile
)
191 # Installation Arguments
192 COMPONENT_INSTALL_ARGS
+= INSTALL_ROOT
=$(PROTO_DIR
)
194 # Pre-Install Actions
195 COMPONENT_PRE_INSTALL_ACTION
+= \
196 ( $(MKDIR
) -p
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
; \
197 echo
"Creating fake modules.load and httpd.conf" ; \
198 echo
"\# LoadModule foo_module libexec/mod_foo.so" >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
199 echo
"\# " >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
200 echo
"LoadModule foo_module libexec/mod_foo.so " >> $(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
; \
201 cp
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/conf.d
/modules.load
$(PROTO_DIR
)/$(AP_SYSCONFDIR
)/httpd.conf \
204 # Environment Variables
205 CONFIGURE_ENV
+= EXTENSION_DIR
=$(PHP_PREFIX
)/extensions
206 CONFIGURE_ENV
+= ICU_CONFIG
=/usr
/bin
/icu-config
207 CONFIGURE_ENV
+= PG_CONFIG
=$(PG_BINDIR
)/pg_config
208 CONFIGURE_ENV
+= PKG_CONFIG_PATH
=$(OPENSSL_PREFIX
)/lib
/$(MACH64
)/pkgconfig
210 COMPONENT_TEST_TARGETS
= test
212 COMPONENT_TEST_ENV
+= NO_INTERACTION
=yes
214 # Test results are unstable between runs but still useful for humans.
215 # test failures; keep going
216 COMPONENT_TEST_ARGS
+= -k
-i
217 COMPONENT_TEST_TRANSFORMS
+= \
219 '-e "/^Time taken/d" ' \
220 '-e "/^TEST RESULT SUMMARY$$/,\$$p" ' \
223 # Manually added build dependencies
224 REQUIRED_PACKAGES
+= $(MYSQL_CLIENT_PKG
)
225 REQUIRED_PACKAGES
+= $(PG_DEVELOPER_PKG
)
226 REQUIRED_PACKAGES
+= $(PG_SERVICE_PKG
)
227 REQUIRED_PACKAGES
+= web
/server
/apache-24
229 # Auto-generated dependencies
230 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
231 REQUIRED_PACKAGES
+= $(ICU_LIBRARY_PKG
)
232 REQUIRED_PACKAGES
+= $(MYSQL_LIBRARY_PKG
)
233 REQUIRED_PACKAGES
+= $(PG_LIBRARY_PKG
)
234 REQUIRED_PACKAGES
+= SUNWcs
235 REQUIRED_PACKAGES
+= compress
/bzip2
236 REQUIRED_PACKAGES
+= database
/sqlite-3
237 REQUIRED_PACKAGES
+= library
/gd
238 REQUIRED_PACKAGES
+= library
/gmp
239 REQUIRED_PACKAGES
+= library
/libffi
240 REQUIRED_PACKAGES
+= library
/libxml2
241 REQUIRED_PACKAGES
+= library
/libxslt
242 REQUIRED_PACKAGES
+= library
/libzip
243 REQUIRED_PACKAGES
+= library
/openldap
244 REQUIRED_PACKAGES
+= library
/pcre2
245 REQUIRED_PACKAGES
+= library
/readline
246 REQUIRED_PACKAGES
+= library
/security
/libsodium
247 REQUIRED_PACKAGES
+= library
/security
/openssl-31
248 REQUIRED_PACKAGES
+= library
/spell-checking
/enchant
249 REQUIRED_PACKAGES
+= library
/unixodbc
250 REQUIRED_PACKAGES
+= library
/uw-imap
251 REQUIRED_PACKAGES
+= library
/zlib
252 REQUIRED_PACKAGES
+= shell/ksh93
253 REQUIRED_PACKAGES
+= system
/library
254 REQUIRED_PACKAGES
+= system
/library
/math
255 REQUIRED_PACKAGES
+= system
/management
/snmp
/net-snmp
256 REQUIRED_PACKAGES
+= text
/aspell
257 REQUIRED_PACKAGES
+= text
/oniguruma
258 REQUIRED_PACKAGES
+= text
/tidy
259 REQUIRED_PACKAGES
+= web
/curl