summaryrefslogtreecommitdiff
path: root/Ports
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-06-04 01:59:23 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-04 10:39:41 +0200
commit280785f0fa47d07edd7bfe386a1afd712691f5a0 (patch)
tree6824d09245859d970a62af8c918ae8b0489b20f3 /Ports
parente483de93cef8651cb41a8b9bf7fbccfb25787774 (diff)
downloadserenity-280785f0fa47d07edd7bfe386a1afd712691f5a0.zip
Ports: Add PHP
Diffstat (limited to 'Ports')
-rw-r--r--Ports/AvailablePorts.md1
-rwxr-xr-xPorts/php/package.sh23
-rw-r--r--Ports/php/patches/config.sub.patch11
-rw-r--r--Ports/php/patches/configure.patch11
-rw-r--r--Ports/php/patches/php_fopen_wrapper.c.patch11
-rw-r--r--Ports/php/patches/php_network.h.patch10
6 files changed, 67 insertions, 0 deletions
diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md
index 43bde42d91..f73d03cb3f 100644
--- a/Ports/AvailablePorts.md
+++ b/Ports/AvailablePorts.md
@@ -100,6 +100,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^
| [`patch`](patch/) | patch (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy |
| [`pcre`](pcre/) | Perl-compatible Regular Expressions (PCRE) | 8.44 | https://www.pcre.org/ |
| [`pcre2`](pcre2/) | Perl-compatible Regular Expressions (PCRE2) | 10.34 | https://www.pcre.org/ |
+| [`php`](php/) | PHP | 8.0.6 | https://www.php.net/ |
| [`pkgconf`](pkgconf/) | pkgconf | 1.7.3 | https://github.com/pkgconf/pkgconf |
| [`SDLPoP`](SDLPoP/) | Prince of Persia game | | https://github.com/NagyD/SDLPoP |
| [`printf`](printf/) | printf (OpenBSD) | 6.6 | https://github.com/ibara/libpuffy |
diff --git a/Ports/php/package.sh b/Ports/php/package.sh
new file mode 100755
index 0000000000..167c49bde1
--- /dev/null
+++ b/Ports/php/package.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env -S bash ../.port_include.sh
+port=php
+useconfigure="true"
+version="8.0.6"
+files="https://www.php.net/distributions/php-${version}.tar.xz php-${version}.tar.xz e9871d3b6c391fe9e89f86f6334852dcc10eeaaa8d5565beb8436e7f0cf30e20"
+auth_type=sha256
+depends=""
+configopts="
+ --disable-dom
+ --disable-opcache
+ --disable-phar
+ --disable-simplexml
+ --disable-xml
+ --disable-xmlreader
+ --disable-xmlwriter
+ --prefix=${SERENITY_INSTALL_ROOT}/usr/local
+ --without-iconv
+ --without-libxml
+ --without-pdo-sqlite
+ --without-sqlite3
+"
+
+export LIBS="-ldl"
diff --git a/Ports/php/patches/config.sub.patch b/Ports/php/patches/config.sub.patch
new file mode 100644
index 0000000000..c349198426
--- /dev/null
+++ b/Ports/php/patches/config.sub.patch
@@ -0,0 +1,11 @@
+--- php-8.0.6/build/config.sub 2021-05-04 19:26:18.000000000 +0200
++++ php-8.0.6-patched/build/config.sub 2021-06-03 22:49:12.463974784 +0200
+@@ -1366,7 +1366,7 @@
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+- | nsk* | powerunix)
++ | nsk* | powerunix | serenity*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ qnx*)
diff --git a/Ports/php/patches/configure.patch b/Ports/php/patches/configure.patch
new file mode 100644
index 0000000000..92052c2791
--- /dev/null
+++ b/Ports/php/patches/configure.patch
@@ -0,0 +1,11 @@
+--- php-8.0.6/configure 2021-05-04 19:26:18.000000000 +0200
++++ php-8.0.6-patched/configure 2021-06-03 23:48:41.087223727 +0200
+@@ -13587,7 +13587,7 @@
+ if test "x$ac_cv_func___inet_aton" = xyes; then :
+ found=yes
+ else
+- found=no
++ found=yes
+ fi
+
+ fi
diff --git a/Ports/php/patches/php_fopen_wrapper.c.patch b/Ports/php/patches/php_fopen_wrapper.c.patch
new file mode 100644
index 0000000000..ee75892f6d
--- /dev/null
+++ b/Ports/php/patches/php_fopen_wrapper.c.patch
@@ -0,0 +1,11 @@
+--- php-8.0.6/ext/standard/php_fopen_wrapper.c 2021-05-04 19:26:18.000000000 +0200
++++ php-8.0.6-patched/ext/standard/php_fopen_wrapper.c 2021-06-04 01:04:07.104126109 +0200
+@@ -317,7 +317,7 @@
+ return NULL;
+ }
+
+-#if HAVE_UNISTD_H
++#if !HAVE_UNISTD_H
+ dtablesize = getdtablesize();
+ #else
+ dtablesize = INT_MAX;
diff --git a/Ports/php/patches/php_network.h.patch b/Ports/php/patches/php_network.h.patch
new file mode 100644
index 0000000000..15a3324b96
--- /dev/null
+++ b/Ports/php/patches/php_network.h.patch
@@ -0,0 +1,10 @@
+--- php-8.0.6/main/php_network.h 2021-05-04 19:26:18.000000000 +0200
++++ php-8.0.6-patched/main/php_network.h 2021-06-04 01:54:05.976580933 +0200
+@@ -63,6 +63,7 @@
+ PHPAPI zend_string *php_socket_error_str(long err);
+ END_EXTERN_C()
+
++#include <arpa/inet.h>
+ #ifdef HAVE_NETINET_IN_H
+ # include <netinet/in.h>
+ #endif