Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
169 changes: 151 additions & 18 deletions php.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,178 @@ package:
environment:
contents:
packages:
- build-base
- busybox
- file
- bison
- libtool
- ca-certificates-bundle
- build-base
- bzip2-dev
- libxml2-dev
- curl-dev
- openssl-dev
- readline-dev
- sqlite-dev
- libsodium-dev
- libpng-dev
- libjpeg-dev
- libavif-dev
- libwebp-dev
- libxpm-dev
- libx11-dev
- freetype-dev
- gmp-dev
- icu-dev
- openldap-dev
- oniguruma-dev
- libxslt-dev
- postgresql-15-dev
- zip

pipeline:
- uses: fetch
with:
uri: https://www.php.net/distributions/php-${{package.version}}.tar.gz
expected-sha256: 7046f939f0e5116285341d55c06af1d50907e107ac2c70defc32ef880f88cde4
extract: false

- name: Prepare Build Folder
runs: |
mv php-${{package.version}}.tar.gz $HOME/
tar zxf $HOME/php-${{package.version}}.tar.gz

- name: Configure
runs: |
./configure \
--prefix=${{targets.destdir}} \
cd $HOME/php-${{package.version}}
EXTENSION_DIR=/usr/lib/php/modules ./configure \
--prefix=/usr \
--libdir=/usr/lib/php \
--datadir=/usr/share/php \
--sysconfdir=/etc/php \
--localstatedir=/var \
--with-layout=GNU \
--with-pic \
--with-config-file-path=/etc/php \
--with-config-file-scan-dir=/etc/php/conf.d \
--enable-cli \
--with-curl \
--with-openssl \
--enable-ctype=shared \
--enable-bcmath=shared \
--with-curl=shared \
--enable-dom=shared \
--enable-fileinfo=shared \
--with-iconv=shared \
--with-openssl=shared \
--with-readline \
--with-sodium=shared \
--enable-fpm \
--with-pear \
--enable-gd=shared \
--with-avif \
--with-freetype \
--with-jpeg \
--with-webp \
--with-xpm \
--disable-gd-jis-conv \
--with-libxml \
--enable-phar=shared \
--enable-mbstring=shared \
--with-mysqli=shared \
--with-mysql-sock=/run/mysqld/mysqld.sock \
--enable-mysqlnd=shared \
--enable-pdo=shared \
--with-pdo-mysql=shared,mysqlnd \
--with-pdo-sqlite=shared \
--enable-pcntl=shared \
--enable-sockets=shared \
--with-bz2=shared \
--enable-calendar=shared \
--enable-exif=shared \
--with-gettext=shared \
--with-gmp=shared \
--enable-intl=shared \
--with-ldap=shared \
--enable-opcache=shared \
--enable-soap=shared \
--with-xsl=shared \
--with-zlib \
--with-pdo-mysql \
--with-sodium \
--enable-fpm
--enable-xml=shared \
--enable-simplexml=shared \
--enable-xml=shared \
--enable-xmlreader=shared \
--enable-xmlwriter=shared \
--enable-posix=shared \
--with-pgsql=shared

- uses: autoconf/make
with:
dir: $HOME/php-${{package.version}}

- uses: autoconf/make-install
- name: Make Install
runs: |
cd $HOME/php-${{package.version}}
INSTALL_ROOT=${{targets.destdir}} DESTDIR=${{targets.destdir}} make install

- uses: strip

- name: Copy configuration and set up alias on /bin
runs: |
mkdir -p "${{targets.destdir}}/etc/php/conf.d"
mv $HOME/php-${{package.version}}/php.ini-production ${{targets.destdir}}/etc/php/php.ini
mkdir -p "${{targets.destdir}}/bin" && ln -s /usr/bin/php "${{targets.destdir}}/bin/php"

data:
- name: extensions
items:
bz2: Bzip2
curl: cURL
gd: GD imaging
gmp: GNU GMP support
ldap: LDAP
mysqlnd: MySQLnd
openssl: OpenSSL
pdo_mysql: MySQL driver for PDO
pdo_sqlite: SQLite 3.x driver for PDO
soap: SOAP
sodium: Sodium
calendar: Calendar
exif: EXIF
gettext: GetText
intl: Internationalization
mbstring: Multibyte String Functions
opcache: Opcache
pcntl: pcntl
pdo: PHP Data Objects
phar: PHP Archive
sockets: Sockets
xsl: XSL
bcmath: BC Math
ctype: ctype
iconv: Iconv
dom: DOM
pgsql: PostgreSQL
posix: Posix
simplexml: SimpleXML
mysqli: MySQLi
xml: XML
xmlreader: XMLReader
xmlwriter: XMLWriter
fileinfo: fileinfo

subpackages:
- range: extensions
name: "php-${{range.key}}"
description: "The ${{range.value}} extension"
pipeline:
- runs: |
export EXTENSIONS_DIR=usr/lib/php/modules
export CONF_DIR="${{targets.subpkgdir}}/etc/php/conf.d"
mkdir -p "${{targets.subpkgdir}}"/$EXTENSIONS_DIR $CONF_DIR
mv "${{targets.destdir}}/$EXTENSIONS_DIR/${{range.key}}.so" \
"${{targets.subpkgdir}}/$EXTENSIONS_DIR/${{range.key}}.so"
prefix=
[ "${{range.key}}" != "opcache" ] || prefix="zend_"
echo "${prefix}extension=${{range.key}}.so" > $CONF_DIR/"${{range.key}}.ini"

- name: php-dev
description: PHP 8.2 development headers
pipeline:
Expand All @@ -59,25 +194,23 @@ subpackages:
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/bin/php-cgi ${{targets.subpkgdir}}/usr/bin/
mv ${{targets.destdir}}/usr/bin/php-cgi ${{targets.subpkgdir}}/usr/bin/

- name: php-dbg
description: Interactive PHP Debugger
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/bin/phpdbg ${{targets.subpkgdir}}/usr/bin/
mv ${{targets.destdir}}/usr/bin/phpdbg ${{targets.subpkgdir}}/usr/bin/

- name: php-fpm
description: PHP 8.2 FastCGI Process Manager (FPM)
pipeline:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin
mv ${{targets.destdir}}/sbin/php-fpm ${{targets.subpkgdir}}/usr/bin/
mkdir -p ${{targets.subpkgdir}}/etc/php-fpm.d
mv ${{targets.destdir}}/etc/php-fpm.conf.default ${{targets.subpkgdir}}/etc/php-fpm.conf
sed -i 's/\/home\/build\/melange-out\/php//g' ${{targets.subpkgdir}}/etc/php-fpm.conf
mv ${{targets.destdir}}/etc/php-fpm.d/www.conf.default ${{targets.subpkgdir}}/etc/php-fpm.d/www.conf \
mkdir -p ${{targets.subpkgdir}}/usr/sbin ${{targets.subpkgdir}}/etc/php/php-fpm.d
mv ${{targets.destdir}}/usr/sbin/php-fpm ${{targets.subpkgdir}}/usr/sbin/
mv ${{targets.destdir}}/etc/php/php-fpm.conf.default ${{targets.subpkgdir}}/etc/php/php-fpm.conf
mv ${{targets.destdir}}/etc/php/php-fpm.d/www.conf.default ${{targets.subpkgdir}}/etc/php/php-fpm.d/www.conf \
&& { \
echo '[global]'; \
echo 'error_log = /proc/self/fd/2'; \
Expand All @@ -92,7 +225,7 @@ subpackages:
echo 'catch_workers_output = yes'; \
echo; \
echo 'decorate_workers_output = no'; \
} | tee ${{targets.subpkgdir}}/etc/php-fpm.d/zz-apko.conf
} | tee ${{targets.subpkgdir}}/etc/php/php-fpm.d/zz-apko.conf

update:
enabled: true
Expand Down