tre_regex 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/tre_regex/extconf.rb +20 -5
- data/lib/tre_regex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 72568bfda4418780d703d9735bb63b6eb37c6fe2cb10a5a27b1aef3bef284b6e
|
|
4
|
+
data.tar.gz: e172ebf3323a6310794ec28bdc33818390ae7952502ee6be1e11561058210d37
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 933fce879337f20025529c80267266928fd13c88a1b12ebad0fc494d3d4f2a6915c5b1c9adbf4b6933d3c65f7cdf48b4efa4fea7d7cbe1a9245a40216da7cc32
|
|
7
|
+
data.tar.gz: ea8a7b855cd42f2cb23761ca6fa24e9744afcc7361cc4fc055323a866678f5e4da82232b13acb3f51265acca02a9454d6d7768904d9288ab4e5dd8431ca787ce
|
data/ext/tre_regex/extconf.rb
CHANGED
|
@@ -6,6 +6,22 @@ require 'open-uri'
|
|
|
6
6
|
require 'net/http'
|
|
7
7
|
require 'fileutils'
|
|
8
8
|
|
|
9
|
+
build_env = {
|
|
10
|
+
'CC' => RbConfig::CONFIG['CC'],
|
|
11
|
+
'CFLAGS' => RbConfig::CONFIG['CFLAGS'],
|
|
12
|
+
'CPPFLAGS' => RbConfig::CONFIG['CPPFLAGS'],
|
|
13
|
+
'LDFLAGS' => RbConfig::CONFIG['LDFLAGS']
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
gnu_host = RbConfig::CONFIG['host_alias']
|
|
17
|
+
gnu_host = RbConfig::CONFIG['host'] if gnu_host.nil? || gnu_host.empty?
|
|
18
|
+
|
|
19
|
+
# Convert 'arm64' to 'aarch64' (Apple Silicon) and 'x64' to 'x86_64' (Windows)
|
|
20
|
+
gnu_host = gnu_host.sub('arm64', 'aarch64').sub(/^x64/, 'x86_64')
|
|
21
|
+
|
|
22
|
+
# Pass the translated, safe name to configure
|
|
23
|
+
host_flag = "--host=#{gnu_host}"
|
|
24
|
+
|
|
9
25
|
is_windows = RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
|
|
10
26
|
is_darwin = RbConfig::CONFIG['host_os'].include?('darwin')
|
|
11
27
|
|
|
@@ -54,15 +70,14 @@ unless Dir.exist?(tre_src_dir)
|
|
|
54
70
|
end
|
|
55
71
|
|
|
56
72
|
# Build TRE synchronously using Ruby
|
|
57
|
-
host_flag = enable_config('cross-build') ? "--host=#{RbConfig::CONFIG['host']} " : ''
|
|
58
|
-
RbConfig::CONFIG['SOEXT'] || RbConfig::CONFIG['DLEXT'] || (is_windows ? 'dll' : 'so')
|
|
59
73
|
|
|
60
74
|
puts '========== Building TRE =========='
|
|
61
75
|
Dir.chdir(tre_src_dir) do
|
|
62
|
-
system('./utils/autogen.sh') || raise('autogen.sh failed') unless File.exist?('configure')
|
|
76
|
+
system(build_env, './utils/autogen.sh') || raise('autogen.sh failed') unless File.exist?('configure')
|
|
63
77
|
|
|
64
|
-
system("./configure #{host_flag} --enable-shared --disable-static --disable-agrep") ||
|
|
65
|
-
|
|
78
|
+
system(build_env, "./configure #{host_flag} --enable-shared --disable-static --disable-agrep") ||
|
|
79
|
+
raise('configure failed')
|
|
80
|
+
system(build_env, 'make') || raise('make failed')
|
|
66
81
|
end
|
|
67
82
|
|
|
68
83
|
puts '========== Staging Shared Library for FFI =========='
|
data/lib/tre_regex/version.rb
CHANGED