nokogumbo 1.4.11 → 1.4.12

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/nokogumboc/extconf.rb +32 -8
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2db71be04413780e16757ce18152b4841db79dc8
4
- data.tar.gz: 4b33b6a76a1add1a39615e973218ae89cab22592
3
+ metadata.gz: 2531d6d888b145aff08945f6cd01e269ab97b977
4
+ data.tar.gz: 1d876cca8aeb18e54c7074aa9be64db88b275819
5
5
  SHA512:
6
- metadata.gz: 2f292053fef636c5d57b8f76ecb8a5eda0994149e95a58b5a1968347364050a278a9302f21515bd08c7bf4ce0000f7ae706fca888b1c90b4f3c9f2cdb4c13919
7
- data.tar.gz: fd47e4204807f5d0dc0e7821efdc35a292530a08ba1d878d2b155db34acad33bd0f98c4575e3103ebf29f679f3667f2e14bbbe40305a8cc81a8920c0adf7ce0c
6
+ metadata.gz: cb9902894b518641b85926745be174c6b38cfe9b31706f141f50f24fa2f1268f5486ec8fd7af763c0b90cf72d5c778002237b08efd06f1da15c988eb7d2fac4b
7
+ data.tar.gz: 88813c0e2c4e0a7ba933686302daeb522493448aea4e1086faf9ca58e1d201d6466c869e140d2e5fdcea53b9f799e473e52fd20d41dae3a24429763e8a63ef0e
@@ -1,16 +1,18 @@
1
1
  require 'mkmf'
2
- $CFLAGS += " -std=c99"
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.find_files('nokogiri').
10
- select { |name| name.match(%r{gems/nokogiri-([\d.]+)/lib/nokogiri}) }.
11
- sort_by {|name| name[/nokogiri-([\d.]+)/,1].split('.').map(&:to_i)}.last
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(lib/nokogiri(.rb)?$), 'ext/nokogiri')
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
- "#{rakehome}/ext/nokogumboc"
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
- "#{rakehome}/ext/nokogumboc"
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.11
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-05-16 00:00:00.000000000 Z
11
+ date: 2017-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri