1SUMMARY="A popular general-purpose scripting language"
2DESCRIPTION="PHP is a popular general-purpose scripting language that is \
3especially suited to web development.
4Fast, flexible and pragmatic, PHP powers everything from your blog to the most \
5popular websites in the world."
6HOMEPAGE="https://php.net/"
7COPYRIGHT="2001-2022 PHP Group"
8LICENSE="PHP License v3.01"
9REVISION="3"
10SOURCE_URI="https://php.net/get/php-$portVersion.tar.bz2/from/this/mirror"
11CHECKSUM_SHA256="9ebb0e2e571db6fd5930428dcb2d19ed3e050338ec1f1347c282cae92fc086ff"
12SOURCE_FILENAME="php-$portVersion.tar.bz2"
13SOURCE_DIR="php-$portVersion"
14PATCHES="php8-$portVersion.patchset"
15ADDITIONAL_FILES="userlaunch.in"
16
17ARCHITECTURES="all !x86_gcc2"
18SECONDARY_ARCHITECTURES="x86"
19
20GLOBAL_WRITABLE_FILES="
21        settings/php8 directory keep-old
22        "
23
24commandSuffix=$secondaryArchSuffix
25commandBinDir=$binDir
26if [ "$targetArchitecture" = x86_gcc2 ]; then
27	commandSuffix=
28	commandBinDir=$prefix/bin
29fi
30
31PROVIDES="
32	php8$secondaryArchSuffix = $portVersion
33	cmd:pear
34	cmd:peardev
35	cmd:pecl
36	cmd:phar
37	cmd:phar.phar
38	cmd:php
39	cmd:phpdbg
40	cmd:php_cgi
41	cmd:php_config
42	cmd:phpize
43	cmd:php_fpm
44	"
45REQUIRES="
46	haiku$secondaryArchSuffix
47	lib:libbz2$secondaryArchSuffix
48	lib:libcrypto$secondaryArchSuffix
49	lib:libcurl$secondaryArchSuffix
50	lib:libfreetype$secondaryArchSuffix
51	lib:libgettextpo$secondaryArchSuffix
52	lib:libgd$secondaryArchSuffix
53	lib:libicuuc$secondaryArchSuffix
54	lib:libintl$secondaryArchSuffix
55	lib:libjpeg$secondaryArchSuffix
56	lib:libnghttp2$secondaryArchSuffix
57	lib:libonig$secondaryArchSuffix
58	lib:libpcre2_8$secondaryArchSuffix
59	lib:libpng16$secondaryArchSuffix
60	lib:libreadline$secondaryArchSuffix
61	lib:libsqlite3$secondaryArchSuffix
62	lib:libssl$secondaryArchSuffix
63	lib:libwebp$secondaryArchSuffix
64	lib:libxml2$secondaryArchSuffix
65	lib:libz$secondaryArchSuffix
66	lib:libzip$secondaryArchSuffix
67	"
68CONFLICTS="
69	php$secondaryArchSuffix
70	"
71
72BUILD_REQUIRES="
73	haiku${secondaryArchSuffix}_devel
74	devel:libbz2$secondaryArchSuffix
75	devel:libcrypto$secondaryArchSuffix
76	devel:libcurl$secondaryArchSuffix
77	devel:libfreetype$secondaryArchSuffix
78	devel:libgettextlib$secondaryArchSuffix
79	devel:libgd$secondaryArchSuffix
80	devel:libicuuc$secondaryArchSuffix
81	devel:libintl$secondaryArchSuffix
82	devel:libjpeg$secondaryArchSuffix
83	devel:libnghttp2$secondaryArchSuffix
84	devel:libonig$secondaryArchSuffix
85	devel:libpcre2_8$secondaryArchSuffix
86	devel:libpng16$secondaryArchSuffix
87	devel:libpq$secondaryArchSuffix
88	devel:libreadline$secondaryArchSuffix >= 8
89	devel:libsqlite3$secondaryArchSuffix
90	devel:libssl$secondaryArchSuffix
91	devel:libwebp$secondaryArchSuffix
92	devel:libxml2$secondaryArchSuffix
93	devel:libz$secondaryArchSuffix
94	devel:libzip$secondaryArchSuffix
95	"
96BUILD_PREREQUIRES="
97	cmd:aclocal
98	cmd:autoreconf
99	cmd:awk
100	cmd:bison
101	cmd:gcc$secondaryArchSuffix
102	cmd:icu_config$secondaryArchSuffix
103	cmd:make
104	cmd:pkg_config$secondaryArchSuffix
105	cmd:sed
106	cmd:xargs
107	cmd:xml2_config$secondaryArchSuffix
108	"
109
110BUILD()
111{
112	./buildconf -f
113	runConfigure --omit-dirs "binDir sbinDir" ./configure \
114		--bindir=$commandBinDir \
115		--sbindir=$commandBinDir \
116		--sysconfdir=$settingsDir/php8 \
117		--with-config-file-path=$settingsDir/php8 \
118		--with-config-file-scan-dir=$settingsDir/php8 \
119		--with-zip \
120		--with-zlib-dir=`finddir B_SYSTEM_DIRECTORY` --with-zlib \
121		--with-bz2=`finddir B_SYSTEM_DIRECTORY` \
122		--with-readline=`finddir B_SYSTEM_DIRECTORY` \
123		--with-openssl \
124		--with-curl \
125		--disable-opcache \
126		--enable-intl \
127		--with-gettext=`finddir B_SYSTEM_DIRECTORY` \
128		--enable-ftp \
129		--enable-soap \
130		--without-iconv \
131		--enable-fpm \
132		--enable-gd \
133		--with-external-gd \
134		--with-mysqli \
135		--enable-bcmath \
136		--enable-mbstring \
137		--with-freetype \
138		--with-jpeg \
139		--with-webp \
140		--with-external-pcre \
141		--enable-exif \
142		--enable-calendar \
143		--enable-pcntl \
144		--enable-sockets \
145		--disable-debug
146	make $jobArgs
147}
148
149INSTALL()
150{
151	make install
152	rm -rf $libDir/build # Only garbage is installed here.
153	mkdir -p $dataDir/user_launch
154	sed \
155		-e "s|@APP@|php-fpm|" \
156		-e "s|@BIN@|"$binDir"/php-fpm|" \
157		-e "s|php7|php8|" \
158		$portDir/additional-files/userlaunch.in > $dataDir/user_launch/php-fpm
159}
160
161TEST()
162{
163	make test
164}
165