Skip to content

Commit

Permalink
Added extensions: lz4, lzf and zstd
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Dec 1, 2022
1 parent c64e92e commit f2d1e41
Show file tree
Hide file tree
Showing 28 changed files with 983 additions and 48 deletions.
139 changes: 124 additions & 15 deletions .ansible/group_vars/all/mods.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ extensions_enabled:
- ioncube
- json
- ldap
- lz4
- lzf
- mcrypt
- memcache
- msgpack
Expand Down Expand Up @@ -66,6 +68,7 @@ extensions_enabled:
- pdo_sqlsrv
- pgsql
- psr
- zstd
- redis
- sqlite3
- sqlsrv
Expand Down Expand Up @@ -475,6 +478,35 @@ extensions_available:
pre: ln -s /usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)/libldap* /usr/lib/
configure: --with-ldap --with-ldap-sasl
build_dep: [libldap2-dev, libsasl2-dev]
lz4:
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
all:
type: git
git_url: https://github.com/kjdev/php-ext-lz4
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
configure: --enable-lz4 --with-lz4-includedir=/usr
build_dep: [liblz4-dev]
run_dep: [liblz4-1]
lzf:
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
all:
type: pecl
build_dep: [liblzf-dev]
run_dep: [liblzf1]
7.2:
type: pecl
build_dep: []
run_dep: []
7.1:
type: pecl
version: 1.6.8
build_dep: []
run_dep: []
7.0:
type: pecl
version: 1.6.8
build_dep: []
run_dep: []
mcrypt:
disabled: [8.1, 8.2]
all:
Expand Down Expand Up @@ -938,60 +970,137 @@ extensions_available:
5.4:
type: pecl
version: 0.5.1
zstd:
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
all:
type: git
git_url: https://github.com/kjdev/php-ext-zstd
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
configure: --enable-zstd --with-libzstd
build_dep: [libzstd-dev]
run_dep: [libzstd1]
7.0:
type: pecl
build_dep: [libzstd-dev]
run_dep: [libzstd1]
redis:
disabled: []
all:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
pre: |
if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
command: |
REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
if php -m | grep -q "igbinary"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
if php -m | grep -q "lz4"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
fi; \
if php -m | grep -q "lzf"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lzf --with-liblzf=/usr"; \
fi; \
if php -m | grep -q "msgpack"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
if php -m | grep -q "zstd"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
8.2:
build_dep:
- liblz4-dev
- liblzf-dev
- libzstd-dev
run_dep:
- liblz4-1
- liblzf1
- libzstd1
7.2:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
command: |
REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
if php -m | grep -q "igbinary"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
if php -m | grep -q "lz4"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
fi; \
if php -m | grep -q "msgpack"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
if php -m | grep -q "zstd"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' library.c \
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' redis_array_impl.c \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
8.1:
build_dep:
- liblz4-dev
- libzstd-dev
run_dep:
- liblz4-1
- libzstd1
7.1:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
command: |
REDIS_ARGS=""; \
if php -m | grep -q "igbinary"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if php -m | grep -q "lz4"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
fi; \
if php -m | grep -q "msgpack"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
if php -m | grep -q "zstd"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
build_dep:
- liblz4-dev
- libzstd-dev
run_dep:
- liblz4-1
- libzstd1
7.0:
type: git
git_url: https://github.com/phpredis/phpredis
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
command: |
REDIS_ARGS=""; \
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
if php -m | grep -q "igbinary"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
fi; \
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
if php -m | grep -q "lz4"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
fi; \
if php -m | grep -q "msgpack"; then \
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
fi; \
phpize \
&& ./configure --enable-redis ${REDIS_ARGS} \
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' library.c \
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' redis_array_impl.c \
&& make -j$(getconf _NPROCESSORS_ONLN) \
&& make install \
build_dep:
- liblz4-dev
run_dep:
- liblz4-1
5.6:
type: pecl
version: 4.3.0
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/mods/Dockerfile-5.2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ RUN set -eux \
libjpeg-dev \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
liblzf-dev \
libmagic-dev \
libmcrypt-dev \
libmemcached-dev \
Expand All @@ -41,6 +43,7 @@ RUN set -eux \
libxpm-dev \
libxslt-dev \
libzip-dev \
libzstd-dev \
snmp \
zlib1g-dev \
# Build tools
Expand Down Expand Up @@ -384,6 +387,11 @@ RUN set -eux \

# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Generic pre-command
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
\
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
Expand Down Expand Up @@ -595,6 +603,8 @@ RUN set -eux \
libfreetype6 \
libicu52 \
libjpeg62-turbo \
liblz4-1 \
liblzf1 \
libmagic1 \
libmcrypt4 \
libmemcachedutil2 \
Expand All @@ -610,6 +620,7 @@ RUN set -eux \
libxpm4 \
libxslt1.1 \
libzip2 \
libzstd1 \
snmp \
ca-certificates \
&& rm -rf /var/lib/apt/lists/* \
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/mods/Dockerfile-5.3
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ RUN set -eux \
libjpeg-dev \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
liblzf-dev \
libmcrypt-dev \
libmemcached-dev \
libmysqlclient-dev \
Expand All @@ -47,6 +49,7 @@ RUN set -eux \
libxslt-dev \
libyaml-dev \
libzip-dev \
libzstd-dev \
re2c \
snmp \
uuid-dev \
Expand Down Expand Up @@ -459,6 +462,11 @@ RUN set -eux \

# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Generic pre-command
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
\
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
Expand Down Expand Up @@ -720,6 +728,8 @@ RUN set -eux \
libfreetype6 \
libicu52 \
libjpeg62-turbo \
liblz4-1 \
liblzf1 \
libmcrypt4 \
libmemcachedutil2 \
libmysqlclient18 \
Expand All @@ -738,6 +748,7 @@ RUN set -eux \
libxslt1.1 \
libyaml-0-2 \
libzip2 \
libzstd1 \
snmp \
uuid \
zlib1g \
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/mods/Dockerfile-5.4
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ RUN set -eux \
libjpeg-dev \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
liblzf-dev \
libmcrypt-dev \
libmemcached-dev \
libmysqlclient-dev \
Expand All @@ -47,6 +49,7 @@ RUN set -eux \
libxslt-dev \
libyaml-dev \
libzip-dev \
libzstd-dev \
re2c \
snmp \
uuid-dev \
Expand Down Expand Up @@ -470,6 +473,11 @@ RUN set -eux \

# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Generic pre-command
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
\
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
Expand Down Expand Up @@ -731,6 +739,8 @@ RUN set -eux \
libfreetype6 \
libicu52 \
libjpeg62-turbo \
liblz4-1 \
liblzf1 \
libmcrypt4 \
libmemcachedutil2 \
libmysqlclient18 \
Expand All @@ -749,6 +759,7 @@ RUN set -eux \
libxslt1.1 \
libyaml-0-2 \
libzip2 \
libzstd1 \
snmp \
uuid \
zlib1g \
Expand Down
11 changes: 11 additions & 0 deletions Dockerfiles/mods/Dockerfile-5.5
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ RUN set -eux \
libjpeg-dev \
libkrb5-dev \
libldap2-dev \
liblz4-dev \
liblzf-dev \
libmagickwand-dev \
libmcrypt-dev \
libmemcached-dev \
Expand All @@ -49,6 +51,7 @@ RUN set -eux \
libxslt-dev \
libyaml-dev \
libzip-dev \
libzstd-dev \
re2c \
snmp \
uuid-dev \
Expand Down Expand Up @@ -508,6 +511,11 @@ RUN set -eux \

# -------------------- Installing PHP Extension: redis --------------------
RUN set -eux \
# Generic pre-command
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
fi \
\
# Installation: Version specific
# Type: PECL extension
# Default: Pecl command
Expand Down Expand Up @@ -770,6 +778,8 @@ RUN set -eux \
libfreetype6 \
libicu52 \
libjpeg62-turbo \
liblz4-1 \
liblzf1 \
libmagickwand-6.q16-2 \
libmcrypt4 \
libmemcachedutil2 \
Expand All @@ -789,6 +799,7 @@ RUN set -eux \
libxslt1.1 \
libyaml-0-2 \
libzip2 \
libzstd1 \
snmp \
uuid \
zlib1g \
Expand Down
Loading

0 comments on commit f2d1e41

Please sign in to comment.