nokolexbor 0.3.5 → 0.3.6
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/nokolexbor/extconf.rb +9 -5
- data/ext/nokolexbor/nl_node.c +0 -1
- data/lib/nokolexbor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 29411076a95eae20060101aa8a270bfe53a48eda3b6e58cfad6ebe22b184049c
|
4
|
+
data.tar.gz: 920536ad4f69a635cfec9a6dea4d8bbe746c7c97d74c1b1daa6b22c41856d201
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6ca49aa873ee254caf034600fbbb9384a2a4efaa86422e992a7fbb7970107af20541c4309e582c6f8863353209d36cd6e5d56fdb19b52fd54a233a4419202ea
|
7
|
+
data.tar.gz: f4c9413c2cd8683e6cf111d1c966a8511d4d605ec30008f595d2c05b402b028dc8f889c9480d3ff43b0f380e84861b2384c915f9f9cca68b6ad8f510a58a0b0a
|
data/ext/nokolexbor/extconf.rb
CHANGED
@@ -5,6 +5,10 @@ if ENV["CC"]
|
|
5
5
|
RbConfig::CONFIG["CC"] = RbConfig::MAKEFILE_CONFIG["CC"] = ENV["CC"]
|
6
6
|
end
|
7
7
|
|
8
|
+
def windows?
|
9
|
+
RbConfig::CONFIG["target_os"].match?(/mingw|mswin/)
|
10
|
+
end
|
11
|
+
|
8
12
|
# From: https://stackoverflow.com/questions/2108727
|
9
13
|
# Cross-platform way of finding an executable in the $PATH.
|
10
14
|
#
|
@@ -23,9 +27,9 @@ end
|
|
23
27
|
cmake_flags = [ ENV["CMAKE_FLAGS"] ]
|
24
28
|
cmake_flags << "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
|
25
29
|
# Set system name explicitly when cross-compiling
|
26
|
-
cmake_flags << "-DCMAKE_SYSTEM_NAME=Windows -DWIN32=1" if
|
30
|
+
cmake_flags << "-DCMAKE_SYSTEM_NAME=Windows -DWIN32=1" if windows?
|
27
31
|
# On Windows, Ruby-DevKit is MSYS-based, so ensure to use MSYS Makefiles.
|
28
|
-
cmake_flags << "-G \"MSYS Makefiles\"" if
|
32
|
+
cmake_flags << "-G \"MSYS Makefiles\"" if windows? && !ENV['NOKOLEXBOR_CROSS_COMPILE']
|
29
33
|
|
30
34
|
if ENV['NOKOLEXBOR_CROSS_COMPILE']
|
31
35
|
# use the same toolchain for cross-compiling lexbor
|
@@ -74,7 +78,7 @@ end
|
|
74
78
|
|
75
79
|
def self.run_cmake(timeout, args)
|
76
80
|
# Set to process group so we can kill it and its children
|
77
|
-
pgroup = (
|
81
|
+
pgroup = (windows? && !ENV['NOKOLEXBOR_CROSS_COMPILE']) ? :new_pgroup : :pgroup
|
78
82
|
pid = Process.spawn("cmake #{args}", pgroup => true)
|
79
83
|
|
80
84
|
Timeout.timeout(timeout) do
|
@@ -104,7 +108,7 @@ def apply_patch(patch_file, chdir)
|
|
104
108
|
end
|
105
109
|
|
106
110
|
|
107
|
-
MAKE = if
|
111
|
+
MAKE = if windows?
|
108
112
|
# On Windows, Ruby-DevKit only has 'make'.
|
109
113
|
find_executable('make')
|
110
114
|
else
|
@@ -143,7 +147,7 @@ Dir.chdir(EXT_DIR) do
|
|
143
147
|
Dir.mkdir("build") if !Dir.exist?("build")
|
144
148
|
|
145
149
|
Dir.chdir("build") do
|
146
|
-
run_cmake(10 * 60, ".. #{cmake_flags.join(' ')} #{
|
150
|
+
run_cmake(10 * 60, ".. #{cmake_flags.join(' ')} #{windows? ? "-DLIBXML2_WITH_THREADS=OFF" : ""}")
|
147
151
|
end
|
148
152
|
end
|
149
153
|
|
data/ext/nokolexbor/nl_node.c
CHANGED
@@ -383,7 +383,6 @@ nl_node_find(VALUE self, VALUE selector, lxb_selectors_cb_f cb, void *ctx)
|
|
383
383
|
}
|
384
384
|
|
385
385
|
/* Parse and get the log. */
|
386
|
-
// TODO: Cache the list for reuse, improves performance
|
387
386
|
list = lxb_css_selectors_parse_relative_list(parser, (const lxb_char_t *)selector_c, selector_len);
|
388
387
|
if (parser->status != LXB_STATUS_OK) {
|
389
388
|
status = parser->status;
|
data/lib/nokolexbor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokolexbor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yicheng Zhou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|