From 6c49d35aec7bc53aee7c52041345b2f3b8d1f821 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 26 Aug 2023 23:50:24 +0800 Subject: [PATCH] add libxslt compile command --- config/ext.json | 6 +++- config/lib.json | 10 +++++++ config/source.json | 18 ++++++------ src/SPC/builder/linux/library/libxslt.php | 15 ++++++++++ src/SPC/builder/macos/library/libxslt.php | 15 ++++++++++ src/SPC/builder/unix/library/libxslt.php | 35 +++++++++++++++++++++++ 6 files changed, 89 insertions(+), 10 deletions(-) create mode 100644 src/SPC/builder/linux/library/libxslt.php create mode 100644 src/SPC/builder/macos/library/libxslt.php create mode 100644 src/SPC/builder/unix/library/libxslt.php diff --git a/config/ext.json b/config/ext.json index 67b96622..4cd15da2 100644 --- a/config/ext.json +++ b/config/ext.json @@ -449,9 +449,13 @@ }, "xsl": { "type": "builtin", - "arg-type": "with", + "arg-type": "with-prefix", "lib-depends": [ "libxslt" + ], + "ext-depends": [ + "xml", + "dom" ] }, "yaml": { diff --git a/config/lib.json b/config/lib.json index d07a069a..668e97d9 100644 --- a/config/lib.json +++ b/config/lib.json @@ -293,6 +293,16 @@ "pthreads4w" ] }, + "libxslt": { + "source": "libxslt", + "static-libs-unix": [ + "libxslt.a", + "libexslt.a" + ], + "lib-depends": [ + "libxml2" + ] + }, "libyaml": { "source": "libyaml", "static-libs-unix": [ diff --git a/config/source.json b/config/source.json index b1627f82..8f7eeebe 100644 --- a/config/source.json +++ b/config/source.json @@ -16,15 +16,6 @@ "path": "LICENSE" } }, - "libxslt": { - "type": "filelist", - "url": "https://download.gnome.org/sources/libxslt/1.1/", - "regex": "/href=\"(?libxslt-(?[^\"]+)\\.tar\\.xz)\"/", - "license": { - "type": "text", - "text": "TODO" - } - }, "brotli": { "type": "ghtar", "repo": "google/brotli", @@ -263,6 +254,15 @@ "path": "Copyright" } }, + "libxslt": { + "type": "filelist", + "url": "https://download.gnome.org/sources/libxslt/1.1/", + "regex": "/href=\"(?libxslt-(?[^\"]+)\\.tar\\.xz)\"/", + "license": { + "type": "text", + "text": "TODO" + } + }, "libyaml": { "type": "ghrel", "repo": "yaml/libyaml", diff --git a/src/SPC/builder/linux/library/libxslt.php b/src/SPC/builder/linux/library/libxslt.php new file mode 100644 index 00000000..4bc4a27e --- /dev/null +++ b/src/SPC/builder/linux/library/libxslt.php @@ -0,0 +1,15 @@ +cd($this->source_dir) + ->exec( + "{$this->builder->configure_env} ./configure " . + '--enable-static --disable-shared ' . + '--without-python ' . + '--without-mem-debug ' . + '--without-crypto ' . + '--without-debug ' . + '--without-debugger ' . + '--with-libxml-prefix=' . escapeshellarg(BUILD_ROOT_PATH) . ' ' . + '--prefix=' + ) + ->exec('make clean') + ->exec("make -j{$this->builder->concurrency}") + ->exec('make install DESTDIR=' . escapeshellarg(BUILD_ROOT_PATH)); + $this->patchPkgconfPrefix(['libexslt.pc']); + } +}