314 lines
7.3 KiB
Bash
314 lines
7.3 KiB
Bash
# Template file for 'php'
|
|
pkgname=php
|
|
version=7.2.12
|
|
revision=1
|
|
hostmakedepends="bison pkg-config"
|
|
makedepends="apache-devel enchant-devel freetds-devel freetype-devel gdbm-devel
|
|
gmp-devel libcurl-devel libjpeg-turbo-devel libmysqlclient-devel
|
|
libsodium-devel libtidy5-devel libxslt-devel libzip-devel net-snmp-devel
|
|
postgresql-libs-devel readline-devel sqlite-devel unixodbc-devel"
|
|
short_desc="An HTML-embedded scripting language"
|
|
maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
|
|
license="PHP-3.01"
|
|
homepage="https://www.php.net"
|
|
distfiles="http://www.php.net/distributions/php-${version}.tar.xz"
|
|
checksum=989c04cc879ee71a5e1131db867f3c5102f1f7565f805e2bb8bde33f93147fe1
|
|
conf_files="/etc/php/php.ini"
|
|
|
|
# Needs (probably a lot of) work to make it cross compile
|
|
nocross=https://build.voidlinux.eu/builders/armv7l-musl_builder/builds/16307/steps/shell_3/logs/stdio
|
|
|
|
lib32disabled=yes
|
|
replaces="php-mcrypt<7.2.0"
|
|
|
|
do_build() {
|
|
local _phpconfig="--srcdir=.. \
|
|
--config-cache \
|
|
--prefix=/usr \
|
|
--sbindir=/usr/bin \
|
|
--sysconfdir=/etc/php \
|
|
--localstatedir=/var \
|
|
--with-layout=GNU \
|
|
--with-config-file-path=/etc/php \
|
|
--with-config-file-scan-dir=/etc/php/conf.d \
|
|
--disable-rpath \
|
|
--mandir=/usr/share/man \
|
|
--with-pear=/usr/share/pear \
|
|
"
|
|
|
|
local _phpextensions="--enable-bcmath=shared \
|
|
--enable-calendar=shared \
|
|
--enable-exif=shared \
|
|
--enable-ftp=shared \
|
|
--enable-intl=shared \
|
|
--enable-mbstring \
|
|
--enable-opcache \
|
|
--enable-pcntl \
|
|
--enable-phar=shared \
|
|
--enable-posix=shared \
|
|
--enable-shmop=shared \
|
|
--enable-soap=shared \
|
|
--enable-sockets=shared \
|
|
--enable-sysvmsg=shared \
|
|
--enable-sysvsem=shared \
|
|
--enable-sysvshm=shared \
|
|
--enable-zip=shared \
|
|
--enable-mysqlnd \
|
|
--with-bz2=shared \
|
|
--with-curl=shared \
|
|
--with-db4=/usr \
|
|
--with-enchant=shared,/usr \
|
|
--with-freetype-dir=/usr \
|
|
--with-gd=shared \
|
|
--with-gdbm \
|
|
--with-gettext=shared \
|
|
--with-gmp=shared \
|
|
--with-iconv=shared \
|
|
--with-icu-dir=/usr \
|
|
--with-jpeg-dir=/usr \
|
|
--with-ldap=shared \
|
|
--with-ldap-sasl \
|
|
--with-libzip \
|
|
--with-sodium=shared \
|
|
--with-mhash \
|
|
--with-mysql-sock=/run/mysqld/mysqld.sock \
|
|
--with-mysqli=shared,mysqlnd \
|
|
--with-openssl=shared \
|
|
--with-pcre-regex=/usr \
|
|
--with-pdo-mysql=shared,mysqlnd \
|
|
--with-pdo-odbc=shared,unixODBC,/usr \
|
|
--with-pdo-pgsql=shared \
|
|
--with-pdo-sqlite=shared,/usr \
|
|
--with-pgsql=shared \
|
|
--with-png-dir=/usr \
|
|
--with-readline \
|
|
--with-snmp=shared \
|
|
--with-sqlite3=shared,/usr \
|
|
--with-unixODBC=shared,/usr \
|
|
--with-xmlrpc=shared \
|
|
--with-xsl=shared \
|
|
--with-tidy=shared \
|
|
--with-zlib \
|
|
${configure_args} \
|
|
"
|
|
|
|
EXTENSION_DIR=/usr/lib/php/modules
|
|
export EXTENSION_DIR
|
|
PEAR_INSTALLDIR=/usr/share/pear
|
|
export PEAR_INSTALLDIR
|
|
|
|
# cgi,cli,embed,fcgi,fpm
|
|
mkdir -p build
|
|
cd build
|
|
ln -s ${wrksrc}/configure
|
|
./configure ${_phpconfig} \
|
|
--enable-cgi \
|
|
--enable-fpm \
|
|
--with-fpm-user=http \
|
|
--with-fpm-group=http \
|
|
--enable-embed=shared \
|
|
${_phpextensions}
|
|
make ${makejobs}
|
|
|
|
# apache
|
|
# reuse the previous run; this will save us a lot of time
|
|
cp -a ${wrksrc}/build ${wrksrc}/build-apache
|
|
cd ${wrksrc}/build-apache
|
|
./configure ${_phpconfig} \
|
|
--with-apxs2 \
|
|
${_phpextensions}
|
|
make ${makejobs}
|
|
}
|
|
|
|
do_install() {
|
|
cd ${wrksrc}/build
|
|
make INSTALL_ROOT=${DESTDIR} install-{modules,cli,build,headers,programs,pharcmd}
|
|
|
|
# install php.ini
|
|
vinstall ${wrksrc}/php.ini-production 644 etc/php php.ini
|
|
# remove static modules
|
|
rm -f ${DESTDIR}/usr/lib/php/modules/*.a
|
|
}
|
|
|
|
php-devel_package() {
|
|
short_desc+=" - development files"
|
|
pkg_install() {
|
|
vmove usr/include
|
|
vmove usr/lib/php/build
|
|
vmove usr/bin/php-config
|
|
vmove usr/bin/phpize
|
|
vmove usr/share/man/man1/phpize.1
|
|
vmove usr/share/man/man1/php-config.1
|
|
}
|
|
}
|
|
|
|
php-phpdbg_package() {
|
|
short_desc+=" - interactive debugger"
|
|
depends="php-${version}_${revision}"
|
|
pkg_install() {
|
|
cd ${wrksrc}/build
|
|
make INSTALL_ROOT=${PKGDESTDIR} install-phpdbg
|
|
}
|
|
}
|
|
|
|
php-cgi_package() {
|
|
short_desc+=' - CGI and FCGI SAPI'
|
|
depends="php-${version}_${revision}"
|
|
pkg_install() {
|
|
cd ${wrksrc}/build
|
|
make INSTALL_ROOT=${PKGDESTDIR} install-cgi
|
|
}
|
|
}
|
|
|
|
php-apache_package() {
|
|
short_desc+=' - Apache SAPI'
|
|
depends="php-${version}_${revision}"
|
|
conf_files="/etc/apache/extra/php7_module.conf"
|
|
pkg_install() {
|
|
vinstall ${wrksrc}/build-apache/libs/libphp7.so 755 usr/libexec/httpd/modules
|
|
vinstall ${FILESDIR}/apache.conf 644 etc/apache/extra php7_module.conf
|
|
}
|
|
}
|
|
|
|
php-fpm_package() {
|
|
short_desc+=' - FastCGI Process Manager'
|
|
depends="php-${version}_${revision}"
|
|
conf_files="/etc/php/php-fpm.conf /etc/php/php-fpm.d/*"
|
|
pkg_install() {
|
|
cd ${wrksrc}/build
|
|
make INSTALL_ROOT=${PKGDESTDIR} install-fpm
|
|
vsv php-fpm
|
|
}
|
|
}
|
|
|
|
php-embed_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - Embed SAPI'
|
|
pkg_install() {
|
|
cd ${wrksrc}/build
|
|
make INSTALL_ROOT=${PKGDESTDIR} PHP_SAPI=embed install-sapi
|
|
}
|
|
}
|
|
|
|
php-pear_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - PHP Extension and Application Repository'
|
|
conf_files="/etc/php/pear.conf"
|
|
pkg_install() {
|
|
cd ${wrksrc}/build
|
|
make install-pear INSTALL_ROOT=${PKGDESTDIR}
|
|
rm -rf ${PKGDESTDIR}/.{channels,depdb,depdblock,filemap,lock,registry}
|
|
rm -rf ${PKGDESTDIR}/usr/share/pear/.{channels,depdb,depdblock,filemap,lock,registry}
|
|
}
|
|
}
|
|
|
|
php-enchant_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - enchant module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/enchant.so
|
|
}
|
|
}
|
|
|
|
php-gd_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - gd module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/gd.so
|
|
}
|
|
}
|
|
|
|
php-intl_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - Internationalization module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/intl.so
|
|
}
|
|
}
|
|
|
|
php-ldap_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - LDAP module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/ldap.so
|
|
}
|
|
}
|
|
|
|
php-mysql_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - MySQL modules'
|
|
pkg_install() {
|
|
vmove "usr/lib/php/modules/*mysql*.so"
|
|
}
|
|
}
|
|
|
|
php-odbc_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - ODBC modules'
|
|
pkg_install() {
|
|
vmove "usr/lib/php/modules/*odbc.so"
|
|
}
|
|
}
|
|
|
|
php-pgsql_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - PostgreSQL modules'
|
|
pkg_install() {
|
|
vmove "usr/lib/php/modules/*pgsql.so"
|
|
}
|
|
}
|
|
|
|
php-snmp_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - snmp module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/snmp.so
|
|
}
|
|
}
|
|
|
|
php-sqlite_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - sqlite module'
|
|
pkg_install() {
|
|
vmove "usr/lib/php/modules/*sqlite*.so"
|
|
}
|
|
}
|
|
|
|
php-tidy_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - tidy HTML module'
|
|
pkg_install() {
|
|
vmove "usr/lib/php/modules/*tidy*.so"
|
|
}
|
|
}
|
|
|
|
php-xsl_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - XSL module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/xsl.so
|
|
}
|
|
}
|
|
|
|
php-sodium_package() {
|
|
lib32disabled=yes
|
|
depends="php-${version}_${revision}"
|
|
short_desc+=' - sodium module'
|
|
pkg_install() {
|
|
vmove usr/lib/php/modules/sodium.so
|
|
}
|
|
}
|