summaryrefslogtreecommitdiff
path: root/rockspecs.lua
blob: 96771744124d93d1d0410ff25c3880055ecfdd6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
-- Rockspec data

-- Variables to be interpolated:
--
-- flavour: regex library
-- version

local flavours = {"PCRE", "PCRE2", "POSIX", "oniguruma", "TRE", "GNU"}
local version_dashed = version:gsub ("%.", "-")
-- FIXME: PCRE2 define should be only in PCRE2 rockspec
local defines = {"VERSION=\""..version.."\"",
                 "PCRE2_CODE_UNIT_WIDTH=8"}

-- FIXME: When Lua 5.1 support is dropped, use an env argument with
-- loadfile instead of wrapping in a table
return {

default = {
  package = "Lrexlib-"..flavour,
  version = version.."-1",
  source = {
    url = "git+https://github.com/rrthomas/lrexlib.git",
    tag = "rel-"..version_dashed,
  },
  description = {
    summary = "Regular expression library binding ("..flavour.." flavour).",
    detailed = [[
Lrexlib is a regular expression library for Lua 5.1-5.4, which
provides bindings for several regular expression libraries.
This rock provides the ]]..flavour..[[ bindings.]],
    homepage = "https://github.com/rrthomas/lrexlib",
    license = "MIT/X11"
  },
  dependencies = {
    "lua >= 5.1"
  },
},

PCRE = {
  external_dependencies = {
    PCRE = {
      header = "pcre.h",
      library = "pcre"
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_pcre = {
        defines = defines,
        sources = {"src/common.c", "src/pcre/lpcre.c", "src/pcre/lpcre_f.c"},
        libraries = {"pcre"},
        incdirs = {"$(PCRE_INCDIR)"},
        libdirs = {"$(PCRE_LIBDIR)"}
      }
    }
  }
},

PCRE2 = {
  external_dependencies = {
    PCRE2 = {
      header = "pcre2.h",
      library = "pcre2-8"
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_pcre2 = {
        defines = defines,
        sources = {"src/common.c", "src/pcre2/lpcre2.c", "src/pcre2/lpcre2_f.c"},
        libraries = {"pcre2-8"},
        incdirs = {"$(PCRE2_INCDIR)"},
        libdirs = {"$(PCRE2_LIBDIR)"}
      }
    }
  }
},

POSIX = {
  external_dependencies = {
    POSIX = {
      header = "regex.h",
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_posix = {
        defines = defines,
        sources = {"src/common.c", "src/posix/lposix.c"}
      }
    }
  }
},

oniguruma = {
  external_dependencies = {
    ONIG = {
      header = "oniguruma.h",
      library = "onig"
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_onig = {
        defines = defines,
        sources = {"src/common.c", "src/oniguruma/lonig.c", "src/oniguruma/lonig_f.c"},
        libraries = {"onig"},
        incdirs = {"$(ONIG_INCDIR)"},
        libdirs = {"$(ONIG_LIBDIR)"}
      }
    }
  }
},

TRE = {
  external_dependencies = {
    TRE = {
      header = "tre/tre.h",
      library = "tre"
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_tre = {
        defines = defines,
        sources = {"src/common.c", "src/tre/ltre.c" --[[, "src/tre/tre_w.c"]]},
        libraries = {"tre"},
        incdirs = {"$(TRE_INCDIR)"},
        libdirs = {"$(TRE_LIBDIR)"}
      }
    }
  }
},

GNU = {
  external_dependencies = {
    GNU = {
      header = "regex.h",
    }
  },
  build = {
    type = "builtin",
    modules = {
      rex_gnu = {
        defines = defines,
        sources = {"src/common.c", "src/gnu/lgnu.c"}
      }
    }
  }
},

} -- close wrapper table