halton 0.2.1.3 → 0.2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.lock +279 -0
- data/Cargo.toml +2 -0
- data/ext/halton/Cargo.toml +1 -1
- data/ext/halton/src/lib.rs +12 -11
- data/lib/halton.rb +10 -1
- metadata +56 -14
- data/ext/halton/Cargo.lock +0 -445
- data/ext/halton/Rakefile +0 -159
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7ed27356a6e2a2f658747ba007d3d5f295049e425512a7996e8d31679fa10964
|
4
|
+
data.tar.gz: c368b48acb7bfc73fde7d347de2c9667224daaa7c1b085e170ab9eab60cb26cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ade7dfefe049433feb6fef115461f55fb043953444e33b83efd11c62db37f6c46ec554e4f9094a80caa6309f2e9391e8f13b3abf0f6285cd1e6a4aa3927ae9b
|
7
|
+
data.tar.gz: 658632d67fb5ab6e7478067aa8dff286e1d130754bb7f8995b3a47ab1ba854bab8e7f0809da951c82023593c66b3061afc24272456df7210826df354098d20c2
|
data/Cargo.lock
ADDED
@@ -0,0 +1,279 @@
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
2
|
+
# It is not intended for manual editing.
|
3
|
+
version = 3
|
4
|
+
|
5
|
+
[[package]]
|
6
|
+
name = "aho-corasick"
|
7
|
+
version = "0.7.20"
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
+
checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac"
|
10
|
+
dependencies = [
|
11
|
+
"memchr",
|
12
|
+
]
|
13
|
+
|
14
|
+
[[package]]
|
15
|
+
name = "bindgen"
|
16
|
+
version = "0.60.1"
|
17
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
+
checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6"
|
19
|
+
dependencies = [
|
20
|
+
"bitflags",
|
21
|
+
"cexpr",
|
22
|
+
"clang-sys",
|
23
|
+
"lazy_static",
|
24
|
+
"lazycell",
|
25
|
+
"peeking_take_while",
|
26
|
+
"proc-macro2",
|
27
|
+
"quote",
|
28
|
+
"regex",
|
29
|
+
"rustc-hash",
|
30
|
+
"shlex",
|
31
|
+
]
|
32
|
+
|
33
|
+
[[package]]
|
34
|
+
name = "bitflags"
|
35
|
+
version = "1.3.2"
|
36
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
37
|
+
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
38
|
+
|
39
|
+
[[package]]
|
40
|
+
name = "cexpr"
|
41
|
+
version = "0.6.0"
|
42
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
43
|
+
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
|
44
|
+
dependencies = [
|
45
|
+
"nom",
|
46
|
+
]
|
47
|
+
|
48
|
+
[[package]]
|
49
|
+
name = "cfg-if"
|
50
|
+
version = "1.0.0"
|
51
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
52
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
53
|
+
|
54
|
+
[[package]]
|
55
|
+
name = "clang-sys"
|
56
|
+
version = "1.4.0"
|
57
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
58
|
+
checksum = "fa2e27ae6ab525c3d369ded447057bca5438d86dc3a68f6faafb8269ba82ebf3"
|
59
|
+
dependencies = [
|
60
|
+
"glob",
|
61
|
+
"libc",
|
62
|
+
"libloading",
|
63
|
+
]
|
64
|
+
|
65
|
+
[[package]]
|
66
|
+
name = "glob"
|
67
|
+
version = "0.3.0"
|
68
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
69
|
+
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
70
|
+
|
71
|
+
[[package]]
|
72
|
+
name = "halton"
|
73
|
+
version = "0.1.0"
|
74
|
+
dependencies = [
|
75
|
+
"halton 0.2.1",
|
76
|
+
"magnus",
|
77
|
+
]
|
78
|
+
|
79
|
+
[[package]]
|
80
|
+
name = "halton"
|
81
|
+
version = "0.2.1"
|
82
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
83
|
+
checksum = "be629448e3d85a1be12868f190df524655fea8ec3f143e14d803e298f618acae"
|
84
|
+
|
85
|
+
[[package]]
|
86
|
+
name = "lazy_static"
|
87
|
+
version = "1.4.0"
|
88
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
89
|
+
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
90
|
+
|
91
|
+
[[package]]
|
92
|
+
name = "lazycell"
|
93
|
+
version = "1.3.0"
|
94
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
95
|
+
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
96
|
+
|
97
|
+
[[package]]
|
98
|
+
name = "libc"
|
99
|
+
version = "0.2.139"
|
100
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
101
|
+
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
102
|
+
|
103
|
+
[[package]]
|
104
|
+
name = "libloading"
|
105
|
+
version = "0.7.4"
|
106
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
107
|
+
checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f"
|
108
|
+
dependencies = [
|
109
|
+
"cfg-if",
|
110
|
+
"winapi",
|
111
|
+
]
|
112
|
+
|
113
|
+
[[package]]
|
114
|
+
name = "magnus"
|
115
|
+
version = "0.4.4"
|
116
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
117
|
+
checksum = "fc87660cd7daa49fddbfd524c836de54d5c927d520cd163f43700c5087c57d6c"
|
118
|
+
dependencies = [
|
119
|
+
"magnus-macros",
|
120
|
+
"rb-sys",
|
121
|
+
"rb-sys-env",
|
122
|
+
]
|
123
|
+
|
124
|
+
[[package]]
|
125
|
+
name = "magnus-macros"
|
126
|
+
version = "0.3.0"
|
127
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
128
|
+
checksum = "206cb23bfeea05180c97522ef6a3e52a4eb17b0ed2f30ee3ca9c4f994d2378ae"
|
129
|
+
dependencies = [
|
130
|
+
"proc-macro2",
|
131
|
+
"quote",
|
132
|
+
"syn",
|
133
|
+
]
|
134
|
+
|
135
|
+
[[package]]
|
136
|
+
name = "memchr"
|
137
|
+
version = "2.5.0"
|
138
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
139
|
+
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
140
|
+
|
141
|
+
[[package]]
|
142
|
+
name = "minimal-lexical"
|
143
|
+
version = "0.2.1"
|
144
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
145
|
+
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
146
|
+
|
147
|
+
[[package]]
|
148
|
+
name = "nom"
|
149
|
+
version = "7.1.1"
|
150
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
151
|
+
checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36"
|
152
|
+
dependencies = [
|
153
|
+
"memchr",
|
154
|
+
"minimal-lexical",
|
155
|
+
]
|
156
|
+
|
157
|
+
[[package]]
|
158
|
+
name = "peeking_take_while"
|
159
|
+
version = "0.1.2"
|
160
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
161
|
+
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
162
|
+
|
163
|
+
[[package]]
|
164
|
+
name = "proc-macro2"
|
165
|
+
version = "1.0.49"
|
166
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
167
|
+
checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5"
|
168
|
+
dependencies = [
|
169
|
+
"unicode-ident",
|
170
|
+
]
|
171
|
+
|
172
|
+
[[package]]
|
173
|
+
name = "quote"
|
174
|
+
version = "1.0.23"
|
175
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
176
|
+
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
|
177
|
+
dependencies = [
|
178
|
+
"proc-macro2",
|
179
|
+
]
|
180
|
+
|
181
|
+
[[package]]
|
182
|
+
name = "rb-sys"
|
183
|
+
version = "0.9.53"
|
184
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
185
|
+
checksum = "aa291f69bcc44f8e96597a3f39e9933fde6977b825415cfaa670ac49b8ab7c99"
|
186
|
+
dependencies = [
|
187
|
+
"rb-sys-build",
|
188
|
+
]
|
189
|
+
|
190
|
+
[[package]]
|
191
|
+
name = "rb-sys-build"
|
192
|
+
version = "0.9.53"
|
193
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
194
|
+
checksum = "d998fd6ef588471d6d7cca24c4da88eda5e6757b6885c55760e856ecdb254c3d"
|
195
|
+
dependencies = [
|
196
|
+
"bindgen",
|
197
|
+
"regex",
|
198
|
+
"shell-words",
|
199
|
+
]
|
200
|
+
|
201
|
+
[[package]]
|
202
|
+
name = "rb-sys-env"
|
203
|
+
version = "0.1.1"
|
204
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
205
|
+
checksum = "74c38752410925faeb82c400c06ba2fd9ee6aa8f719dd33994c9e53f5242d25f"
|
206
|
+
|
207
|
+
[[package]]
|
208
|
+
name = "regex"
|
209
|
+
version = "1.7.0"
|
210
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
211
|
+
checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a"
|
212
|
+
dependencies = [
|
213
|
+
"aho-corasick",
|
214
|
+
"memchr",
|
215
|
+
"regex-syntax",
|
216
|
+
]
|
217
|
+
|
218
|
+
[[package]]
|
219
|
+
name = "regex-syntax"
|
220
|
+
version = "0.6.28"
|
221
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
222
|
+
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
|
223
|
+
|
224
|
+
[[package]]
|
225
|
+
name = "rustc-hash"
|
226
|
+
version = "1.1.0"
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
228
|
+
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
229
|
+
|
230
|
+
[[package]]
|
231
|
+
name = "shell-words"
|
232
|
+
version = "1.1.0"
|
233
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
234
|
+
checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
|
235
|
+
|
236
|
+
[[package]]
|
237
|
+
name = "shlex"
|
238
|
+
version = "1.1.0"
|
239
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
240
|
+
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
241
|
+
|
242
|
+
[[package]]
|
243
|
+
name = "syn"
|
244
|
+
version = "1.0.107"
|
245
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
246
|
+
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
|
247
|
+
dependencies = [
|
248
|
+
"proc-macro2",
|
249
|
+
"quote",
|
250
|
+
"unicode-ident",
|
251
|
+
]
|
252
|
+
|
253
|
+
[[package]]
|
254
|
+
name = "unicode-ident"
|
255
|
+
version = "1.0.6"
|
256
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
257
|
+
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
258
|
+
|
259
|
+
[[package]]
|
260
|
+
name = "winapi"
|
261
|
+
version = "0.3.9"
|
262
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
263
|
+
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
264
|
+
dependencies = [
|
265
|
+
"winapi-i686-pc-windows-gnu",
|
266
|
+
"winapi-x86_64-pc-windows-gnu",
|
267
|
+
]
|
268
|
+
|
269
|
+
[[package]]
|
270
|
+
name = "winapi-i686-pc-windows-gnu"
|
271
|
+
version = "0.4.0"
|
272
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
273
|
+
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
274
|
+
|
275
|
+
[[package]]
|
276
|
+
name = "winapi-x86_64-pc-windows-gnu"
|
277
|
+
version = "0.4.0"
|
278
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
279
|
+
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
data/Cargo.toml
ADDED
data/ext/halton/Cargo.toml
CHANGED
data/ext/halton/src/lib.rs
CHANGED
@@ -4,6 +4,7 @@ use magnus::{
|
|
4
4
|
block::{block_given, Yield, YieldSplat, YieldValues},
|
5
5
|
define_module, exception, function, method,
|
6
6
|
prelude::*,
|
7
|
+
scan_args::check_arity,
|
7
8
|
Error, RArray, Value,
|
8
9
|
};
|
9
10
|
|
@@ -73,23 +74,23 @@ fn each_triple(
|
|
73
74
|
|
74
75
|
fn each_many(
|
75
76
|
rb_self: Value,
|
76
|
-
|
77
|
+
args: &[Value],
|
77
78
|
) -> Result<YieldSplat<impl Iterator<Item = RArray>>, Error> {
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
)
|
83
|
-
|
79
|
+
check_arity(args.len(), 1..)?;
|
80
|
+
let bases = args
|
81
|
+
.iter()
|
82
|
+
.map(|v| v.try_convert())
|
83
|
+
.collect::<Result<Vec<u8>, _>>()?;
|
84
|
+
|
84
85
|
if !block_given() {
|
85
86
|
return Ok(YieldSplat::Enumerator(
|
86
|
-
rb_self.enumeratorize("each_many",
|
87
|
+
rb_self.enumeratorize("each_many", args),
|
87
88
|
));
|
88
89
|
}
|
89
90
|
let mut seqs = bases
|
90
|
-
.
|
91
|
-
.map(
|
92
|
-
.collect::<
|
91
|
+
.into_iter()
|
92
|
+
.map(halton::Sequence::new)
|
93
|
+
.collect::<Vec<_>>();
|
93
94
|
let mut buffer = Vec::<Value>::with_capacity(seqs.len());
|
94
95
|
Ok(YieldSplat::Iter(std::iter::from_fn(move || {
|
95
96
|
buffer.clear();
|
data/lib/halton.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
begin
|
4
|
+
/(?<ruby_version>\d+\.\d+)/ =~ RUBY_VERSION
|
5
|
+
require_relative "halton/#{ruby_version}/halton"
|
6
|
+
rescue LoadError
|
7
|
+
begin
|
8
|
+
require_relative "halton/halton"
|
9
|
+
rescue LoadError # Cargo Builder in RubyGems < 3.4.6 doesn't install to dir
|
10
|
+
require_relative "halton.so"
|
11
|
+
end
|
12
|
+
end
|
4
13
|
|
5
14
|
# The Halton module provides methods for generating Halton sequences, a
|
6
15
|
# deterministic low discrepancy sequence that appears to be random. The uniform
|
metadata
CHANGED
@@ -1,29 +1,71 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: halton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.1.
|
4
|
+
version: 0.2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mat Sadler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: rake
|
14
|
+
name: rake-compiler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1'
|
20
|
-
type: :
|
19
|
+
version: '1.2'
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1'
|
26
|
+
version: '1.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rb_sys
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0.9'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0.9'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: test-unit
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.5'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.5'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: benchmark-ips
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.10'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.10'
|
27
69
|
description: A module implementing the fast generation of Halton sequences. The method
|
28
70
|
of generation is adapted from "Fast, portable, and reliable algorithm for the calculation
|
29
71
|
of Halton number" by Miroslav Kolář and Seamus F. O'Shea.
|
@@ -31,14 +73,14 @@ email:
|
|
31
73
|
- mat@sourcetagsandcodes.com
|
32
74
|
executables: []
|
33
75
|
extensions:
|
34
|
-
- ext/halton/
|
76
|
+
- ext/halton/Cargo.toml
|
35
77
|
extra_rdoc_files:
|
36
78
|
- README.rdoc
|
37
79
|
files:
|
80
|
+
- Cargo.lock
|
81
|
+
- Cargo.toml
|
38
82
|
- README.rdoc
|
39
|
-
- ext/halton/Cargo.lock
|
40
83
|
- ext/halton/Cargo.toml
|
41
|
-
- ext/halton/Rakefile
|
42
84
|
- ext/halton/src/lib.rs
|
43
85
|
- lib/halton.rb
|
44
86
|
homepage: https://github.com/matsadler/halton-rb
|
@@ -59,15 +101,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
59
101
|
requirements:
|
60
102
|
- - ">="
|
61
103
|
- !ruby/object:Gem::Version
|
62
|
-
version:
|
104
|
+
version: 2.6.0
|
63
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
106
|
requirements:
|
65
107
|
- - ">="
|
66
108
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
109
|
+
version: 3.3.26
|
68
110
|
requirements:
|
69
111
|
- Rust >= 1.51.0
|
70
|
-
rubygems_version: 3.4.
|
112
|
+
rubygems_version: 3.4.6
|
71
113
|
signing_key:
|
72
114
|
specification_version: 4
|
73
115
|
summary: A module for generating Halton sequences
|
data/ext/halton/Cargo.lock
DELETED
@@ -1,445 +0,0 @@
|
|
1
|
-
# This file is automatically @generated by Cargo.
|
2
|
-
# It is not intended for manual editing.
|
3
|
-
version = 3
|
4
|
-
|
5
|
-
[[package]]
|
6
|
-
name = "aho-corasick"
|
7
|
-
version = "0.7.18"
|
8
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
-
checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
|
10
|
-
dependencies = [
|
11
|
-
"memchr",
|
12
|
-
]
|
13
|
-
|
14
|
-
[[package]]
|
15
|
-
name = "ansi_term"
|
16
|
-
version = "0.12.1"
|
17
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
18
|
-
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
|
19
|
-
dependencies = [
|
20
|
-
"winapi",
|
21
|
-
]
|
22
|
-
|
23
|
-
[[package]]
|
24
|
-
name = "atty"
|
25
|
-
version = "0.2.14"
|
26
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
27
|
-
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
|
28
|
-
dependencies = [
|
29
|
-
"hermit-abi",
|
30
|
-
"libc",
|
31
|
-
"winapi",
|
32
|
-
]
|
33
|
-
|
34
|
-
[[package]]
|
35
|
-
name = "bindgen"
|
36
|
-
version = "0.59.2"
|
37
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
38
|
-
checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8"
|
39
|
-
dependencies = [
|
40
|
-
"bitflags",
|
41
|
-
"cexpr",
|
42
|
-
"clang-sys",
|
43
|
-
"clap",
|
44
|
-
"env_logger",
|
45
|
-
"lazy_static",
|
46
|
-
"lazycell",
|
47
|
-
"log",
|
48
|
-
"peeking_take_while",
|
49
|
-
"proc-macro2",
|
50
|
-
"quote",
|
51
|
-
"regex",
|
52
|
-
"rustc-hash",
|
53
|
-
"shlex",
|
54
|
-
"which",
|
55
|
-
]
|
56
|
-
|
57
|
-
[[package]]
|
58
|
-
name = "bitflags"
|
59
|
-
version = "1.3.2"
|
60
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
61
|
-
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
62
|
-
|
63
|
-
[[package]]
|
64
|
-
name = "cexpr"
|
65
|
-
version = "0.6.0"
|
66
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
67
|
-
checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766"
|
68
|
-
dependencies = [
|
69
|
-
"nom",
|
70
|
-
]
|
71
|
-
|
72
|
-
[[package]]
|
73
|
-
name = "cfg-if"
|
74
|
-
version = "1.0.0"
|
75
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
76
|
-
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
77
|
-
|
78
|
-
[[package]]
|
79
|
-
name = "clang-sys"
|
80
|
-
version = "1.3.1"
|
81
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
82
|
-
checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21"
|
83
|
-
dependencies = [
|
84
|
-
"glob",
|
85
|
-
"libc",
|
86
|
-
"libloading",
|
87
|
-
]
|
88
|
-
|
89
|
-
[[package]]
|
90
|
-
name = "clap"
|
91
|
-
version = "2.34.0"
|
92
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
93
|
-
checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
|
94
|
-
dependencies = [
|
95
|
-
"ansi_term",
|
96
|
-
"atty",
|
97
|
-
"bitflags",
|
98
|
-
"strsim 0.8.0",
|
99
|
-
"textwrap",
|
100
|
-
"unicode-width",
|
101
|
-
"vec_map",
|
102
|
-
]
|
103
|
-
|
104
|
-
[[package]]
|
105
|
-
name = "darling"
|
106
|
-
version = "0.13.1"
|
107
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
108
|
-
checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4"
|
109
|
-
dependencies = [
|
110
|
-
"darling_core",
|
111
|
-
"darling_macro",
|
112
|
-
]
|
113
|
-
|
114
|
-
[[package]]
|
115
|
-
name = "darling_core"
|
116
|
-
version = "0.13.1"
|
117
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
118
|
-
checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324"
|
119
|
-
dependencies = [
|
120
|
-
"fnv",
|
121
|
-
"ident_case",
|
122
|
-
"proc-macro2",
|
123
|
-
"quote",
|
124
|
-
"strsim 0.10.0",
|
125
|
-
"syn",
|
126
|
-
]
|
127
|
-
|
128
|
-
[[package]]
|
129
|
-
name = "darling_macro"
|
130
|
-
version = "0.13.1"
|
131
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
132
|
-
checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b"
|
133
|
-
dependencies = [
|
134
|
-
"darling_core",
|
135
|
-
"quote",
|
136
|
-
"syn",
|
137
|
-
]
|
138
|
-
|
139
|
-
[[package]]
|
140
|
-
name = "either"
|
141
|
-
version = "1.6.1"
|
142
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
143
|
-
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
|
144
|
-
|
145
|
-
[[package]]
|
146
|
-
name = "env_logger"
|
147
|
-
version = "0.9.0"
|
148
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
149
|
-
checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3"
|
150
|
-
dependencies = [
|
151
|
-
"atty",
|
152
|
-
"humantime",
|
153
|
-
"log",
|
154
|
-
"regex",
|
155
|
-
"termcolor",
|
156
|
-
]
|
157
|
-
|
158
|
-
[[package]]
|
159
|
-
name = "fnv"
|
160
|
-
version = "1.0.7"
|
161
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
162
|
-
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
|
163
|
-
|
164
|
-
[[package]]
|
165
|
-
name = "glob"
|
166
|
-
version = "0.3.0"
|
167
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
168
|
-
checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
|
169
|
-
|
170
|
-
[[package]]
|
171
|
-
name = "halton"
|
172
|
-
version = "0.1.0"
|
173
|
-
dependencies = [
|
174
|
-
"halton 0.2.1",
|
175
|
-
"magnus",
|
176
|
-
]
|
177
|
-
|
178
|
-
[[package]]
|
179
|
-
name = "halton"
|
180
|
-
version = "0.2.1"
|
181
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
182
|
-
checksum = "be629448e3d85a1be12868f190df524655fea8ec3f143e14d803e298f618acae"
|
183
|
-
|
184
|
-
[[package]]
|
185
|
-
name = "hermit-abi"
|
186
|
-
version = "0.1.19"
|
187
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
188
|
-
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
|
189
|
-
dependencies = [
|
190
|
-
"libc",
|
191
|
-
]
|
192
|
-
|
193
|
-
[[package]]
|
194
|
-
name = "humantime"
|
195
|
-
version = "2.1.0"
|
196
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
197
|
-
checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
|
198
|
-
|
199
|
-
[[package]]
|
200
|
-
name = "ident_case"
|
201
|
-
version = "1.0.1"
|
202
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
203
|
-
checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
|
204
|
-
|
205
|
-
[[package]]
|
206
|
-
name = "lazy_static"
|
207
|
-
version = "1.4.0"
|
208
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
209
|
-
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
210
|
-
|
211
|
-
[[package]]
|
212
|
-
name = "lazycell"
|
213
|
-
version = "1.3.0"
|
214
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
215
|
-
checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
|
216
|
-
|
217
|
-
[[package]]
|
218
|
-
name = "libc"
|
219
|
-
version = "0.2.119"
|
220
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
221
|
-
checksum = "1bf2e165bb3457c8e098ea76f3e3bc9db55f87aa90d52d0e6be741470916aaa4"
|
222
|
-
|
223
|
-
[[package]]
|
224
|
-
name = "libloading"
|
225
|
-
version = "0.7.3"
|
226
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
227
|
-
checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd"
|
228
|
-
dependencies = [
|
229
|
-
"cfg-if",
|
230
|
-
"winapi",
|
231
|
-
]
|
232
|
-
|
233
|
-
[[package]]
|
234
|
-
name = "log"
|
235
|
-
version = "0.4.14"
|
236
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
237
|
-
checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
|
238
|
-
dependencies = [
|
239
|
-
"cfg-if",
|
240
|
-
]
|
241
|
-
|
242
|
-
[[package]]
|
243
|
-
name = "magnus"
|
244
|
-
version = "0.3.1"
|
245
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
246
|
-
checksum = "e772e3622600833393ebd9c89a5f963a9c9699528cb60764e7f178e0cc96344a"
|
247
|
-
dependencies = [
|
248
|
-
"bindgen",
|
249
|
-
"magnus-macros",
|
250
|
-
]
|
251
|
-
|
252
|
-
[[package]]
|
253
|
-
name = "magnus-macros"
|
254
|
-
version = "0.1.0"
|
255
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
256
|
-
checksum = "27968fcabe2ef7e35b8331d71a62882282996f6222c133c0255cf7f33b8d9b48"
|
257
|
-
dependencies = [
|
258
|
-
"darling",
|
259
|
-
"proc-macro2",
|
260
|
-
"quote",
|
261
|
-
"syn",
|
262
|
-
]
|
263
|
-
|
264
|
-
[[package]]
|
265
|
-
name = "memchr"
|
266
|
-
version = "2.4.1"
|
267
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
268
|
-
checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
|
269
|
-
|
270
|
-
[[package]]
|
271
|
-
name = "minimal-lexical"
|
272
|
-
version = "0.2.1"
|
273
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
274
|
-
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
275
|
-
|
276
|
-
[[package]]
|
277
|
-
name = "nom"
|
278
|
-
version = "7.1.0"
|
279
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
280
|
-
checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109"
|
281
|
-
dependencies = [
|
282
|
-
"memchr",
|
283
|
-
"minimal-lexical",
|
284
|
-
"version_check",
|
285
|
-
]
|
286
|
-
|
287
|
-
[[package]]
|
288
|
-
name = "peeking_take_while"
|
289
|
-
version = "0.1.2"
|
290
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
291
|
-
checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
|
292
|
-
|
293
|
-
[[package]]
|
294
|
-
name = "proc-macro2"
|
295
|
-
version = "1.0.36"
|
296
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
297
|
-
checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
|
298
|
-
dependencies = [
|
299
|
-
"unicode-xid",
|
300
|
-
]
|
301
|
-
|
302
|
-
[[package]]
|
303
|
-
name = "quote"
|
304
|
-
version = "1.0.15"
|
305
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
306
|
-
checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145"
|
307
|
-
dependencies = [
|
308
|
-
"proc-macro2",
|
309
|
-
]
|
310
|
-
|
311
|
-
[[package]]
|
312
|
-
name = "regex"
|
313
|
-
version = "1.5.4"
|
314
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
315
|
-
checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
|
316
|
-
dependencies = [
|
317
|
-
"aho-corasick",
|
318
|
-
"memchr",
|
319
|
-
"regex-syntax",
|
320
|
-
]
|
321
|
-
|
322
|
-
[[package]]
|
323
|
-
name = "regex-syntax"
|
324
|
-
version = "0.6.25"
|
325
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
326
|
-
checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
|
327
|
-
|
328
|
-
[[package]]
|
329
|
-
name = "rustc-hash"
|
330
|
-
version = "1.1.0"
|
331
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
332
|
-
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
|
333
|
-
|
334
|
-
[[package]]
|
335
|
-
name = "shlex"
|
336
|
-
version = "1.1.0"
|
337
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
338
|
-
checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3"
|
339
|
-
|
340
|
-
[[package]]
|
341
|
-
name = "strsim"
|
342
|
-
version = "0.8.0"
|
343
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
344
|
-
checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
|
345
|
-
|
346
|
-
[[package]]
|
347
|
-
name = "strsim"
|
348
|
-
version = "0.10.0"
|
349
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
350
|
-
checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
|
351
|
-
|
352
|
-
[[package]]
|
353
|
-
name = "syn"
|
354
|
-
version = "1.0.86"
|
355
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
356
|
-
checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b"
|
357
|
-
dependencies = [
|
358
|
-
"proc-macro2",
|
359
|
-
"quote",
|
360
|
-
"unicode-xid",
|
361
|
-
]
|
362
|
-
|
363
|
-
[[package]]
|
364
|
-
name = "termcolor"
|
365
|
-
version = "1.1.2"
|
366
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
367
|
-
checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
|
368
|
-
dependencies = [
|
369
|
-
"winapi-util",
|
370
|
-
]
|
371
|
-
|
372
|
-
[[package]]
|
373
|
-
name = "textwrap"
|
374
|
-
version = "0.11.0"
|
375
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
376
|
-
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
|
377
|
-
dependencies = [
|
378
|
-
"unicode-width",
|
379
|
-
]
|
380
|
-
|
381
|
-
[[package]]
|
382
|
-
name = "unicode-width"
|
383
|
-
version = "0.1.9"
|
384
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
385
|
-
checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
|
386
|
-
|
387
|
-
[[package]]
|
388
|
-
name = "unicode-xid"
|
389
|
-
version = "0.2.2"
|
390
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
391
|
-
checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
|
392
|
-
|
393
|
-
[[package]]
|
394
|
-
name = "vec_map"
|
395
|
-
version = "0.8.2"
|
396
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
397
|
-
checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
|
398
|
-
|
399
|
-
[[package]]
|
400
|
-
name = "version_check"
|
401
|
-
version = "0.9.4"
|
402
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
403
|
-
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
404
|
-
|
405
|
-
[[package]]
|
406
|
-
name = "which"
|
407
|
-
version = "4.2.4"
|
408
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
409
|
-
checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2"
|
410
|
-
dependencies = [
|
411
|
-
"either",
|
412
|
-
"lazy_static",
|
413
|
-
"libc",
|
414
|
-
]
|
415
|
-
|
416
|
-
[[package]]
|
417
|
-
name = "winapi"
|
418
|
-
version = "0.3.9"
|
419
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
420
|
-
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
|
421
|
-
dependencies = [
|
422
|
-
"winapi-i686-pc-windows-gnu",
|
423
|
-
"winapi-x86_64-pc-windows-gnu",
|
424
|
-
]
|
425
|
-
|
426
|
-
[[package]]
|
427
|
-
name = "winapi-i686-pc-windows-gnu"
|
428
|
-
version = "0.4.0"
|
429
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
430
|
-
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
|
431
|
-
|
432
|
-
[[package]]
|
433
|
-
name = "winapi-util"
|
434
|
-
version = "0.1.5"
|
435
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
436
|
-
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
|
437
|
-
dependencies = [
|
438
|
-
"winapi",
|
439
|
-
]
|
440
|
-
|
441
|
-
[[package]]
|
442
|
-
name = "winapi-x86_64-pc-windows-gnu"
|
443
|
-
version = "0.4.0"
|
444
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
445
|
-
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
|
data/ext/halton/Rakefile
DELETED
@@ -1,159 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require "shellwords"
|
4
|
-
|
5
|
-
class RakeCargoHelper
|
6
|
-
attr_reader :gemname
|
7
|
-
|
8
|
-
def initialize(gemname=File.basename(__dir__))
|
9
|
-
@gemname = gemname
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.command?(name)
|
13
|
-
exts = ENV["PATHEXT"] ? ENV["PATHEXT"].split(";") : [""]
|
14
|
-
ENV["PATH"].split(File::PATH_SEPARATOR).any? do |path|
|
15
|
-
exts.any? do |ext|
|
16
|
-
exe = File.join(path, "#{name}#{ext}")
|
17
|
-
File.executable?(exe) && !File.directory?(exe)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
|
22
|
-
def self.rust_toolchain
|
23
|
-
str = `rustc --version --verbose`
|
24
|
-
info = str.lines.map {|l| l.chomp.split(/:\s+/, 2)}.drop(1).to_h
|
25
|
-
info["host"]
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.cargo_target_dir
|
29
|
-
return @cargo_target_dir if defined? @cargo_target_dir
|
30
|
-
|
31
|
-
str = `cargo metadata --format-version 1 --offline --no-deps --quiet`
|
32
|
-
begin
|
33
|
-
require "json"
|
34
|
-
dir = JSON.parse(str)["target_directory"]
|
35
|
-
rescue LoadError # json is usually part of the stdlib, but just in case
|
36
|
-
/"target_directory"\s*:\s*"(?<dir>[^"]*)"/ =~ str
|
37
|
-
end
|
38
|
-
@cargo_target_dir = dir || "target"
|
39
|
-
end
|
40
|
-
|
41
|
-
def self.flags
|
42
|
-
cc_flags = Shellwords.split(RbConfig.expand(RbConfig::MAKEFILE_CONFIG["CC"].dup))
|
43
|
-
|
44
|
-
["-C", "linker=#{cc_flags.shift}",
|
45
|
-
*cc_flags.flat_map {|a| ["-C", "link-arg=#{a}"] },
|
46
|
-
"-L", "native=#{RbConfig::CONFIG["libdir"]}",
|
47
|
-
*dld_flags,
|
48
|
-
*platform_flags]
|
49
|
-
end
|
50
|
-
|
51
|
-
def self.dld_flags
|
52
|
-
Shellwords.split(RbConfig::CONFIG["DLDFLAGS"]).flat_map do |arg|
|
53
|
-
arg = arg.gsub(/\$\((\w+)\)/) do
|
54
|
-
$1 == "DEFFILE" ? nil : RbConfig::CONFIG[name]
|
55
|
-
end.strip
|
56
|
-
next [] if arg.empty?
|
57
|
-
|
58
|
-
transform_flag(arg)
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
def self.platform_flags
|
63
|
-
return unless RbConfig::CONFIG["target_os"] =~ /mingw/i
|
64
|
-
|
65
|
-
[*Shellwords.split(RbConfig::CONFIG["LIBRUBYARG"]).flat_map {|arg| transform_flag(arg)},
|
66
|
-
"-C", "link-arg=-Wl,--dynamicbase",
|
67
|
-
"-C", "link-arg=-Wl,--disable-auto-image-base",
|
68
|
-
"-C", "link-arg=-static-libgcc"]
|
69
|
-
end
|
70
|
-
|
71
|
-
def self.transform_flag(arg)
|
72
|
-
k, v = arg.split(/(?<=..)/, 2)
|
73
|
-
case k
|
74
|
-
when "-L"
|
75
|
-
[k, "native=#{v}"]
|
76
|
-
when "-l"
|
77
|
-
[k, v]
|
78
|
-
when "-F"
|
79
|
-
["-l", "framework=#{v}"]
|
80
|
-
else
|
81
|
-
["-C", "link_arg=#{k}#{v}"]
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
def install_dir
|
86
|
-
File.expand_path(File.join("..", "..", "lib", gemname), __dir__)
|
87
|
-
end
|
88
|
-
|
89
|
-
def rust_name
|
90
|
-
prefix = "lib" unless Gem.win_platform?
|
91
|
-
suffix = if RbConfig::CONFIG["target_os"] =~ /darwin/i
|
92
|
-
".dylib"
|
93
|
-
elsif Gem.win_platform?
|
94
|
-
".dll"
|
95
|
-
else
|
96
|
-
".so"
|
97
|
-
end
|
98
|
-
"#{prefix}#{gemname}#{suffix}"
|
99
|
-
end
|
100
|
-
|
101
|
-
def ruby_name
|
102
|
-
"#{gemname}.#{RbConfig::CONFIG["DLEXT"]}"
|
103
|
-
end
|
104
|
-
|
105
|
-
end
|
106
|
-
|
107
|
-
task default: [:install, :clean]
|
108
|
-
|
109
|
-
desc "set dev mode for subsequent task, run like `rake dev install`"
|
110
|
-
task :dev do
|
111
|
-
@dev = true
|
112
|
-
end
|
113
|
-
|
114
|
-
desc "build gem native extension and copy to lib"
|
115
|
-
task install: [:cd, :build] do
|
116
|
-
helper = RakeCargoHelper.new
|
117
|
-
profile_dir = @dev ? "debug" : "release"
|
118
|
-
source = File.join(RakeCargoHelper.cargo_target_dir, profile_dir, helper.rust_name)
|
119
|
-
dest = File.join(helper.install_dir, helper.ruby_name)
|
120
|
-
mkdir_p(helper.install_dir)
|
121
|
-
rm(dest) if File.exist?(dest)
|
122
|
-
cp(source, dest)
|
123
|
-
end
|
124
|
-
|
125
|
-
desc "build gem native extension"
|
126
|
-
task build: [:cargo, :cd] do
|
127
|
-
sh "cargo", "rustc", *(["--locked", "--release"] unless @dev), "--", *RakeCargoHelper.flags
|
128
|
-
end
|
129
|
-
|
130
|
-
desc "clean up release build artifacts"
|
131
|
-
task clean: [:cargo, :cd] do
|
132
|
-
sh "cargo clean --release"
|
133
|
-
end
|
134
|
-
|
135
|
-
desc "clean up build artifacts"
|
136
|
-
task clobber: [:cargo, :cd] do
|
137
|
-
sh "cargo clean"
|
138
|
-
end
|
139
|
-
|
140
|
-
desc "check for cargo"
|
141
|
-
task :cargo do
|
142
|
-
raise <<-MSG unless RakeCargoHelper.command?("cargo")
|
143
|
-
|
144
|
-
This gem requires a Rust compiler and the `cargo' build tool to build the
|
145
|
-
gem's native extension. See https://www.rust-lang.org/tools/install for
|
146
|
-
how to install Rust. `cargo' is usually part of the Rust installation.
|
147
|
-
MSG
|
148
|
-
|
149
|
-
raise <<-MSG if Gem.win_platform? && RakeCargoHelper.rust_toolchain !~ /gnu/
|
150
|
-
|
151
|
-
Found Rust toolchain `#{RakeCargoHelper.rust_toolchain}' but the gem native
|
152
|
-
extension requires the gnu toolchain on Windows.
|
153
|
-
MSG
|
154
|
-
end
|
155
|
-
|
156
|
-
# ensure task is running in the right dir
|
157
|
-
task :cd do
|
158
|
-
cd(__dir__) unless __dir__ == pwd
|
159
|
-
end
|