From 82b35afe4363bc8b0d922e3f5a5a26aaf368b506 Mon Sep 17 00:00:00 2001 From: IhatemyISP Date: Fri, 5 Mar 2021 00:21:45 +0000 Subject: [PATCH] version and feature bump --- dev-lang/php/additional-files/userlaunch.in | 6 + dev-lang/php/patches/php-7.4.16.patchset | 311 ++++++++++++++++++++ dev-lang/php/php-7.4.16.recipe | 141 +++++++++ 3 files changed, 458 insertions(+) create mode 100644 dev-lang/php/additional-files/userlaunch.in create mode 100644 dev-lang/php/patches/php-7.4.16.patchset create mode 100644 dev-lang/php/php-7.4.16.recipe diff --git a/dev-lang/php/additional-files/userlaunch.in b/dev-lang/php/additional-files/userlaunch.in new file mode 100644 index 000000000..a65689316 --- /dev/null +++ b/dev-lang/php/additional-files/userlaunch.in @@ -0,0 +1,6 @@ +job x-vnd.@APP@ { + launch @BIN@ + no_safemode + legacy + on initial_volumes_mounted +} diff --git a/dev-lang/php/patches/php-7.4.16.patchset b/dev-lang/php/patches/php-7.4.16.patchset new file mode 100644 index 000000000..3f4ed9ae7 --- /dev/null +++ b/dev-lang/php/patches/php-7.4.16.patchset @@ -0,0 +1,311 @@ +From be47a7ecf2972547120a3f55ea3c177644b5921a Mon Sep 17 00:00:00 2001 +From: Ian Corbitt +Date: Thu, 4 Mar 2021 23:40:05 +0000 +Subject: Build fixes based off Adrien Destugues + + +diff --git a/configure.ac b/configure.ac +index e1adda7..546621f 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -393,9 +393,9 @@ dnl Some systems (OpenServer 5) dislike -lsocket -lnsl, so we try to avoid -lnsl + dnl checks, if we already have the functions which are usually in libnsl. Also, + dnl uClibc will bark at linking with glibc's libnsl. + +-PHP_CHECK_FUNC(socket, socket) +-PHP_CHECK_FUNC(socketpair, socket) +-PHP_CHECK_FUNC(htonl, socket) ++PHP_CHECK_FUNC(socket, network) ++PHP_CHECK_FUNC(socketpair, network) ++PHP_CHECK_FUNC(htonl, network) + PHP_CHECK_FUNC(gethostname, nsl) + PHP_CHECK_FUNC(gethostbyaddr, nsl) + PHP_CHECK_FUNC(dlopen, dl) +diff --git a/ext/fileinfo/libmagic/ascmagic.c b/ext/fileinfo/libmagic/ascmagic.c +index 0bc0cce..bbd925d 100644 +--- a/ext/fileinfo/libmagic/ascmagic.c ++++ b/ext/fileinfo/libmagic/ascmagic.c +@@ -51,7 +51,7 @@ FILE_RCSID("@(#)$File: ascmagic.c,v 1.104 2019/05/07 02:27:11 christos Exp $") + #define ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \ + || (x) == 0x85 || (x) == '\f') + +-private unsigned char *encode_utf8(unsigned char *, size_t, unichar *, size_t); ++private unsigned char *encode_utf8(unsigned char *, size_t, php_unichar *, size_t); + private size_t trim_nuls(const unsigned char *, size_t); + + /* +@@ -70,7 +70,7 @@ trim_nuls(const unsigned char *buf, size_t nbytes) + protected int + file_ascmagic(struct magic_set *ms, const struct buffer *b, int text) + { +- unichar *ubuf = NULL; ++ php_unichar *ubuf = NULL; + size_t ulen = 0; + int rv = 1; + struct buffer bb; +@@ -103,7 +103,7 @@ file_ascmagic(struct magic_set *ms, const struct buffer *b, int text) + + protected int + file_ascmagic_with_encoding(struct magic_set *ms, +- const struct buffer *b, unichar *ubuf, size_t ulen, const char *code, ++ const struct buffer *b, php_unichar *ubuf, size_t ulen, const char *code, + const char *type, int text) + { + struct buffer bb; +@@ -338,7 +338,7 @@ done: + * after end of string, or NULL if an invalid character is found. + */ + private unsigned char * +-encode_utf8(unsigned char *buf, size_t len, unichar *ubuf, size_t ulen) ++encode_utf8(unsigned char *buf, size_t len, php_unichar *ubuf, size_t ulen) + { + size_t i; + unsigned char *end = buf + len; +diff --git a/ext/fileinfo/libmagic/encoding.c b/ext/fileinfo/libmagic/encoding.c +index 121bbd7..2d4e8ce 100644 +--- a/ext/fileinfo/libmagic/encoding.c ++++ b/ext/fileinfo/libmagic/encoding.c +@@ -44,14 +44,14 @@ FILE_RCSID("@(#)$File: encoding.c,v 1.20 2019/04/15 16:48:41 christos Exp $") + #include + + +-private int looks_ascii(const unsigned char *, size_t, unichar *, size_t *); +-private int looks_utf8_with_BOM(const unsigned char *, size_t, unichar *, ++private int looks_ascii(const unsigned char *, size_t, php_unichar *, size_t *); ++private int looks_utf8_with_BOM(const unsigned char *, size_t, php_unichar *, + size_t *); +-private int looks_utf7(const unsigned char *, size_t, unichar *, size_t *); +-private int looks_ucs16(const unsigned char *, size_t, unichar *, size_t *); +-private int looks_ucs32(const unsigned char *, size_t, unichar *, size_t *); +-private int looks_latin1(const unsigned char *, size_t, unichar *, size_t *); +-private int looks_extended(const unsigned char *, size_t, unichar *, size_t *); ++private int looks_utf7(const unsigned char *, size_t, php_unichar *, size_t *); ++private int looks_ucs16(const unsigned char *, size_t, php_unichar *, size_t *); ++private int looks_ucs32(const unsigned char *, size_t, php_unichar *, size_t *); ++private int looks_latin1(const unsigned char *, size_t, php_unichar *, size_t *); ++private int looks_extended(const unsigned char *, size_t, php_unichar *, size_t *); + private void from_ebcdic(const unsigned char *, size_t, unsigned char *); + + #ifdef DEBUG_ENCODING +@@ -63,11 +63,11 @@ private void from_ebcdic(const unsigned char *, size_t, unsigned char *); + /* + * Try to determine whether text is in some character code we can + * identify. Each of these tests, if it succeeds, will leave +- * the text converted into one-unichar-per-character Unicode in ++ * the text converted into one-php_unichar-per-character Unicode in + * ubuf, and the number of characters converted in ulen. + */ + protected int +-file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf, ++file_encoding(struct magic_set *ms, const struct buffer *b, php_unichar **ubuf, + size_t *ulen, const char **code, const char **code_mime, const char **type) + { + const unsigned char *buf = CAST(const unsigned char *, b->fbuf); +@@ -75,7 +75,7 @@ file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf, + size_t mlen; + int rv = 1, ucs_type; + unsigned char *nbuf = NULL; +- unichar *udefbuf; ++ php_unichar *udefbuf; + size_t udeflen; + + if (ubuf == NULL) +@@ -89,7 +89,7 @@ file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf, + *code_mime = "binary"; + + mlen = (nbytes + 1) * sizeof((*ubuf)[0]); +- if ((*ubuf = CAST(unichar *, ecalloc(CAST(size_t, 1), mlen))) == NULL) { ++ if ((*ubuf = CAST(php_unichar *, ecalloc(CAST(size_t, 1), mlen))) == NULL) { + file_oomem(ms, mlen); + goto done; + } +@@ -251,7 +251,7 @@ private char text_chars[256] = { + }; + + private int +-looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf, ++looks_ascii(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, + size_t *ulen) + { + size_t i; +@@ -271,7 +271,7 @@ looks_ascii(const unsigned char *buf, size_t nbytes, unichar *ubuf, + } + + private int +-looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) ++looks_latin1(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, size_t *ulen) + { + size_t i; + +@@ -290,7 +290,7 @@ looks_latin1(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ule + } + + private int +-looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf, ++looks_extended(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, + size_t *ulen) + { + size_t i; +@@ -321,11 +321,11 @@ looks_extended(const unsigned char *buf, size_t nbytes, unichar *ubuf, + * ubuf must be big enough! + */ + protected int +-file_looks_utf8(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) ++file_looks_utf8(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, size_t *ulen) + { + size_t i; + int n; +- unichar c; ++ php_unichar c; + int gotone = 0, ctrl = 0; + + if (ubuf) +@@ -392,7 +392,7 @@ done: + * rest of the text. + */ + private int +-looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf, ++looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, + size_t *ulen) + { + if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf) +@@ -402,7 +402,7 @@ looks_utf8_with_BOM(const unsigned char *buf, size_t nbytes, unichar *ubuf, + } + + private int +-looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) ++looks_utf7(const unsigned char *buf, size_t nbytes, php_unichar *ubuf, size_t *ulen) + { + if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v') + switch (buf[3]) { +@@ -421,7 +421,7 @@ looks_utf7(const unsigned char *buf, size_t nbytes, unichar *ubuf, size_t *ulen) + } + + private int +-looks_ucs16(const unsigned char *bf, size_t nbytes, unichar *ubf, ++looks_ucs16(const unsigned char *bf, size_t nbytes, php_unichar *ubf, + size_t *ulen) + { + int bigend; +@@ -444,10 +444,10 @@ looks_ucs16(const unsigned char *bf, size_t nbytes, unichar *ubf, + + if (bigend) + ubf[(*ulen)++] = bf[i + 1] +- | (CAST(unichar, bf[i]) << 8); ++ | (CAST(php_unichar, bf[i]) << 8); + else + ubf[(*ulen)++] = bf[i] +- | (CAST(unichar, bf[i + 1]) << 8); ++ | (CAST(php_unichar, bf[i + 1]) << 8); + + if (ubf[*ulen - 1] == 0xfffe) + return 0; +@@ -460,7 +460,7 @@ looks_ucs16(const unsigned char *bf, size_t nbytes, unichar *ubf, + } + + private int +-looks_ucs32(const unsigned char *bf, size_t nbytes, unichar *ubf, ++looks_ucs32(const unsigned char *bf, size_t nbytes, php_unichar *ubf, + size_t *ulen) + { + int bigend; +@@ -482,15 +482,15 @@ looks_ucs32(const unsigned char *bf, size_t nbytes, unichar *ubf, + /* XXX fix to properly handle chars > 65536 */ + + if (bigend) +- ubf[(*ulen)++] = CAST(unichar, bf[i + 3]) +- | (CAST(unichar, bf[i + 2]) << 8) +- | (CAST(unichar, bf[i + 1]) << 16) +- | (CAST(unichar, bf[i]) << 24); ++ ubf[(*ulen)++] = CAST(php_unichar, bf[i + 3]) ++ | (CAST(php_unichar, bf[i + 2]) << 8) ++ | (CAST(php_unichar, bf[i + 1]) << 16) ++ | (CAST(php_unichar, bf[i]) << 24); + else +- ubf[(*ulen)++] = CAST(unichar, bf[i + 0]) +- | (CAST(unichar, bf[i + 1]) << 8) +- | (CAST(unichar, bf[i + 2]) << 16) +- | (CAST(unichar, bf[i + 3]) << 24); ++ ubf[(*ulen)++] = CAST(php_unichar, bf[i + 0]) ++ | (CAST(php_unichar, bf[i + 1]) << 8) ++ | (CAST(php_unichar, bf[i + 2]) << 16) ++ | (CAST(php_unichar, bf[i + 3]) << 24); + + if (ubf[*ulen - 1] == 0xfffe) + return 0; +diff --git a/ext/fileinfo/libmagic/file.h b/ext/fileinfo/libmagic/file.h +index f462622..a0c085a 100644 +--- a/ext/fileinfo/libmagic/file.h ++++ b/ext/fileinfo/libmagic/file.h +@@ -447,7 +447,7 @@ struct magic_set { + }; + + /* Type for Unicode characters */ +-typedef unsigned long unichar; ++typedef unsigned long php_unichar; + + #define FILE_T_LOCAL 1 + #define FILE_T_WINDOWS 2 +@@ -472,9 +472,9 @@ protected int file_zmagic(struct magic_set *, const struct buffer *, + protected int file_ascmagic(struct magic_set *, const struct buffer *, + int); + protected int file_ascmagic_with_encoding(struct magic_set *, +- const struct buffer *, unichar *, size_t, const char *, const char *, int); ++ const struct buffer *, php_unichar *, size_t, const char *, const char *, int); + protected int file_encoding(struct magic_set *, const struct buffer *, +- unichar **, size_t *, const char **, const char **, const char **); ++ php_unichar **, size_t *, const char **, const char **, const char **); + protected int file_is_json(struct magic_set *, const struct buffer *); + protected int file_is_tar(struct magic_set *, const struct buffer *); + protected int file_softmagic(struct magic_set *, const struct buffer *, +@@ -496,7 +496,7 @@ protected size_t file_mbswidth(const char *); + protected const char *file_getbuffer(struct magic_set *); + protected ssize_t sread(int, void *, size_t, int); + protected int file_check_mem(struct magic_set *, unsigned int); +-protected int file_looks_utf8(const unsigned char *, size_t, unichar *, ++protected int file_looks_utf8(const unsigned char *, size_t, php_unichar *, + size_t *); + protected size_t file_pstring_length_size(const struct magic *); + protected size_t file_pstring_get_length(const struct magic *, const char *); +diff --git a/ext/pcre/pcre2lib/sljit/sljitUtils.c b/ext/pcre/pcre2lib/sljit/sljitUtils.c +index 0276fa1..f5e866b 100644 +--- a/ext/pcre/pcre2lib/sljit/sljitUtils.c ++++ b/ext/pcre/pcre2lib/sljit/sljitUtils.c +@@ -389,7 +389,7 @@ SLJIT_API_FUNC_ATTRIBUTE sljit_u8 *SLJIT_FUNC sljit_stack_resize(struct sljit_st + return NULL; + } + } +-#elif defined(MADV_DONTNEED) ++#elif defined(MADV_DONTNEED) && !defined(__HAIKU__) + if (stack->start < new_start) { + page_align = get_page_alignment(); + +diff --git a/ext/standard/microtime.c b/ext/standard/microtime.c +index 9bd45e1..fad5bd4 100644 +--- a/ext/standard/microtime.c ++++ b/ext/standard/microtime.c +@@ -131,7 +131,7 @@ PHP_FUNCTION(getrusage) + #ifdef PHP_WIN32 /* Windows only implements a limited amount of fields from the rusage struct */ + PHP_RUSAGE_PARA(ru_majflt); + PHP_RUSAGE_PARA(ru_maxrss); +-#elif !defined(_OSD_POSIX) ++#elif !defined(_OSD_POSIX) && !defined(__HAIKU__) + PHP_RUSAGE_PARA(ru_oublock); + PHP_RUSAGE_PARA(ru_inblock); + PHP_RUSAGE_PARA(ru_msgsnd); +diff --git a/sapi/phpdbg/phpdbg.c b/sapi/phpdbg/phpdbg.c +index 0f1f036..2351b9c 100644 +--- a/sapi/phpdbg/phpdbg.c ++++ b/sapi/phpdbg/phpdbg.c +@@ -1736,7 +1736,7 @@ phpdbg_main: + exit(0); + } + +-#ifndef _WIN32 ++#if !defined(_WIN32) && !defined(__HAIKU__) + zend_sigaction(SIGIO, &sigio_struct, NULL); + #endif + +-- +2.30.0 + diff --git a/dev-lang/php/php-7.4.16.recipe b/dev-lang/php/php-7.4.16.recipe new file mode 100644 index 000000000..06e354967 --- /dev/null +++ b/dev-lang/php/php-7.4.16.recipe @@ -0,0 +1,141 @@ +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-2020 PHP Group" +LICENSE="PHP License v3.01" +REVISION="2" +SOURCE_URI="https://php.net/get/php-$portVersion.tar.bz2/from/this/mirror" +CHECKSUM_SHA256="85710f007cfd0fae94e13a02a3a036f4e81ef43693260cae8a2e1ca93659ce3e" +SOURCE_FILENAME="php-$portVersion.tar.bz2" +PATCHES="php-$portVersion.patchset" +ADDITIONAL_FILES="userlaunch.in" + +ARCHITECTURES="!x86_gcc2 ?x86 x86_64" +SECONDARY_ARCHITECTURES="x86" + +GLOBAL_WRITABLE_FILES=" + settings/php7 directory keep-old + " + + +commandSuffix=$secondaryArchSuffix +commandBinDir=$binDir +if [ "$targetArchitecture" = x86_gcc2 ]; then + commandSuffix= + commandBinDir=$prefix/bin +fi + +PROVIDES=" + php$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:libicuuc$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libnghttp2$secondaryArchSuffix + lib:libpcre$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:libsqlite3$secondaryArchSuffix + lib:libssl$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libz$secondaryArchSuffix + lib:libwebp$secondaryArchSuffix + lib:libonig$secondaryArchSuffix + " + +BUILD_REQUIRES=" + devel:libbz2$secondaryArchSuffix + devel:libcrypto$secondaryArchSuffix + devel:libcurl$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libicuuc$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libnghttp2$secondaryArchSuffix + devel:libpcre$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix + devel:libsqlite3$secondaryArchSuffix + devel:libssl$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libz$secondaryArchSuffix + devel:libwebp$secondaryArchSuffix + devel:libonig$secondaryArchSuffix + devel:libpq$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + haiku${secondaryArchSuffix}_devel + 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:xargs + cmd:xml2_config$secondaryArchSuffix + " + +BUILD() +{ + autoreconf + autoconf + runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir \ + --sysconfdir=$settingsDir/php7 \ + --with-config-file-path=$settingsDir/php7 \ + --with-config-file-scan-dir=$settingsDir/php7 \ + --with-zlib-dir=`finddir B_SYSTEM_DIRECTORY` --with-zlib=shared \ + --with-openssl \ + --with-curl \ + --disable-opcache \ + --enable-intl \ + --enable-ftp \ + --enable-soap \ + --without-iconv \ + --enable-fpm \ + --enable-gd \ + --with-mysqli \ + --enable-bcmath \ + --enable-mbstring \ + --with-freetype \ + --with-jpeg \ + --with-webp \ + --enable-exif \ + --enable-calendar \ + --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|" \ + $portDir/additional-files/userlaunch.in > $dataDir/user_launch/php-fpm +} + +TEST() +{ + make test +}