diff --git a/dev-lang/php/patches/php8-8.1.3.patchset b/dev-lang/php/patches/php8-8.1.3.patchset new file mode 100644 index 000000000..7816094ea --- /dev/null +++ b/dev-lang/php/patches/php8-8.1.3.patchset @@ -0,0 +1,77 @@ +From 17b139834747ae40fb5971b28f2a3fd9699a94aa Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 19 Feb 2022 19:29:19 +0100 +Subject: Teaching m4 about Haiku + + +diff --git a/ext/bz2/config.m4 b/ext/bz2/config.m4 +index 56d81a6..1595cac 100644 +--- a/ext/bz2/config.m4 ++++ b/ext/bz2/config.m4 +@@ -6,6 +6,8 @@ PHP_ARG_WITH([bz2], + if test "$PHP_BZ2" != "no"; then + if test -r $PHP_BZ2/include/bzlib.h; then + BZIP_DIR=$PHP_BZ2 ++ elif test -r $PHP_BZ2/develop/headers/bzlib.h; then ++ BZIP_DIR=$PHP_BZ2 + else + AC_MSG_CHECKING(for BZip2 in default path) + for i in /usr/local /usr; do +diff --git a/ext/gettext/config.m4 b/ext/gettext/config.m4 +index 536785f..8545219 100644 +--- a/ext/gettext/config.m4 ++++ b/ext/gettext/config.m4 +@@ -8,6 +8,10 @@ if test "$PHP_GETTEXT" != "no"; then + test -r $i/include/libintl.h && GETTEXT_DIR=$i && break + done + ++ for i in $PHP_GETTEXT; do ++ test -r $i/develop/headers/libintl.h && GETTEXT_DIR=$i && break ++ done ++ + if test -z "$GETTEXT_DIR"; then + AC_MSG_ERROR(Cannot locate header file libintl.h) + fi +diff --git a/ext/readline/config.m4 b/ext/readline/config.m4 +index 209f92b..3855c8d 100644 +--- a/ext/readline/config.m4 ++++ b/ext/readline/config.m4 +@@ -19,6 +19,10 @@ if test "$PHP_READLINE" && test "$PHP_READLINE" != "no"; then + test -f $i/include/readline/readline.h && READLINE_DIR=$i && break + done + ++ for i in $PHP_READLINE; do ++ test -f $i/develop/headers/readline/readline.h && READLINE_DIR=$i && break ++ done ++ + if test -z "$READLINE_DIR"; then + AC_MSG_ERROR(Please reinstall readline - I cannot find readline.h) + fi +-- +2.30.2 + + +From c776caa6e22d5e1530eacc04c1843152e2798c8e Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= +Date: Sat, 19 Feb 2022 19:31:37 +0100 +Subject: PCNTL build fix + + +diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c +index c1c99ab..9fefeff 100644 +--- a/ext/pcntl/pcntl.c ++++ b/ext/pcntl/pcntl.c +@@ -50,6 +50,10 @@ + # define NSIG 32 + #endif + ++#ifndef SIGIO ++# define SIGIO -1 ++#endif ++ + ZEND_DECLARE_MODULE_GLOBALS(pcntl) + static PHP_GINIT_FUNCTION(pcntl); + +-- +2.30.2 + diff --git a/dev-lang/php/php8-8.1.3.recipe b/dev-lang/php/php8-8.1.3.recipe new file mode 100644 index 000000000..9ab9c2a4d --- /dev/null +++ b/dev-lang/php/php8-8.1.3.recipe @@ -0,0 +1,165 @@ +SUMMARY="A popular general-purpose scripting language" +DESCRIPTION="PHP is a popular general-purpose scripting language that is \ +especially suited to web development. +Fast, flexible and pragmatic, PHP powers everything from your blog to the most \ +popular websites in the world." +HOMEPAGE="https://php.net/" +COPYRIGHT="2001-2022 PHP Group" +LICENSE="PHP License v3.01" +REVISION="1" +SOURCE_URI="https://php.net/get/php-$portVersion.tar.bz2/from/this/mirror" +CHECKSUM_SHA256="354c4e2c506046eca812d1fc2526884a2f54b5e3d20ef0ede919a69eb232d0be" +SOURCE_FILENAME="php-$portVersion.tar.bz2" +SOURCE_DIR="php-$portVersion" +PATCHES="php8-$portVersion.patchset" +ADDITIONAL_FILES="userlaunch.in" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +GLOBAL_WRITABLE_FILES=" + settings/php8 directory keep-old + " + +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + php8$secondaryArchSuffix = $portVersion + cmd:pear + cmd:peardev + cmd:pecl + cmd:phar + cmd:phar.phar + cmd:php + cmd:phpdbg + cmd:php_cgi + cmd:php_config + cmd:phpize + cmd:php_fpm + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libbz2$secondaryArchSuffix + lib:libcrypto$secondaryArchSuffix + lib:libcurl$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libgettextpo$secondaryArchSuffix + lib:libgd$secondaryArchSuffix + lib:libicuuc$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libnghttp2$secondaryArchSuffix + lib:libonig$secondaryArchSuffix + lib:libpcre2_8$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:libreadline$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libwebp$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libzip$secondaryArchSuffix + " +CONFLICTS=" + php$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libbz2$secondaryArchSuffix + devel:libcrypto$secondaryArchSuffix + devel:libcurl$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libgettextlib$secondaryArchSuffix + devel:libgd$secondaryArchSuffix + devel:libicuuc$secondaryArchSuffix + devel:libintl$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libnghttp2$secondaryArchSuffix + devel:libonig$secondaryArchSuffix + devel:libpcre2_8$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix + devel:libpq$secondaryArchSuffix + devel:libreadline$secondaryArchSuffix >= 8 + devel:libsqlite3$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libwebp$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libzip$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:aclocal + cmd:autoreconf + cmd:awk + cmd:bison +# cmd:freetype_config$secondaryArchSuffix + cmd:gcc$secondaryArchSuffix + cmd:icu_config$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + cmd:sed + cmd:xargs + cmd:xml2_config$secondaryArchSuffix + " + +BUILD() +{ + ./buildconf -f + runConfigure --omit-dirs "binDir sbinDir" ./configure \ + --bindir=$commandBinDir \ + --sbindir=$commandBinDir \ + --sysconfdir=$settingsDir/php8 \ + --with-config-file-path=$settingsDir/php8 \ + --with-config-file-scan-dir=$settingsDir/php8 \ + --with-zip \ + --with-zlib-dir=`finddir B_SYSTEM_DIRECTORY` --with-zlib \ + --with-bz2=`finddir B_SYSTEM_DIRECTORY` \ + --with-readline=`finddir B_SYSTEM_DIRECTORY` \ + --with-openssl \ + --with-curl \ + --disable-opcache \ + --enable-intl \ + --with-gettext=`finddir B_SYSTEM_DIRECTORY` \ + --enable-ftp \ + --enable-soap \ + --without-iconv \ + --enable-fpm \ + --enable-gd \ + --with-external-gd \ + --with-mysqli \ + --enable-bcmath \ + --enable-mbstring \ + --with-freetype \ + --with-jpeg \ + --with-webp \ + --with-external-pcre \ + --enable-exif \ + --enable-calendar \ + --enable-pcntl \ + --enable-sockets \ + --disable-debug + make $jobArgs +} + +INSTALL() +{ + make install + rm -rf $libDir/build # Only garbage is installed here. + mkdir -p $dataDir/user_launch + sed \ + -e "s|@APP@|php-fpm|" \ + -e "s|@BIN@|"$binDir"/php-fpm|" \ + -e "s|php7|php8|" \ + $portDir/additional-files/userlaunch.in > $dataDir/user_launch/php-fpm +} + +TEST() +{ + make test +}