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