From 3c972ac905d552f77885d5c5a66e4111d93ac45f Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 31 Jul 2025 00:55:25 +0800 Subject: [PATCH] Add re2c build --- bin/spc-gnu-docker | 4 ++-- config/lib.json | 6 ++++++ config/source.json | 10 ++++++++++ src/SPC/builder/linux/library/re2c.php | 15 +++++++++++++++ src/SPC/builder/macos/library/re2c.php | 12 ++++++++++++ src/SPC/builder/unix/library/re2c.php | 15 +++++++++++++++ 6 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 src/SPC/builder/linux/library/re2c.php create mode 100644 src/SPC/builder/macos/library/re2c.php create mode 100644 src/SPC/builder/unix/library/re2c.php diff --git a/bin/spc-gnu-docker b/bin/spc-gnu-docker index 0dbe44e8..36b5c951 100755 --- a/bin/spc-gnu-docker +++ b/bin/spc-gnu-docker @@ -129,8 +129,8 @@ RUN curl -o automake.tgz -fsSL https://ftp.gnu.org/gnu/automake/automake-1.17.ta make install && \ ln -sf /usr/local/bin/automake /usr/bin/automake -RUN curl -o re2c.rpm https://archives.fedoraproject.org/pub/archive/epel/7/$SPC_USE_ARCH/Packages/r/re2c-0.14.3-2.el7.$SPC_USE_ARCH.rpm && \ - rpm -Uvh re2c.rpm +RUN bin/spc download re2c && \ + bin/spc build:libs re2c EOF fi diff --git a/config/lib.json b/config/lib.json index 13f886ca..6995f539 100644 --- a/config/lib.json +++ b/config/lib.json @@ -555,6 +555,12 @@ "libuv.a" ] }, + "re2c": { + "source": "re2c", + "bin-unix": [ + "re2c" + ] + }, "libwebp": { "source": "libwebp", "pkg-configs": [ diff --git a/config/source.json b/config/source.json index e49ef0f3..f1aed51d 100644 --- a/config/source.json +++ b/config/source.json @@ -1117,6 +1117,16 @@ "text": "(C) 1995-2022 Jean-loup Gailly and Mark Adler\n\nThis software is provided 'as-is', without any express or implied\nwarranty. In no event will the authors be held liable for any damages\narising from the use of this software.\n\nPermission is granted to anyone to use this software for any purpose,\nincluding commercial applications, and to alter it and redistribute it\nfreely, subject to the following restrictions:\n\n1. The origin of this software must not be misrepresented; you must not\n claim that you wrote the original software. If you use this software\n in a product, an acknowledgment in the product documentation would be\n appreciated but is not required.\n2. Altered source versions must be plainly marked as such, and must not be\n misrepresented as being the original software.\n3. This notice may not be removed or altered from any source distribution.\n\nJean-loup Gailly Mark Adler\njloup@gzip.org madler@alumni.caltech.edu" } }, + "re2c": { + "type": "ghrel", + "repo": "skvadrik/re2c", + "match": "re2c.+\\.tar\\.xz", + "prefer-stable": true, + "license": { + "type": "file", + "path": "LICENSE" + } + }, "zstd": { "type": "ghrel", "repo": "facebook/zstd", diff --git a/src/SPC/builder/linux/library/re2c.php b/src/SPC/builder/linux/library/re2c.php new file mode 100644 index 00000000..91c6ad50 --- /dev/null +++ b/src/SPC/builder/linux/library/re2c.php @@ -0,0 +1,15 @@ +build(); + } +}