Skip to content

Commit f2d1e41

Browse files
committed
Added extensions: lz4, lzf and zstd
1 parent c64e92e commit f2d1e41

28 files changed

+983
-48
lines changed

.ansible/group_vars/all/mods.yml

Lines changed: 124 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ extensions_enabled:
3838
- ioncube
3939
- json
4040
- ldap
41+
- lz4
42+
- lzf
4143
- mcrypt
4244
- memcache
4345
- msgpack
@@ -66,6 +68,7 @@ extensions_enabled:
6668
- pdo_sqlsrv
6769
- pgsql
6870
- psr
71+
- zstd
6972
- redis
7073
- sqlite3
7174
- sqlsrv
@@ -475,6 +478,35 @@ extensions_available:
475478
pre: ln -s /usr/lib/$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)/libldap* /usr/lib/
476479
configure: --with-ldap --with-ldap-sasl
477480
build_dep: [libldap2-dev, libsasl2-dev]
481+
lz4:
482+
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
483+
all:
484+
type: git
485+
git_url: https://github.com/kjdev/php-ext-lz4
486+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
487+
configure: --enable-lz4 --with-lz4-includedir=/usr
488+
build_dep: [liblz4-dev]
489+
run_dep: [liblz4-1]
490+
lzf:
491+
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
492+
all:
493+
type: pecl
494+
build_dep: [liblzf-dev]
495+
run_dep: [liblzf1]
496+
7.2:
497+
type: pecl
498+
build_dep: []
499+
run_dep: []
500+
7.1:
501+
type: pecl
502+
version: 1.6.8
503+
build_dep: []
504+
run_dep: []
505+
7.0:
506+
type: pecl
507+
version: 1.6.8
508+
build_dep: []
509+
run_dep: []
478510
mcrypt:
479511
disabled: [8.1, 8.2]
480512
all:
@@ -938,60 +970,137 @@ extensions_available:
938970
5.4:
939971
type: pecl
940972
version: 0.5.1
973+
zstd:
974+
disabled: [5.2, 5.3, 5.4, 5.5, 5.6]
975+
all:
976+
type: git
977+
git_url: https://github.com/kjdev/php-ext-zstd
978+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
979+
configure: --enable-zstd --with-libzstd
980+
build_dep: [libzstd-dev]
981+
run_dep: [libzstd1]
982+
7.0:
983+
type: pecl
984+
build_dep: [libzstd-dev]
985+
run_dep: [libzstd1]
941986
redis:
942987
disabled: []
943988
all:
944989
type: git
945990
git_url: https://github.com/phpredis/phpredis
946-
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
991+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
992+
pre: |
993+
if [ -f /usr/include/liblzf/lzf.h ]; then \
994+
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
995+
fi \
947996
command: |
948997
REDIS_ARGS=""; \
949-
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
998+
if php -m | grep -q "igbinary"; then \
950999
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
9511000
fi; \
952-
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
1001+
if php -m | grep -q "lz4"; then \
1002+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
1003+
fi; \
1004+
if php -m | grep -q "lzf"; then \
1005+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lzf --with-liblzf=/usr"; \
1006+
fi; \
1007+
if php -m | grep -q "msgpack"; then \
9531008
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
9541009
fi; \
1010+
if php -m | grep -q "zstd"; then \
1011+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
1012+
fi; \
9551013
phpize \
9561014
&& ./configure --enable-redis ${REDIS_ARGS} \
9571015
&& make -j$(getconf _NPROCESSORS_ONLN) \
9581016
&& make install \
959-
8.2:
1017+
build_dep:
1018+
- liblz4-dev
1019+
- liblzf-dev
1020+
- libzstd-dev
1021+
run_dep:
1022+
- liblz4-1
1023+
- liblzf1
1024+
- libzstd1
1025+
7.2:
9601026
type: git
9611027
git_url: https://github.com/phpredis/phpredis
962-
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
1028+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
9631029
command: |
9641030
REDIS_ARGS=""; \
965-
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
1031+
if php -m | grep -q "igbinary"; then \
9661032
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
9671033
fi; \
968-
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
1034+
if php -m | grep -q "lz4"; then \
1035+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
1036+
fi; \
1037+
if php -m | grep -q "msgpack"; then \
9691038
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
9701039
fi; \
1040+
if php -m | grep -q "zstd"; then \
1041+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
1042+
fi; \
9711043
phpize \
9721044
&& ./configure --enable-redis ${REDIS_ARGS} \
973-
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' library.c \
974-
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' redis_array_impl.c \
9751045
&& make -j$(getconf _NPROCESSORS_ONLN) \
9761046
&& make install \
977-
8.1:
1047+
build_dep:
1048+
- liblz4-dev
1049+
- libzstd-dev
1050+
run_dep:
1051+
- liblz4-1
1052+
- libzstd1
1053+
7.1:
1054+
type: git
1055+
git_url: https://github.com/phpredis/phpredis
1056+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
1057+
command: |
1058+
REDIS_ARGS=""; \
1059+
if php -m | grep -q "igbinary"; then \
1060+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
1061+
fi; \
1062+
if php -m | grep -q "lz4"; then \
1063+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
1064+
fi; \
1065+
if php -m | grep -q "msgpack"; then \
1066+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
1067+
fi; \
1068+
if php -m | grep -q "zstd"; then \
1069+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-zstd"; \
1070+
fi; \
1071+
phpize \
1072+
&& ./configure --enable-redis ${REDIS_ARGS} \
1073+
&& make -j$(getconf _NPROCESSORS_ONLN) \
1074+
&& make install \
1075+
build_dep:
1076+
- liblz4-dev
1077+
- libzstd-dev
1078+
run_dep:
1079+
- liblz4-1
1080+
- libzstd1
1081+
7.0:
9781082
type: git
9791083
git_url: https://github.com/phpredis/phpredis
980-
git_ref: $(git for-each-ref --format='%(refname)' refs/tags | grep -E 'tags/[.0-9]+$' | sed 's|.*tags/||g' | sort -V | tail -1)
1084+
git_ref: $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1)
9811085
command: |
9821086
REDIS_ARGS=""; \
983-
if [ -d "/usr/local/include/php/ext/igbinary" ]; then \
1087+
if php -m | grep -q "igbinary"; then \
9841088
REDIS_ARGS="${REDIS_ARGS} --enable-redis-igbinary"; \
9851089
fi; \
986-
if [ -d "/usr/local/include/php/ext/msgpack" ]; then \
1090+
if php -m | grep -q "lz4"; then \
1091+
REDIS_ARGS="${REDIS_ARGS} --enable-redis-lz4 --with-liblz4=/usr"; \
1092+
fi; \
1093+
if php -m | grep -q "msgpack"; then \
9871094
REDIS_ARGS="${REDIS_ARGS} --enable-redis-msgpack"; \
9881095
fi; \
9891096
phpize \
9901097
&& ./configure --enable-redis ${REDIS_ARGS} \
991-
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' library.c \
992-
&& sed -i'' 's/ops->hash_init(ctx);/ops->hash_init(ctx, NULL);/g' redis_array_impl.c \
9931098
&& make -j$(getconf _NPROCESSORS_ONLN) \
9941099
&& make install \
1100+
build_dep:
1101+
- liblz4-dev
1102+
run_dep:
1103+
- liblz4-1
9951104
5.6:
9961105
type: pecl
9971106
version: 4.3.0

Dockerfiles/mods/Dockerfile-5.2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ RUN set -eux \
2222
libjpeg-dev \
2323
libkrb5-dev \
2424
libldap2-dev \
25+
liblz4-dev \
26+
liblzf-dev \
2527
libmagic-dev \
2628
libmcrypt-dev \
2729
libmemcached-dev \
@@ -41,6 +43,7 @@ RUN set -eux \
4143
libxpm-dev \
4244
libxslt-dev \
4345
libzip-dev \
46+
libzstd-dev \
4447
snmp \
4548
zlib1g-dev \
4649
# Build tools
@@ -384,6 +387,11 @@ RUN set -eux \
384387

385388
# -------------------- Installing PHP Extension: redis --------------------
386389
RUN set -eux \
390+
# Generic pre-command
391+
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
392+
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
393+
fi \
394+
\
387395
# Installation: Version specific
388396
# Type: PECL extension
389397
# Default: Pecl command
@@ -595,6 +603,8 @@ RUN set -eux \
595603
libfreetype6 \
596604
libicu52 \
597605
libjpeg62-turbo \
606+
liblz4-1 \
607+
liblzf1 \
598608
libmagic1 \
599609
libmcrypt4 \
600610
libmemcachedutil2 \
@@ -610,6 +620,7 @@ RUN set -eux \
610620
libxpm4 \
611621
libxslt1.1 \
612622
libzip2 \
623+
libzstd1 \
613624
snmp \
614625
ca-certificates \
615626
&& rm -rf /var/lib/apt/lists/* \

Dockerfiles/mods/Dockerfile-5.3

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN set -eux \
2626
libjpeg-dev \
2727
libkrb5-dev \
2828
libldap2-dev \
29+
liblz4-dev \
30+
liblzf-dev \
2931
libmcrypt-dev \
3032
libmemcached-dev \
3133
libmysqlclient-dev \
@@ -47,6 +49,7 @@ RUN set -eux \
4749
libxslt-dev \
4850
libyaml-dev \
4951
libzip-dev \
52+
libzstd-dev \
5053
re2c \
5154
snmp \
5255
uuid-dev \
@@ -459,6 +462,11 @@ RUN set -eux \
459462

460463
# -------------------- Installing PHP Extension: redis --------------------
461464
RUN set -eux \
465+
# Generic pre-command
466+
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
467+
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
468+
fi \
469+
\
462470
# Installation: Version specific
463471
# Type: PECL extension
464472
# Default: Pecl command
@@ -720,6 +728,8 @@ RUN set -eux \
720728
libfreetype6 \
721729
libicu52 \
722730
libjpeg62-turbo \
731+
liblz4-1 \
732+
liblzf1 \
723733
libmcrypt4 \
724734
libmemcachedutil2 \
725735
libmysqlclient18 \
@@ -738,6 +748,7 @@ RUN set -eux \
738748
libxslt1.1 \
739749
libyaml-0-2 \
740750
libzip2 \
751+
libzstd1 \
741752
snmp \
742753
uuid \
743754
zlib1g \

Dockerfiles/mods/Dockerfile-5.4

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ RUN set -eux \
2626
libjpeg-dev \
2727
libkrb5-dev \
2828
libldap2-dev \
29+
liblz4-dev \
30+
liblzf-dev \
2931
libmcrypt-dev \
3032
libmemcached-dev \
3133
libmysqlclient-dev \
@@ -47,6 +49,7 @@ RUN set -eux \
4749
libxslt-dev \
4850
libyaml-dev \
4951
libzip-dev \
52+
libzstd-dev \
5053
re2c \
5154
snmp \
5255
uuid-dev \
@@ -470,6 +473,11 @@ RUN set -eux \
470473

471474
# -------------------- Installing PHP Extension: redis --------------------
472475
RUN set -eux \
476+
# Generic pre-command
477+
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
478+
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
479+
fi \
480+
\
473481
# Installation: Version specific
474482
# Type: PECL extension
475483
# Default: Pecl command
@@ -731,6 +739,8 @@ RUN set -eux \
731739
libfreetype6 \
732740
libicu52 \
733741
libjpeg62-turbo \
742+
liblz4-1 \
743+
liblzf1 \
734744
libmcrypt4 \
735745
libmemcachedutil2 \
736746
libmysqlclient18 \
@@ -749,6 +759,7 @@ RUN set -eux \
749759
libxslt1.1 \
750760
libyaml-0-2 \
751761
libzip2 \
762+
libzstd1 \
752763
snmp \
753764
uuid \
754765
zlib1g \

Dockerfiles/mods/Dockerfile-5.5

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ RUN set -eux \
2727
libjpeg-dev \
2828
libkrb5-dev \
2929
libldap2-dev \
30+
liblz4-dev \
31+
liblzf-dev \
3032
libmagickwand-dev \
3133
libmcrypt-dev \
3234
libmemcached-dev \
@@ -49,6 +51,7 @@ RUN set -eux \
4951
libxslt-dev \
5052
libyaml-dev \
5153
libzip-dev \
54+
libzstd-dev \
5255
re2c \
5356
snmp \
5457
uuid-dev \
@@ -508,6 +511,11 @@ RUN set -eux \
508511

509512
# -------------------- Installing PHP Extension: redis --------------------
510513
RUN set -eux \
514+
# Generic pre-command
515+
&& if [ -f /usr/include/liblzf/lzf.h ]; then \
516+
ln -s /usr/include/liblzf/lzf.h /usr/include/; \
517+
fi \
518+
\
511519
# Installation: Version specific
512520
# Type: PECL extension
513521
# Default: Pecl command
@@ -770,6 +778,8 @@ RUN set -eux \
770778
libfreetype6 \
771779
libicu52 \
772780
libjpeg62-turbo \
781+
liblz4-1 \
782+
liblzf1 \
773783
libmagickwand-6.q16-2 \
774784
libmcrypt4 \
775785
libmemcachedutil2 \
@@ -789,6 +799,7 @@ RUN set -eux \
789799
libxslt1.1 \
790800
libyaml-0-2 \
791801
libzip2 \
802+
libzstd1 \
792803
snmp \
793804
uuid \
794805
zlib1g \

0 commit comments

Comments
 (0)