From f0e431dd63c64b4f2c0d8c9d346ae3a8a2208652 Mon Sep 17 00:00:00 2001 From: javalaw <739554820@qq.com> Date: Fri, 12 May 2023 09:47:43 +0000 Subject: [PATCH] sodium ext support. --- config/ext.json | 2 +- config/lib.json | 6 ++++++ config/source.json | 8 ++++++++ src/SPC/builder/linux/library/libsodium.php | 12 ++++++++++++ src/SPC/builder/macos/library/libsodium.php | 12 ++++++++++++ src/SPC/builder/unix/library/libsodium.php | 17 +++++++++++++++++ 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 src/SPC/builder/linux/library/libsodium.php create mode 100644 src/SPC/builder/macos/library/libsodium.php create mode 100644 src/SPC/builder/unix/library/libsodium.php diff --git a/config/ext.json b/config/ext.json index 4c6e6062..3c0b1960 100644 --- a/config/ext.json +++ b/config/ext.json @@ -292,7 +292,7 @@ "type": "builtin", "arg-type": "with", "lib-depends": [ - "sodium" + "libsodium" ] }, "sqlite3": { diff --git a/config/lib.json b/config/lib.json index 466763b8..bfe6ec6c 100644 --- a/config/lib.json +++ b/config/lib.json @@ -454,5 +454,11 @@ "zstd.h", "zstd_errors.h" ] + }, + "libsodium": { + "source": "libsodium", + "static-libs-unix": [ + "libsodium.a" + ] } } \ No newline at end of file diff --git a/config/source.json b/config/source.json index f86b51cd..d74fd496 100644 --- a/config/source.json +++ b/config/source.json @@ -411,5 +411,13 @@ "type": "file", "path": "LICENSE" } + }, + "libsodium": { + "type": "url", + "url": "https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz", + "license": { + "type": "file", + "path": "LICENSE" + } } } \ No newline at end of file diff --git a/src/SPC/builder/linux/library/libsodium.php b/src/SPC/builder/linux/library/libsodium.php new file mode 100644 index 00000000..76012bec --- /dev/null +++ b/src/SPC/builder/linux/library/libsodium.php @@ -0,0 +1,12 @@ +cd($this->source_dir) + ->exec("{$this->builder->configure_env} ./configure --enable-static --disable-shared --prefix=") + ->exec('make clean') + ->exec("make -j{$this->builder->concurrency}") + ->exec('make install DESTDIR=' . BUILD_ROOT_PATH); + } +}