nokogumbo 1.4.11 → 1.4.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/nokogumboc/extconf.rb +32 -8
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2531d6d888b145aff08945f6cd01e269ab97b977
|
4
|
+
data.tar.gz: 1d876cca8aeb18e54c7074aa9be64db88b275819
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cb9902894b518641b85926745be174c6b38cfe9b31706f141f50f24fa2f1268f5486ec8fd7af763c0b90cf72d5c778002237b08efd06f1da15c988eb7d2fac4b
|
7
|
+
data.tar.gz: 88813c0e2c4e0a7ba933686302daeb522493448aea4e1086faf9ca58e1d201d6466c869e140d2e5fdcea53b9f799e473e52fd20d41dae3a24429763e8a63ef0e
|
data/ext/nokogumboc/extconf.rb
CHANGED
@@ -1,16 +1,18 @@
|
|
1
1
|
require 'mkmf'
|
2
|
-
$CFLAGS +=
|
2
|
+
$CFLAGS += ' -std=c99'
|
3
3
|
|
4
|
-
if have_library('xml2', 'xmlNewDoc')
|
4
|
+
if have_library('xml2', 'xmlNewDoc')
|
5
5
|
# libxml2 libraries from http://www.xmlsoft.org/
|
6
6
|
pkg_config('libxml-2.0')
|
7
7
|
|
8
8
|
# nokogiri configuration from gem install
|
9
|
-
nokogiri_lib = Gem
|
10
|
-
|
11
|
-
|
9
|
+
nokogiri_lib = Gem
|
10
|
+
.find_files('nokogiri')
|
11
|
+
.select { |name| name.match(%r{gems/nokogiri-([\d.]+)/lib/nokogiri}) }
|
12
|
+
.sort_by { |name| name[/nokogiri-([\d.]+)/, 1].split('.').map(&:to_i) }
|
13
|
+
.last
|
12
14
|
if nokogiri_lib
|
13
|
-
nokogiri_ext = nokogiri_lib.sub(%r
|
15
|
+
nokogiri_ext = nokogiri_lib.sub(%r{lib/nokogiri(.rb)?$}, 'ext/nokogiri')
|
14
16
|
|
15
17
|
# if that doesn't work, try workarounds found in Nokogiri's extconf
|
16
18
|
unless find_header('nokogiri.h', nokogiri_ext)
|
@@ -19,6 +21,28 @@ if have_library('xml2', 'xmlNewDoc')
|
|
19
21
|
|
20
22
|
# if found, enable direct calls to Nokogiri (and libxml2)
|
21
23
|
$CFLAGS += ' -DNGLIB' if find_header('nokogiri.h', nokogiri_ext)
|
24
|
+
|
25
|
+
# If libnokogiri is not on the build path, we need to add it.
|
26
|
+
unless have_library('nokogiri', 'Nokogiri_wrap_xml_document')
|
27
|
+
nokogiri_libfile = 'nokogiri.' + RbConfig::CONFIG['DLEXT']
|
28
|
+
nokogiri_libpath = File.join(nokogiri_ext, nokogiri_libfile)
|
29
|
+
if File.exist? nokogiri_libpath
|
30
|
+
$LDFLAGS += " -Wl,-rpath #{nokogiri_ext} -L#{nokogiri_ext} "
|
31
|
+
# GNU ld:
|
32
|
+
# '-lFOO' => looks for a file named 'libFOO.a' or 'libFOO.so*'
|
33
|
+
# '-l:FOO' => looks for a file named exactly 'FOO'
|
34
|
+
# OSX/Mach ld:
|
35
|
+
# - '-l:' is not supported.
|
36
|
+
# - Only links '.dylib', not '.bundle'
|
37
|
+
#
|
38
|
+
# Nokogiri does NOT have a lib prefix, so we need to be creative in
|
39
|
+
# testing; and might have either .dylib or .bundle suffixes.
|
40
|
+
$LIBS += ' ' + nokogiri_libpath + ' ' \
|
41
|
+
if %w(so dylib).include? RbConfig::CONFIG['DLEXT']
|
42
|
+
else
|
43
|
+
puts 'WARNING! Could not find Nokogiri_wrap_xml_document symbol; build might fail.'
|
44
|
+
end
|
45
|
+
end
|
22
46
|
end
|
23
47
|
end
|
24
48
|
|
@@ -28,12 +52,12 @@ unless have_library('gumbo', 'gumbo_parse')
|
|
28
52
|
unless File.exist? "#{rakehome}/ext/nokogumboc/gumbo.h"
|
29
53
|
require 'fileutils'
|
30
54
|
FileUtils.cp Dir["#{rakehome}/gumbo-parser/src/*"],
|
31
|
-
|
55
|
+
"#{rakehome}/ext/nokogumboc"
|
32
56
|
|
33
57
|
case RbConfig::CONFIG['target_os']
|
34
58
|
when 'mingw32', /mswin/
|
35
59
|
FileUtils.cp Dir["#{rakehome}/gumbo-parser/visualc/include/*"],
|
36
|
-
|
60
|
+
"#{rakehome}/ext/nokogumboc"
|
37
61
|
end
|
38
62
|
|
39
63
|
$srcs = $objs = nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nokogumbo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Ruby
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|