linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 86b4b3abb64b5a0c90018e0f133e4446c7c98d8d
parent 72505ceb37e184eb2c9f79ffe36eb6c4cffca318
Author: Jul <jul@9o.is>
Date:   Tue,  7 Oct 2025 12:06:59 +0800

add ag (dep: pcre)

Diffstat:
Mgen.sh | 2++
Dpkg/ag/build | 34----------------------------------
Mpkg/ag/config.h | 90++++---------------------------------------------------------------------------
Apkg/ag/gen.sh | 33+++++++++++++++++++++++++++++++++
Apkg/ag/patch/0001-set-color-in-config.h.patch | 29+++++++++++++++++++++++++++++
Apkg/ag/patch/0002-Remove-after-function-definition.patch | 26++++++++++++++++++++++++++
Apkg/ag/patch/0003-Use-inline-function-for-min-instead-of-statement-exp.patch | 33+++++++++++++++++++++++++++++++++
Apkg/ag/patch/0004-Prevent-duplicate-definitions-of-global-variables.patch | 209+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Dpkg/ag/patches/0001-set-color-in-config.h.patch | 29-----------------------------
Apkg/pcre/config.h | 83+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apkg/pcre/gen.sh | 47+++++++++++++++++++++++++++++++++++++++++++++++
11 files changed, 466 insertions(+), 149 deletions(-)

diff --git a/gen.sh b/gen.sh @@ -18,6 +18,7 @@ setv ldflags $TARGET_LDFLAGS include $basedir/ninja/rules.ninja subgen pkg/abduco +subgen pkg/ag subgen pkg/awk subgen pkg/b3sum subgen pkg/bestline @@ -36,6 +37,7 @@ subgen pkg/mandoc subgen pkg/netbsd-curses subgen pkg/oksh subgen pkg/pax +subgen pkg/pcre subgen pkg/perp subgen pkg/probe # subgen pkg/qubes-core-qrexec diff --git a/pkg/ag/build b/pkg/ag/build @@ -1,34 +0,0 @@ -#!/bin/sh -set -euo pipefail - -# required: -# - automake -# - pcre-devel - -gitref="a61f178" -repodir="$srcdir/repo" - -if [ "$skip_clean" != "true" ]; then - git -C "$repodir" clean -dx - git -C "$repodir" reset --hard "$gitref" - - for patch in $srcdir/patches/*.patch; do - git -C "$repodir" am --no-gpg-sign "$patch" - done -fi - -( - cd $repodir - ./autogen.sh - ./configure --prefix=/usr -) - -rm -rf "$outdir" -cp "$srcdir/config.h" "$repodir/src/config.h" - -make -C "$repodir" -make DESTDIR="$outdir" -C "$repodir" install - -if [ "$local_install" == "true" ]; then - sudo make -C "$repodir" install -fi diff --git a/pkg/ag/config.h b/pkg/ag/config.h @@ -1,124 +1,42 @@ #define COLOR_LINE_NUMBER "\033[0m" /* default */ #define COLOR_MATCH "\033[30;43m" /* black with yellow background */ #define COLOR_PATH "\033[0;34m" /* blue */ - -/* Have dirent struct member d_namlen */ /* #undef HAVE_DIRENT_DNAMLEN */ - -/* Have dirent struct member d_type */ #define HAVE_DIRENT_DTYPE /**/ - -/* Define to 1 if you have the <err.h> header file. */ #define HAVE_ERR_H 1 - -/* Define to 1 if you have the 'fgetln' function. */ -/* #undef HAVE_FGETLN */ - -/* Define to 1 if you have the 'fopencookie' function. */ -#define HAVE_FOPENCOOKIE 1 - -/* Define to 1 if you have the 'getline' function. */ +#define HAVE_FGETLN 1 +/* #undef HAVE_FOPENCOOKIE */ #define HAVE_GETLINE 1 - -/* Define to 1 if you have the <inttypes.h> header file. */ #define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the 'shlwapi' library (-lshlwapi). */ /* #undef HAVE_LIBSHLWAPI */ - -/* Define to 1 if you have the <lzma.h> header file. */ -#define HAVE_LZMA_H 1 - -/* Define to 1 if you have the 'madvise' function. */ +/* #undef HAVE_LZMA_H */ #define HAVE_MADVISE 1 - -/* Define to 1 if you have the 'pledge' function. */ +#define HAVE_MEMORY_H 1 /* #undef HAVE_PLEDGE */ - -/* Define to 1 if you have the 'posix_fadvise' function. */ #define HAVE_POSIX_FADVISE 1 - -/* Define to 1 if you have the <pthread.h> header file. */ #define HAVE_PTHREAD_H 1 - -/* Have PTHREAD_PRIO_INHERIT. */ #define HAVE_PTHREAD_PRIO_INHERIT 1 - -/* Define to 1 if you have the 'pthread_setaffinity_np' function. */ #define HAVE_PTHREAD_SETAFFINITY_NP 1 - -/* Define to 1 if you have the 'realpath' function. */ #define HAVE_REALPATH 1 - -/* Define to 1 if you have the <stdint.h> header file. */ #define HAVE_STDINT_H 1 - -/* Define to 1 if you have the <stdio.h> header file. */ -#define HAVE_STDIO_H 1 - -/* Define to 1 if you have the <stdlib.h> header file. */ #define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the <strings.h> header file. */ #define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the <string.h> header file. */ #define HAVE_STRING_H 1 - -/* Define to 1 if you have the 'strlcpy' function. */ #define HAVE_STRLCPY 1 - -/* Define to 1 if you have the 'strndup' function. */ #define HAVE_STRNDUP 1 - -/* Define to 1 if you have the <sys/cpuset.h> header file. */ /* #undef HAVE_SYS_CPUSET_H */ - -/* Define to 1 if you have the <sys/stat.h> header file. */ #define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the <sys/types.h> header file. */ #define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the <unistd.h> header file. */ #define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the 'vasprintf' function. */ #define HAVE_VASPRINTF 1 - -/* Define to 1 if you have the <zlib.h> header file. */ #define HAVE_ZLIB_H 1 - -/* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "https://github.com/ggreer/the_silver_searcher/issues" - -/* Define to the full name of this package. */ #define PACKAGE_NAME "the_silver_searcher" - -/* Define to the full name and version of this package. */ #define PACKAGE_STRING "the_silver_searcher 2.2.0" - -/* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "the_silver_searcher" - -/* Define to the home page for this package. */ #define PACKAGE_URL "https://github.com/ggreer/the_silver_searcher" - -/* Define to the version of this package. */ #define PACKAGE_VERSION "2.2.0" - -/* Define to necessary symbol if this constant uses a non-standard name on - your system. */ /* #undef PTHREAD_CREATE_JOINABLE */ - -/* Define to 1 if all of the C89 standard headers exist (not just the ones - required in a freestanding environment). This macro is provided for - backward compatibility; new code need not use it. */ #define STDC_HEADERS 1 - -/* Use CPU_SET macros */ #define USE_CPU_SET /**/ - -/* Use PCRE JIT */ #define USE_PCRE_JIT /**/ - diff --git a/pkg/ag/gen.sh b/pkg/ag/gen.sh @@ -0,0 +1,33 @@ +fetch git + +cflags " + -D _GNU_SOURCE + -I $dir + -isystem $pkgdir/pcre/include + -isystem $pkgdir/zlib/include + -Wno-pedantic +" + +dep " + pcre/headers + zlib/headers +" + +exe ag " + src/ignore.c + src/log.c + src/options.c + src/print.c + src/print_w32.c + src/scandir.c + src/search.c + src/lang.c + src/util.c + src/decompress.c + src/main.c + $pkgdir/pcre/libpcre.a + $pkgdir/zlib/libz.a +" + +bin ag +man doc/ag.1 diff --git a/pkg/ag/patch/0001-set-color-in-config.h.patch b/pkg/ag/patch/0001-set-color-in-config.h.patch @@ -0,0 +1,29 @@ +From 796adcd966d4ba5852c92bf5872f5b3593c541b9 Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Tue, 7 Oct 2025 12:02:05 +0800 +Subject: [PATCH] set color in config.h + +--- + src/options.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/options.c b/src/options.c +index e63985e..2163f48 100644 +--- a/src/options.c ++++ b/src/options.c +@@ -16,9 +16,9 @@ + #include "print.h" + #include "util.h" + +-const char *color_line_number = "\033[1;33m"; /* bold yellow */ +-const char *color_match = "\033[30;43m"; /* black with yellow background */ +-const char *color_path = "\033[1;32m"; /* bold green */ ++const char *color_line_number = COLOR_LINE_NUMBER; ++const char *color_match = COLOR_MATCH; ++const char *color_path = COLOR_PATH; + + /* TODO: try to obey out_fd? */ + void usage(void) { +-- +2.51.0 + diff --git a/pkg/ag/patch/0002-Remove-after-function-definition.patch b/pkg/ag/patch/0002-Remove-after-function-definition.patch @@ -0,0 +1,26 @@ +From 76adb32c89184406278fd51a3fe138314b134a12 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 15 Jun 2019 20:58:00 -0700 +Subject: [PATCH] Remove `;` after function definition +Upstream: https://github.com/ggreer/the_silver_searcher/pull/1324 + +--- + src/ignore.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/ignore.c b/src/ignore.c +index fa41889..bdb03b4 100644 +--- a/src/ignore.c ++++ b/src/ignore.c +@@ -39,7 +39,7 @@ const char *ignore_pattern_files[] = { + + int is_empty(ignores *ig) { + return (ig->extensions_len + ig->names_len + ig->slash_names_len + ig->regexes_len + ig->slash_regexes_len == 0); +-}; ++} + + ignores *init_ignore(ignores *parent, const char *dirname, const size_t dirname_len) { + ignores *ig = ag_malloc(sizeof(ignores)); +-- +2.20.1 + diff --git a/pkg/ag/patch/0003-Use-inline-function-for-min-instead-of-statement-exp.patch b/pkg/ag/patch/0003-Use-inline-function-for-min-instead-of-statement-exp.patch @@ -0,0 +1,33 @@ +From dc1be161f9155e92367714b38f6a45d05d4f90cd Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sat, 15 Jun 2019 20:58:46 -0700 +Subject: [PATCH] Use inline function for min instead of statement expression +Upstream: https://github.com/ggreer/the_silver_searcher/pull/1324 + +--- + src/zfile.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/zfile.c b/src/zfile.c +index e4b7566..29fbb07 100644 +--- a/src/zfile.c ++++ b/src/zfile.c +@@ -33,10 +33,11 @@ typedef _off64_t off64_t; + + #if HAVE_FOPENCOOKIE + +-#define min(a, b) ({ \ +- __typeof (a) _a = (a); \ +- __typeof (b) _b = (b); \ +- _a < _b ? _a : _b; }) ++static inline size_t ++min(size_t a, size_t b) ++{ ++ return a < b ? a : b; ++} + + static cookie_read_function_t zfile_read; + static cookie_seek_function_t zfile_seek; +-- +2.20.1 + diff --git a/pkg/ag/patch/0004-Prevent-duplicate-definitions-of-global-variables.patch b/pkg/ag/patch/0004-Prevent-duplicate-definitions-of-global-variables.patch @@ -0,0 +1,209 @@ +From e6434d0e9ba93efb8147bb5e2128b5f910ab70e0 Mon Sep 17 00:00:00 2001 +From: Michael Forney <mforney@mforney.org> +Date: Sun, 16 Jun 2019 01:49:32 -0700 +Subject: [PATCH] Prevent duplicate definitions of global variables + +Multiple external definitions of an object is invalid in ISO C[0]. + +These are visible when linking with -Wl,--warn-common. + +[0] http://port70.net/~nsz/c/c11/n1570.html#6.9p5 +--- + src/ignore.c | 2 ++ + src/ignore.h | 2 +- + src/log.c | 2 ++ + src/log.h | 2 +- + src/options.c | 2 ++ + src/options.h | 2 +- + src/search.c | 13 +++++++++++++ + src/search.h | 20 ++++++++++---------- + src/util.c | 3 +++ + src/util.h | 4 ++-- + 10 files changed, 37 insertions(+), 15 deletions(-) + +diff --git a/src/ignore.c b/src/ignore.c +index bdb03b4..56c102a 100644 +--- a/src/ignore.c ++++ b/src/ignore.c +@@ -22,6 +22,8 @@ const int fnmatch_flags = FNM_PATHNAME; + + /* TODO: build a huge-ass list of files we want to ignore by default (build cache stuff, pyc files, etc) */ + ++ignores *root_ignores; ++ + const char *evil_hardcoded_ignore_files[] = { + ".", + "..", +diff --git a/src/ignore.h b/src/ignore.h +index 20d5a6a..8db0f37 100644 +--- a/src/ignore.h ++++ b/src/ignore.h +@@ -29,7 +29,7 @@ struct ignores { + }; + typedef struct ignores ignores; + +-ignores *root_ignores; ++extern ignores *root_ignores; + + extern const char *evil_hardcoded_ignore_files[]; + extern const char *ignore_pattern_files[]; +diff --git a/src/log.c b/src/log.c +index 1481b6d..aef0b54 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -4,6 +4,8 @@ + #include "log.h" + #include "util.h" + ++pthread_mutex_t print_mtx; ++ + static enum log_level log_threshold = LOG_LEVEL_ERR; + + void set_log_level(enum log_level threshold) { +diff --git a/src/log.h b/src/log.h +index 85847ee..318622c 100644 +--- a/src/log.h ++++ b/src/log.h +@@ -9,7 +9,7 @@ + #include <pthread.h> + #endif + +-pthread_mutex_t print_mtx; ++extern pthread_mutex_t print_mtx; + + enum log_level { + LOG_LEVEL_DEBUG = 10, +diff --git a/src/options.c b/src/options.c +index 2163f48..cd9ef9c 100644 +--- a/src/options.c ++++ b/src/options.c +@@ -16,6 +16,8 @@ + #include "print.h" + #include "util.h" + ++cli_options opts; ++ + const char *color_line_number = COLOR_LINE_NUMBER; + const char *color_match = COLOR_MATCH; + const char *color_path = COLOR_PATH; +diff --git a/src/options.h b/src/options.h +index db3e896..fd7d1f0 100644 +--- a/src/options.h ++++ b/src/options.h +@@ -91,7 +91,7 @@ typedef struct { + } cli_options; + + /* global options. parse_options gives it sane values, everything else reads from it */ +-cli_options opts; ++extern cli_options opts; + + typedef struct option option_t; + +diff --git a/src/search.c b/src/search.c +index ff5e386..2245818 100644 +--- a/src/search.c ++++ b/src/search.c +@@ -2,6 +2,19 @@ + #include "print.h" + #include "scandir.h" + ++size_t alpha_skip_lookup[256]; ++size_t *find_skip_lookup; ++uint8_t h_table[H_SIZE] __attribute__((aligned(64))); ++ ++work_queue_t *work_queue; ++work_queue_t *work_queue_tail; ++int done_adding_files; ++pthread_cond_t files_ready; ++pthread_mutex_t stats_mtx; ++pthread_mutex_t work_queue_mtx; ++ ++symdir_t *symhash; ++ + void search_buf(const char *buf, const size_t buf_len, + const char *dir_full_path) { + int binary = -1; /* 1 = yes, 0 = no, -1 = don't know */ +diff --git a/src/search.h b/src/search.h +index 1071114..a1bc5d7 100644 +--- a/src/search.h ++++ b/src/search.h +@@ -31,9 +31,9 @@ + #include "uthash.h" + #include "util.h" + +-size_t alpha_skip_lookup[256]; +-size_t *find_skip_lookup; +-uint8_t h_table[H_SIZE] __attribute__((aligned(64))); ++extern size_t alpha_skip_lookup[256]; ++extern size_t *find_skip_lookup; ++extern uint8_t h_table[H_SIZE] __attribute__((aligned(64))); + + struct work_queue_t { + char *path; +@@ -41,12 +41,12 @@ struct work_queue_t { + }; + typedef struct work_queue_t work_queue_t; + +-work_queue_t *work_queue; +-work_queue_t *work_queue_tail; +-int done_adding_files; +-pthread_cond_t files_ready; +-pthread_mutex_t stats_mtx; +-pthread_mutex_t work_queue_mtx; ++extern work_queue_t *work_queue; ++extern work_queue_t *work_queue_tail; ++extern int done_adding_files; ++extern pthread_cond_t files_ready; ++extern pthread_mutex_t stats_mtx; ++extern pthread_mutex_t work_queue_mtx; + + + /* For symlink loop detection */ +@@ -64,7 +64,7 @@ typedef struct { + UT_hash_handle hh; + } symdir_t; + +-symdir_t *symhash; ++extern symdir_t *symhash; + + void search_buf(const char *buf, const size_t buf_len, + const char *dir_full_path); +diff --git a/src/util.c b/src/util.c +index cb23914..103be46 100644 +--- a/src/util.c ++++ b/src/util.c +@@ -21,6 +21,9 @@ + } \ + return ptr; + ++FILE *out_fd; ++ag_stats stats; ++ + void *ag_malloc(size_t size) { + void *ptr = malloc(size); + CHECK_AND_RETURN(ptr) +diff --git a/src/util.h b/src/util.h +index 0c9b9b1..338b05f 100644 +--- a/src/util.h ++++ b/src/util.h +@@ -12,7 +12,7 @@ + #include "log.h" + #include "options.h" + +-FILE *out_fd; ++extern FILE *out_fd; + + #ifndef TRUE + #define TRUE 1 +@@ -51,7 +51,7 @@ typedef struct { + } ag_stats; + + +-ag_stats stats; ++extern ag_stats stats; + + /* Union to translate between chars and words without violating strict aliasing */ + typedef union { +-- +2.51.0 + diff --git a/pkg/ag/patches/0001-set-color-in-config.h.patch b/pkg/ag/patches/0001-set-color-in-config.h.patch @@ -1,29 +0,0 @@ -From bd382cfaf963b9245762b91a8d5690752a34f725 Mon Sep 17 00:00:00 2001 -From: Jul <jul@qh.is> -Date: Mon, 28 Jul 2025 14:54:41 +0800 -Subject: [PATCH] set color in config.h - ---- - src/options.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/options.c b/src/options.c -index 2145b33..f33ad93 100644 ---- a/src/options.c -+++ b/src/options.c -@@ -16,9 +16,9 @@ - #include "print.h" - #include "util.h" - --const char *color_line_number = "\033[1;33m"; /* bold yellow */ --const char *color_match = "\033[30;43m"; /* black with yellow background */ --const char *color_path = "\033[1;32m"; /* bold green */ -+const char *color_line_number = COLOR_LINE_NUMBER; -+const char *color_match = COLOR_MATCH; -+const char *color_path = COLOR_PATH; - - cli_options opts; - --- -2.50.1 - diff --git a/pkg/pcre/config.h b/pkg/pcre/config.h @@ -0,0 +1,83 @@ +/* #undef BSR_ANYCRLF */ +/* #undef EBCDIC */ +/* #undef EBCDIC_NL25 */ +#define HAVE_BCOPY 1 +/* #undef HAVE_BITS_TYPE_TRAITS_H */ +/* #undef HAVE_BZLIB_H */ +#define HAVE_DIRENT_H 1 +#define HAVE_DLFCN_H 1 +/* #undef HAVE_EDITLINE_READLINE_H */ +/* #undef HAVE_EDIT_READLINE_READLINE_H */ +#define HAVE_INTTYPES_H 1 +#define HAVE_LIMITS_H 1 +/* #undef HAVE_LONG_LONG */ +#define HAVE_MEMMOVE 1 +#define HAVE_PTHREAD 1 +#define HAVE_PTHREAD_PRIO_INHERIT 1 +/* #undef HAVE_READLINE_HISTORY_H */ +/* #undef HAVE_READLINE_READLINE_H */ +#define HAVE_STDINT_H 1 +#define HAVE_STDIO_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRERROR 1 +/* #undef HAVE_STRING */ +#define HAVE_STRINGS_H 1 +#define HAVE_STRING_H 1 +/* #undef HAVE_STRTOIMAX */ +/* #undef HAVE_STRTOLL */ +/* #undef HAVE_STRTOQ */ +#define HAVE_SYS_STAT_H 1 +#define HAVE_SYS_TYPES_H 1 +/* #undef HAVE_TYPE_TRAITS_H */ +#define HAVE_UNISTD_H 1 +/* #undef HAVE_UNSIGNED_LONG_LONG */ +#define HAVE_VISIBILITY 1 +/* #undef HAVE_WINDOWS_H */ +/* #undef HAVE_ZLIB_H */ +/* #undef HAVE__STRTOI64 */ +#define LINK_SIZE 2 +#define LT_OBJDIR ".libs/" +#define MATCH_LIMIT 10000000 +#define MATCH_LIMIT_RECURSION MATCH_LIMIT +#define MAX_NAME_COUNT 10000 +#define MAX_NAME_SIZE 32 +#define NEWLINE 10 +/* #undef NO_RECURSE */ +#define PACKAGE "pcre" +#define PACKAGE_BUGREPORT "" +#define PACKAGE_NAME "PCRE" +#define PACKAGE_STRING "PCRE 8.45" +#define PACKAGE_TARNAME "pcre" +#define PACKAGE_URL "" +#define PACKAGE_VERSION "8.45" +#define PARENS_NEST_LIMIT 250 +#define PCRECPP_EXP_DECL extern __attribute__ ((visibility ("default"))) +#define PCRECPP_EXP_DEFN __attribute__ ((visibility ("default"))) +#define PCREGREP_BUFSIZE 20480 +#define PCREPOSIX_EXP_DECL extern __attribute__ ((visibility ("default"))) +#define PCREPOSIX_EXP_DEFN extern __attribute__ ((visibility ("default"))) +#define PCRE_EXP_DATA_DEFN __attribute__ ((visibility ("default"))) +#define PCRE_EXP_DECL extern __attribute__ ((visibility ("default"))) +#define PCRE_EXP_DEFN __attribute__ ((visibility ("default"))) +#define PCRE_STATIC 1 +#define POSIX_MALLOC_THRESHOLD 10 +/* #undef PTHREAD_CREATE_JOINABLE */ +#define STDC_HEADERS 1 +#ifdef __GNUC__ +#define SUPPORT_JIT /**/ +#endif +/* #undef SUPPORT_LIBBZ2 */ +/* #undef SUPPORT_LIBEDIT */ +/* #undef SUPPORT_LIBREADLINE */ +/* #undef SUPPORT_LIBZ */ +/* #undef SUPPORT_PCRE16 */ +/* #undef SUPPORT_PCRE32 */ +#define SUPPORT_PCRE8 /**/ +#define SUPPORT_PCREGREP_JIT /**/ +#define SUPPORT_UCP /**/ +#define SUPPORT_UTF /**/ +/* #undef SUPPORT_VALGRIND */ +#define VERSION "8.45" +/* #undef const */ +/* #undef int64_t */ +/* #undef size_t */ diff --git a/pkg/pcre/gen.sh b/pkg/pcre/gen.sh @@ -0,0 +1,47 @@ +fetch curl https://sourceforge.net/projects/pcre/files/pcre/8.45/pcre-8.45.tar.gz \ + 4e6ce03e0336e8b4a3d6c2b70b1c5e18590a5673a98186da90d4f33c23defc09 + +cflags " + -D HAVE_CONFIG_H + -I $dir + -I $srcdir + -I $outdir/include + -Wno-implicit-fallthrough +" + +dep " + $outdir/pcre_chartables.c + $outdir/include/pcre.h +" + +build sed $outdir/include/pcre.h $srcdir/pcre.h.in +bind expr '-e s,@PCRE_MAJOR@,8, -e s,@PCRE_MINOR@,43, -e s,@PCRE_PRERELEASE@,, -e s,@PCRE_DATE@,2019-02-23,' +sync $srcdir/pcre.h.in +headers $outdir/include/pcre.h + +build copy $outdir/pcre_chartables.c $srcdir/pcre_chartables.c.dist +sync $srcdir/pcre_chartables.c.dist + +lib libpcre.a " + pcre_byte_order.c + pcre_compile.c + pcre_config.c + pcre_dfa_exec.c + pcre_exec.c + pcre_fullinfo.c + pcre_get.c + pcre_globals.c + pcre_jit_compile.c + pcre_maketables.c + pcre_newline.c + pcre_ord2utf8.c + pcre_refcount.c + pcre_string_utils.c + pcre_study.c + pcre_tables.c + pcre_ucd.c + pcre_valid_utf8.c + pcre_version.c + pcre_xclass.c + $outdir/pcre_chartables.c +"