|
| 1 | +local versions = { |
| 2 | + ["6.9.10"] = { |
| 3 | + url = "https://github.com/kkos/oniguruma/archive/refs/tags/v6.9.10.tar.gz", |
| 4 | + sha256 = "ad92309d0d13eebc27f6592e875f3efbfa3dda2bf6da5952e00f0a2120c921a8", |
| 5 | + }, |
| 6 | +} |
| 7 | + |
| 8 | +-- compat.oniguruma — Oniguruma 6.9.10 regular expression C library (BSD-2-Clause). |
| 9 | +-- |
| 10 | +-- Form B source-built package compiling the core engine and built-in character encodings. |
| 11 | +-- Generated `mcpp_generated/config/config.h` stays strictly private via `private_include_dirs` |
| 12 | +-- so `config.h` never collides with downstream consumers; consumers receive `*/src` |
| 13 | +-- (`<oniguruma.h>`, `<oniggnu.h>`) and `-DONIG_STATIC` via `default -> staticlib`. |
| 14 | +-- `src/reggnu.c` (`re_compile_pattern`, `re_match`, `re_search`) is opt-in via the |
| 15 | +-- `gnu-api` feature because its legacy GNU regex symbols collide with glibc's `libc.so.6`. |
| 16 | +package = { |
| 17 | + spec = "1", |
| 18 | + namespace = "compat", |
| 19 | + name = "oniguruma", |
| 20 | + description = "Regular expression C library supporting multiple character encodings", |
| 21 | + licenses = { "BSD-2-Clause" }, |
| 22 | + repo = "https://github.com/kkos/oniguruma", |
| 23 | + type = "package", |
| 24 | + |
| 25 | + extensions = { |
| 26 | + autoupdate = { |
| 27 | + tag = "v${version}", |
| 28 | + url = "https://github.com/kkos/oniguruma/archive/refs/tags/${tag}.tar.gz", |
| 29 | + }, |
| 30 | + }, |
| 31 | + |
| 32 | + xpm = { |
| 33 | + linux = { ["6.9.10"] = versions["6.9.10"] }, |
| 34 | + macosx = { ["6.9.10"] = versions["6.9.10"] }, |
| 35 | + windows = { ["6.9.10"] = versions["6.9.10"] }, |
| 36 | + }, |
| 37 | + |
| 38 | + mcpp = { |
| 39 | + language = "c++23", |
| 40 | + import_std = false, |
| 41 | + c_standard = "c11", |
| 42 | + license_files = { "*/COPYING" }, |
| 43 | + include_dirs = { "*/src" }, |
| 44 | + |
| 45 | + cflags = { "-DHAVE_CONFIG_H", "-DONIG_STATIC" }, |
| 46 | + |
| 47 | + generated_files = { |
| 48 | + ["mcpp_generated/config/config.h"] = [==[ |
| 49 | +#ifndef ONIGURUMA_CONFIG_H_MCPP_GUARD |
| 50 | +#define ONIGURUMA_CONFIG_H_MCPP_GUARD |
| 51 | +
|
| 52 | +#define PACKAGE "onig" |
| 53 | +#define PACKAGE_VERSION "6.9.10" |
| 54 | +#define VERSION "6.9.10" |
| 55 | +#define USE_CRNL_AS_LINE_TERMINATOR 0 |
| 56 | +
|
| 57 | +#define HAVE_ALLOCA 1 |
| 58 | +#define HAVE_STDINT_H 1 |
| 59 | +#define HAVE_INTTYPES_H 1 |
| 60 | +#define HAVE_SYS_TYPES_H 1 |
| 61 | +
|
| 62 | +#if !defined(_WIN32) |
| 63 | +#define HAVE_ALLOCA_H 1 |
| 64 | +#define HAVE_SYS_TIMES_H 1 |
| 65 | +#define HAVE_SYS_TIME_H 1 |
| 66 | +#define HAVE_UNISTD_H 1 |
| 67 | +#else |
| 68 | +#define HAVE_FCNTL_H 1 |
| 69 | +#define HAVE_SYS_STAT_H 1 |
| 70 | +#define HAVE_SYS_UTIME_H 1 |
| 71 | +#endif |
| 72 | +
|
| 73 | +#define SIZEOF_INT 4 |
| 74 | +#define SIZEOF_LONG_LONG 8 |
| 75 | +#if defined(_WIN32) |
| 76 | +#define SIZEOF_LONG 4 |
| 77 | +#else |
| 78 | +#if defined(__LP64__) |
| 79 | +#define SIZEOF_LONG 8 |
| 80 | +#else |
| 81 | +#define SIZEOF_LONG 4 |
| 82 | +#endif |
| 83 | +#endif |
| 84 | +
|
| 85 | +#if defined(__LP64__) || defined(_WIN64) || defined(__x86_64__) || defined(__aarch64__) |
| 86 | +#define SIZEOF_VOIDP 8 |
| 87 | +#else |
| 88 | +#define SIZEOF_VOIDP 4 |
| 89 | +#endif |
| 90 | +
|
| 91 | +#endif |
| 92 | +]==], |
| 93 | + }, |
| 94 | + |
| 95 | + sources = { |
| 96 | + "*/src/regerror.c", |
| 97 | + "*/src/regparse.c", |
| 98 | + "*/src/regext.c", |
| 99 | + "*/src/regcomp.c", |
| 100 | + "*/src/regexec.c", |
| 101 | + "*/src/regenc.c", |
| 102 | + "*/src/regsyntax.c", |
| 103 | + "*/src/regtrav.c", |
| 104 | + "*/src/regversion.c", |
| 105 | + "*/src/st.c", |
| 106 | + "*/src/onig_init.c", |
| 107 | + "*/src/unicode.c", |
| 108 | + "*/src/ascii.c", |
| 109 | + "*/src/utf8.c", |
| 110 | + "*/src/utf16_be.c", |
| 111 | + "*/src/utf16_le.c", |
| 112 | + "*/src/utf32_be.c", |
| 113 | + "*/src/utf32_le.c", |
| 114 | + "*/src/euc_jp.c", |
| 115 | + "*/src/sjis.c", |
| 116 | + "*/src/iso8859_1.c", |
| 117 | + "*/src/iso8859_2.c", |
| 118 | + "*/src/iso8859_3.c", |
| 119 | + "*/src/iso8859_4.c", |
| 120 | + "*/src/iso8859_5.c", |
| 121 | + "*/src/iso8859_6.c", |
| 122 | + "*/src/iso8859_7.c", |
| 123 | + "*/src/iso8859_8.c", |
| 124 | + "*/src/iso8859_9.c", |
| 125 | + "*/src/iso8859_10.c", |
| 126 | + "*/src/iso8859_11.c", |
| 127 | + "*/src/iso8859_13.c", |
| 128 | + "*/src/iso8859_14.c", |
| 129 | + "*/src/iso8859_15.c", |
| 130 | + "*/src/iso8859_16.c", |
| 131 | + "*/src/euc_tw.c", |
| 132 | + "*/src/euc_kr.c", |
| 133 | + "*/src/big5.c", |
| 134 | + "*/src/gb18030.c", |
| 135 | + "*/src/koi8_r.c", |
| 136 | + "*/src/cp1251.c", |
| 137 | + "*/src/euc_jp_prop.c", |
| 138 | + "*/src/sjis_prop.c", |
| 139 | + "*/src/unicode_unfold_key.c", |
| 140 | + "*/src/unicode_fold1_key.c", |
| 141 | + "*/src/unicode_fold2_key.c", |
| 142 | + "*/src/unicode_fold3_key.c", |
| 143 | + }, |
| 144 | + |
| 145 | + linux = { |
| 146 | + include_dirs = { "mcpp_generated/config" }, |
| 147 | + private_include_dirs = { "mcpp_generated/config" }, |
| 148 | + }, |
| 149 | + macosx = { |
| 150 | + include_dirs = { "mcpp_generated/config" }, |
| 151 | + private_include_dirs = { "mcpp_generated/config" }, |
| 152 | + }, |
| 153 | + windows = { |
| 154 | + include_dirs = { "mcpp_generated/config" }, |
| 155 | + private_include_dirs = { "mcpp_generated/config" }, |
| 156 | + cflags = { "-D_CRT_SECURE_NO_WARNINGS" }, |
| 157 | + }, |
| 158 | + |
| 159 | + targets = { onig = { kind = "lib" } }, |
| 160 | + |
| 161 | + features = { |
| 162 | + ["default"] = { implies = { "staticlib" } }, |
| 163 | + ["staticlib"] = { defines = { "ONIG_STATIC" } }, |
| 164 | + ["gnu-api"] = { sources = { "*/src/reggnu.c" } }, |
| 165 | + }, |
| 166 | + |
| 167 | + deps = {}, |
| 168 | + }, |
| 169 | +} |
0 commit comments