diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9b9e64a8..9176fcf0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -143,4 +143,4 @@ jobs: run: bin/spc download --for-extensions="$(php src/globals/test-extensions.php)" --with-php=${{ matrix.php }} --debug - name: "Run Build Tests (build)" - run: bin/spc build "$(php src/globals/test-extensions.php)" --build-cli --build-micro --build-fpm --debug + run: bin/spc build $(php src/globals/test-extensions.php) --build-cli --build-micro --build-fpm --debug diff --git a/config/ext.json b/config/ext.json index 26bb9e94..1dde5bc6 100644 --- a/config/ext.json +++ b/config/ext.json @@ -150,6 +150,10 @@ "icu" ] }, + "igbinary": { + "type": "external", + "source": "igbinary" + }, "ldap": { "type": "builtin", "arg-type": "with-prefix", @@ -331,7 +335,11 @@ "source": "redis", "arg-type": "custom", "ext-suggests": [ - "session" + "session", + "igbinary" + ], + "lib-suggests": [ + "zstd" ] }, "session": { diff --git a/config/lib.json b/config/lib.json index 73c5aee2..7116a115 100644 --- a/config/lib.json +++ b/config/lib.json @@ -224,12 +224,6 @@ "libturbojpeg.a" ] }, - "libmcrypt": { - "source": "libmcrypt", - "static-libs-unix": [ - "libmcrypt.a" - ] - }, "libmemcached": { "source": "libmemcached", "static-libs-unix": [ @@ -368,12 +362,6 @@ "openssl" ] }, - "mcrypt": { - "source": "mcrypt", - "static-libs-unix": [ - "libmcrypt.a" - ] - }, "ncurses": { "source": "ncurses", "static-libs-unix": [ @@ -507,6 +495,12 @@ "libiconv" ] }, + "liblz4": { + "source": "liblz4", + "static-libs-unix": [ + "liblz4.a" + ] + }, "xz": { "source": "xz", "static-libs-unix": [ diff --git a/config/source.json b/config/source.json index 276cb4bd..7738d6b4 100644 --- a/config/source.json +++ b/config/source.json @@ -224,12 +224,13 @@ "path": "LICENSE.md" } }, - "libmcrypt": { - "type": "url", - "url": "https://downloads.sourceforge.net/project/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz", + "liblz4": { + "type": "ghrel", + "repo": "lz4/lz4", + "match": "lz4-.+\\.tar\\.gz", "license": { "type": "file", - "path": "COPYING" + "path": "LICENSE" } }, "libmemcached": { @@ -251,8 +252,9 @@ } }, "libsodium": { - "type": "url", - "url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz", + "type": "ghrel", + "repo": "jedisct1/libsodium", + "match": "libsodium-\\d+(\\.\\d+)*\\.tar\\.gz", "license": { "type": "file", "path": "LICENSE" @@ -310,14 +312,6 @@ "path": "LICENSE" } }, - "mcrypt": { - "type": "url", - "url": "https://downloads.sourceforge.net/project/mcrypt/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz", - "license": { - "type": "file", - "path": "COPYING" - } - }, "memcached": { "type": "url", "url": "https://pecl.php.net/get/memcached", @@ -366,6 +360,16 @@ "path": "COPYING" } }, + "igbinary": { + "type": "url", + "url": "https://pecl.php.net/get/igbinary", + "path": "php-src/ext/igbinary", + "filename": "igbinary.tgz", + "license": { + "type": "file", + "path": "COPYING" + } + }, "onig": { "type": "ghrel", "repo": "kkos/oniguruma", diff --git a/src/SPC/builder/extension/redis.php b/src/SPC/builder/extension/redis.php index ffe50d1d..259a22c4 100644 --- a/src/SPC/builder/extension/redis.php +++ b/src/SPC/builder/extension/redis.php @@ -13,14 +13,14 @@ class redis extends Extension public function getUnixConfigureArg(): string { $arg = '--enable-redis'; - if (!$this->builder->getExt('session')) { - $arg .= ' --disable-redis-session'; - } else { - $arg .= ' --enable-redis-session'; - } + $arg .= $this->builder->getExt('session') ? ' --enable-redis-session' : ' --disable-redis-session'; + $arg .= $this->builder->getExt('igbinary') ? ' --enable-redis-igbinary' : ' --disable-redis-igbinary'; if ($this->builder->getLib('zstd')) { $arg .= ' --enable-redis-zstd --with-libzstd="' . BUILD_ROOT_PATH . '"'; } + if ($this->builder->getLib('liblz4')) { + $arg .= ' --enable-redis-lz4 --with-liblz4="' . BUILD_ROOT_PATH . '"'; + } return $arg; } } diff --git a/src/SPC/builder/linux/library/liblz4.php b/src/SPC/builder/linux/library/liblz4.php new file mode 100644 index 00000000..8015b4e3 --- /dev/null +++ b/src/SPC/builder/linux/library/liblz4.php @@ -0,0 +1,12 @@ +cd($this->source_dir) + ->exec("make PREFIX='' clean") + ->exec("make -j{$this->builder->concurrency} PREFIX=''") + ->exec("make install PREFIX='' DESTDIR=" . BUILD_ROOT_PATH); + + $this->patchPkgconfPrefix(['liblz4.pc']); + + foreach (FileSystem::scanDirFiles(BUILD_ROOT_PATH . '/lib/', false, true) as $filename) { + if (str_starts_with($filename, 'liblz4') && (str_contains($filename, '.so') || str_ends_with($filename, '.dylib'))) { + unlink(BUILD_ROOT_PATH . '/lib/' . $filename); + } + } + } +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index ce05d33e..0ee0701d 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -9,4 +9,7 @@ if (PHP_OS_FAMILY === 'Darwin') { $extensions .= ',sodium'; } +// test redis lz4, igbinary +$extensions .= ',igbinary,zstd --with-libs=liblz4'; + echo $extensions;