summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/php/php_8.4.8.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools/php/php_8.4.8.bb')
-rw-r--r--meta-oe/recipes-devtools/php/php_8.4.8.bb292
1 files changed, 292 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/php/php_8.4.8.bb b/meta-oe/recipes-devtools/php/php_8.4.8.bb
new file mode 100644
index 0000000000..f38a407968
--- /dev/null
+++ b/meta-oe/recipes-devtools/php/php_8.4.8.bb
@@ -0,0 +1,292 @@
1SUMMARY = "A server-side, HTML-embedded scripting language"
2HOMEPAGE = "https://www.php.net"
3SECTION = "console/network"
4
5LICENSE = "PHP-3.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=fd469cce1a919f0cc95bab7afb28d19d"
7
8BBCLASSEXTEND = "native"
9DEPENDS = "zlib bzip2 libxml2 virtual/libiconv php-native"
10DEPENDS:append:libc-musl = " libucontext"
11DEPENDS:class-native = "zlib-native libxml2-native"
12
13PHP_MAJOR_VERSION = "${@d.getVar('PV').split('.')[0]}"
14
15SRC_URI = "http://php.net/distributions/php-${PV}.tar.bz2 \
16 file://0001-configure.ac-don-t-include-build-libtool.m4.patch \
17 file://0002-ext-phar-Makefile.frag-Fix-phar-packaging.patch \
18 "
19
20SRC_URI:append:class-target = " \
21 file://0003-iconv-fix-detection.patch \
22 file://0004-pear-fix-Makefile.frag-for-Yocto.patch \
23 file://0005-sapi-cli-config.m4-fix-build-directory.patch \
24 file://php-fpm.conf \
25 file://php-fpm-apache.conf \
26 file://70_mod_php${PHP_MAJOR_VERSION}.conf \
27 file://php-fpm.service \
28 "
29
30S = "${UNPACKDIR}/php-${PV}"
31
32SRC_URI[sha256sum] = "36569c64dd1499e570c436603b641eee7cde4af576af786597d0ee711b3a3a8a"
33
34CVE_STATUS_GROUPS += "CVE_STATUS_PHP"
35CVE_STATUS_PHP[status] = "fixed-version: The name of this product is exactly the same as github.com/emlog/emlog. CVE can be safely ignored."
36CVE_STATUS_PHP = " \
37 CVE-2007-2728 \
38 CVE-2007-3205 \
39 CVE-2007-4596 \
40"
41CVE_STATUS[CVE-2022-4900] = "cpe-incorrect: The current version (8.2.20) is not affected."
42
43inherit autotools pkgconfig python3native gettext multilib_header multilib_script systemd
44
45# phpize is not scanned for absolute paths by default (but php-config is).
46#
47SSTATE_SCAN_FILES += "phpize"
48SSTATE_SCAN_FILES += "build-defs.h"
49
50export PHP_UNAME = "Linux"
51
52PHP_LIBDIR = "${libdir}/php${PHP_MAJOR_VERSION}"
53
54# Common EXTRA_OECONF
55COMMON_EXTRA_OECONF = "--enable-sockets \
56 --enable-pcntl \
57 --enable-shared \
58 --disable-rpath \
59 --with-pic \
60 --libdir=${PHP_LIBDIR} \
61"
62EXTRA_OECONF = "--enable-mbstring \
63 --enable-fpm \
64 --with-libdir=${baselib} \
65 --with-gettext=${STAGING_LIBDIR}/.. \
66 --with-zlib=${STAGING_LIBDIR}/.. \
67 --with-iconv=${STAGING_LIBDIR}/.. \
68 --with-bz2=${STAGING_DIR_TARGET}${exec_prefix} \
69 --with-config-file-path=${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION} \
70 ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', 'ac_cv_c_bigendian_php=no', 'ac_cv_c_bigendian_php=yes', d)} \
71 ${COMMON_EXTRA_OECONF} \
72"
73
74# Set these values directly to avoid AC_RUN_IFELSE which does not work in cross compilation environment
75CACHED_CONFIGUREVARS += "ac_cv_php_cv_shm_ipc=yes ac_cv_php_cv_shm_mmap_anon=yes ac_cv_php_cv_shm_mmap_posix=yes"
76
77EXTRA_OECONF:append:riscv64 = " --with-pcre-jit=no"
78EXTRA_OECONF:append:riscv32 = " --with-pcre-jit=no"
79# Needs fibers assembly implemented for rv32
80# for example rv64 implementation is below
81# see https://github.com/php/php-src/commit/70b02d75f2abe3a292d49c4a4e9e4f850c2fee68
82EXTRA_OECONF:append:riscv32:libc-musl = " --disable-fiber-asm"
83
84EXTRA_OECONF:class-native = " \
85 --with-zlib=${STAGING_LIBDIR_NATIVE}/.. \
86 --without-iconv \
87 ${COMMON_EXTRA_OECONF} \
88"
89
90PACKAGECONFIG ??= "mysql sqlite3 opcache openssl \
91 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6 pam', d)} \
92"
93PACKAGECONFIG:class-native = ""
94
95PACKAGECONFIG[apache2] = "--with-apxs2=${STAGING_BINDIR_CROSS}/apxs,,apache2-native apache2"
96PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
97PACKAGECONFIG[mbregex] = "--enable-mbregex, --disable-mbregex, oniguruma"
98PACKAGECONFIG[mbstring] = "--enable-mbstring,,"
99PACKAGECONFIG[mysql] = "--with-mysqli=mysqlnd \
100 --with-pdo-mysql=mysqlnd \
101 ,--without-mysqli --without-pdo-mysql \
102 ,mysql5"
103PACKAGECONFIG[opcache] = "--enable-opcache,--disable-opcache"
104PACKAGECONFIG[openssl] = "--with-openssl,--without-openssl,openssl"
105PACKAGECONFIG[pam] = ",,libpam"
106PACKAGECONFIG[pgsql] = "--with-pgsql=${STAGING_DIR_TARGET}${exec_prefix},--without-pgsql,postgresql"
107PACKAGECONFIG[soap] = "--enable-soap, --disable-soap, libxml2"
108PACKAGECONFIG[sqlite3] = "--with-sqlite3=${STAGING_LIBDIR}/.. \
109 --with-pdo-sqlite=${STAGING_LIBDIR}/.. \
110 ,--without-sqlite3 --without-pdo-sqlite \
111 ,sqlite3"
112PACKAGECONFIG[valgrind] = "--with-valgrind=${STAGING_DIR_TARGET}/usr,--with-valgrind=no,valgrind"
113PACKAGECONFIG[zip] = "--with-zip --with-zlib-dir=${STAGING_EXECPREFIXDIR},,libzip"
114
115export HOSTCC = "${BUILD_CC}"
116export PHP_NATIVE_DIR = "${STAGING_BINDIR_NATIVE}"
117export PHP_PEAR_PHP_BIN = "${STAGING_BINDIR_NATIVE}/php"
118CFLAGS += " -D_GNU_SOURCE -D_LARGEFILE64_SOURCE -g -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED -I${STAGING_INCDIR}/apache2"
119
120# Adding these flags enables dynamic library support, which is disabled by
121# default when cross compiling
122# See https://bugs.php.net/bug.php?id=60109
123CFLAGS += " -DHAVE_LIBDL "
124LDFLAGS += " -ldl "
125LDFLAGS:append:libc-musl = " -lucontext "
126LDFLAGS:append:riscv64 = " -latomic"
127
128EXTRA_OEMAKE = "INSTALL_ROOT=${D}"
129
130do_configure:prepend () {
131 rm -f ${S}/build/libtool.m4 ${S}/ltmain.sh ${S}/aclocal.m4
132 find ${S} -name config.m4 | xargs -n1 sed -i 's!APXS_HTTPD=.*!APXS_HTTPD=${STAGING_SBINDIR_NATIVE}/httpd!'
133}
134
135do_configure:append() {
136 # No, libtool, we really don't want rpath set...
137 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
138 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
139 sed -i -e's@${RECIPE_SYSROOT}@@g' \
140 -e's@-ffile-prefix-map=[^ ]*[ ]*@@g' \
141 -e's@-fdebug-prefix-map=[^ ]*[ ]*@@g' \
142 -e's@-ffile-prefix-map=[^ ]*[ ]*@@g' \
143 -e's@-fmacro-prefix-map=[^ ]*[ ]*@@g' \
144 ${B}/main/build-defs.h \
145 ${B}/scripts/php-config
146}
147
148do_install:append:class-native() {
149 rm -rf ${D}/${PHP_LIBDIR}/php/.registry
150 rm -rf ${D}/${PHP_LIBDIR}/php/.channels
151 rm -rf ${D}/${PHP_LIBDIR}/php/.[a-z]*
152}
153
154do_install:prepend() {
155 cat ${STAGING_DATADIR}/aclocal/libtool.m4 \
156 ${STAGING_DATADIR}/aclocal/lt~obsolete.m4 \
157 ${STAGING_DATADIR}/aclocal/ltoptions.m4 \
158 ${STAGING_DATADIR}/aclocal/ltsugar.m4 \
159 ${STAGING_DATADIR}/aclocal/ltversion.m4 > ${S}/build/libtool.m4
160}
161
162do_install:prepend:class-target() {
163 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
164 # Install dummy config file so apxs doesn't fail
165 install -d ${D}${sysconfdir}/apache2
166 printf "\nLoadModule dummy_module modules/mod_dummy.so\n" > ${D}${sysconfdir}/apache2/httpd.conf
167 fi
168}
169
170# fixme
171do_install:append:class-target() {
172 install -d ${D}${sysconfdir}/
173 rm -rf ${D}/.registry
174 rm -rf ${D}/.channels
175 rm -rf ${D}/.[a-z]*
176 rm -rf ${D}/var
177 rm -f ${D}/${sysconfdir}/php-fpm.conf.default
178 install -m 0644 ${UNPACKDIR}/php-fpm.conf ${D}/${sysconfdir}/php-fpm.conf
179 install -d ${D}/${sysconfdir}/apache2/conf.d
180 install -m 0644 ${UNPACKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
181 install -d ${D}${sysconfdir}/init.d
182 sed -i 's:=/usr/sbin:=${sbindir}:g' ${B}/sapi/fpm/init.d.php-fpm
183 sed -i 's:=/etc:=${sysconfdir}:g' ${B}/sapi/fpm/init.d.php-fpm
184 sed -i 's:=/var:=${localstatedir}:g' ${B}/sapi/fpm/init.d.php-fpm
185 install -m 0755 ${B}/sapi/fpm/init.d.php-fpm ${D}${sysconfdir}/init.d/php-fpm
186 install -m 0644 ${UNPACKDIR}/php-fpm-apache.conf ${D}/${sysconfdir}/apache2/conf.d/php-fpm.conf
187
188 if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)};then
189 install -d ${D}${systemd_system_unitdir}
190 install -m 0644 ${UNPACKDIR}/php-fpm.service ${D}${systemd_system_unitdir}/php-fpm.service
191 sed -i -e 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${systemd_system_unitdir}/php-fpm.service
192 sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_system_unitdir}/php-fpm.service
193 sed -i -e 's,@BINDIR@,${bindir},g' ${D}${systemd_system_unitdir}/php-fpm.service
194 fi
195
196 if ${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'true', 'false', d)}; then
197 install -d ${D}${sysconfdir}/apache2/modules.d
198 install -d ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}
199 install -m 644 ${UNPACKDIR}/70_mod_php${PHP_MAJOR_VERSION}.conf ${D}${sysconfdir}/apache2/modules.d
200 sed -i s,lib/,${libexecdir}/, ${D}${sysconfdir}/apache2/modules.d/70_mod_php${PHP_MAJOR_VERSION}.conf
201 cat ${S}/php.ini-production | \
202 sed -e 's,extension_dir = \"\./\",extension_dir = \"/usr/lib/extensions\",' \
203 > ${D}${sysconfdir}/php/apache2-php${PHP_MAJOR_VERSION}/php.ini
204 rm -f ${D}${sysconfdir}/apache2/httpd.conf*
205 fi
206}
207
208MULTILIB_SCRIPTS += "${PN}:${bindir}/php-config \
209 ${PN}:${bindir}/phpize \
210"
211
212do_install:append () {
213 oe_multilib_header php/main/build-defs.h php/main/php_config.h
214}
215
216SYSROOT_PREPROCESS_FUNCS += "php_sysroot_preprocess"
217
218php_sysroot_preprocess () {
219 install -d ${SYSROOT_DESTDIR}${bindir_crossscripts}/
220 install -m 755 ${D}${bindir}/phpize ${SYSROOT_DESTDIR}${bindir_crossscripts}/
221 install -m 755 ${D}${bindir}/php-config ${SYSROOT_DESTDIR}${bindir_crossscripts}/
222
223 sed -i 's!eval echo /!eval echo ${STAGING_DIR_HOST}/!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/phpize
224 sed -i 's!^include_dir=.*!include_dir=${STAGING_INCDIR}/php!' ${SYSROOT_DESTDIR}${bindir_crossscripts}/php-config
225}
226
227MODPHP_PACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', '${PN}-modphp', '', d)}"
228
229PACKAGES = "${PN}-dbg ${PN}-cli ${PN}-phpdbg ${PN}-cgi ${PN}-fpm ${PN}-fpm-apache2 ${PN}-pear ${PN}-phar ${MODPHP_PACKAGE} ${PN}-dev ${PN}-staticdev ${PN}-doc ${PN}-opcache ${PN}"
230
231RDEPENDS:${PN} += "libgcc"
232RDEPENDS:${PN}-pear = "${PN}"
233RDEPENDS:${PN}-phar = "${PN}-cli"
234RDEPENDS:${PN}-cli = "${PN}"
235RDEPENDS:${PN}-modphp = "${PN} apache2"
236RDEPENDS:${PN}-opcache = "${PN}"
237
238ALLOW_EMPTY:${PN} = "1"
239
240INITSCRIPT_PACKAGES = "${PN}-fpm"
241inherit update-rc.d
242
243# WARNING: lib32-php-8.0.12-r0 do_package_qa: QA Issue: lib32-php: ELF binary /usr/libexec/apache2/modules/libphp.so has relocations in .text [textrel]
244#WARNING: lib32-php-8.0.12-r0 do_package_qa: QA Issue: lib32-php-opcache: ELF binary /usr/lib/php8/extensions/no-debug-zts-20200930/opcache.so has relocations in .text [textrel]
245INSANE_SKIP:${PN}:append:x86 = " textrel"
246INSANE_SKIP:${PN}-opcache:append:x86 = " textrel"
247
248FILES:${PN}-dbg =+ "${bindir}/.debug \
249 ${libexecdir}/apache2/modules/.debug"
250FILES:${PN}-doc += "${PHP_LIBDIR}/php/doc"
251FILES:${PN}-cli = "${bindir}/php"
252FILES:${PN}-phpdbg = "${bindir}/phpdbg"
253FILES:${PN}-phar = "${bindir}/phar*"
254FILES:${PN}-cgi = "${bindir}/php-cgi"
255FILES:${PN}-fpm = "${sbindir}/php-fpm ${sysconfdir}/php-fpm.conf ${datadir}/fpm ${sysconfdir}/init.d/php-fpm ${sysconfdir}/php-fpm.d/www.conf.default"
256FILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
257CONFFILES:${PN}-fpm = "${sysconfdir}/php-fpm.conf"
258CONFFILES:${PN}-fpm-apache2 = "${sysconfdir}/apache2/conf.d/php-fpm.conf"
259INITSCRIPT_NAME:${PN}-fpm = "php-fpm"
260INITSCRIPT_PARAMS:${PN}-fpm = "defaults 60"
261FILES:${PN}-pear = "${bindir}/pear* ${bindir}/pecl ${PHP_LIBDIR}/php/PEAR \
262 ${PHP_LIBDIR}/php/PEAR*.php ${PHP_LIBDIR}/php/System.php \
263 ${PHP_LIBDIR}/php/peclcmd.php ${PHP_LIBDIR}/php/pearcmd.php \
264 ${PHP_LIBDIR}/php/.channels ${PHP_LIBDIR}/php/.channels/.alias \
265 ${PHP_LIBDIR}/php/.registry ${PHP_LIBDIR}/php/Archive/Tar.php \
266 ${PHP_LIBDIR}/php/Console/Getopt.php ${PHP_LIBDIR}/php/OS/Guess.php \
267 ${PHP_LIBDIR}/php/data/PEAR \
268 ${sysconfdir}/pear.conf"
269FILES:${PN}-dev = "${includedir}/php ${PHP_LIBDIR}/build ${bindir}/phpize \
270 ${bindir}/php-config ${PHP_LIBDIR}/php/.depdb \
271 ${PHP_LIBDIR}/php/.depdblock ${PHP_LIBDIR}/php/.filemap \
272 ${PHP_LIBDIR}/php/.lock ${PHP_LIBDIR}/php/test"
273FILES:${PN}-staticdev += "${PHP_LIBDIR}/extensions/*/*.a"
274FILES:${PN}-opcache = "${PHP_LIBDIR}/extensions/*/opcache${SOLIBSDEV}"
275FILES:${PN} = "${PHP_LIBDIR}/php"
276FILES:${PN} += "${bindir} ${libexecdir}/apache2"
277
278SUMMARY:${PN}-modphp = "PHP module for the Apache HTTP server"
279FILES:${PN}-modphp = "${libdir}/apache2 ${sysconfdir}"
280
281MODPHP_OLDPACKAGE = "${@bb.utils.contains('PACKAGECONFIG', 'apache2', 'modphp', '', d)}"
282RPROVIDES:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
283RREPLACES:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
284RCONFLICTS:${PN}-modphp = "${MODPHP_OLDPACKAGE}"
285
286SYSTEMD_SERVICE:${PN}-fpm = "php-fpm.service"
287SYSTEMD_PACKAGES += "${PN}-fpm"
288
289do_install:append:class-native() {
290 create_wrapper ${D}${bindir}/php \
291 PHP_PEAR_SYSCONF_DIR=${sysconfdir}/
292}