nokogiri 1.6.2.rc3-java → 1.6.2.1-java

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of nokogiri might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0dfa0556a5cd5aa7896420b87b700daeb9f93e78
4
- data.tar.gz: dd9a7086d2ee770791d40f7791417ad3d1d5d5d2
3
+ metadata.gz: 86e7f8df4f2ded92061f78e5de04e32b30968a4d
4
+ data.tar.gz: 53bd91a477753dfd493b81fad44ae7ca235d19c0
5
5
  SHA512:
6
- metadata.gz: cd80730fb14c2140c9f9865c2c097ef8999f4a627fde6497c7ba694380256af7e81902900f989df185018a2fdda7af878254841ecea6bcf109ad9f97dff7f3a7
7
- data.tar.gz: de6cc13b34efd97c9fd4be5bd4728d5e5225de7f1d4360d11fbda86c058f153f1f0543f25d9640dac1bd05fc11f3b117d903844df6d37e3b2fa68745e68ad891
6
+ metadata.gz: 4faeceb14d3a2ab3feb8f6092281bc0c254b6c2908f9ff8d3d30c039c0643f0ac94d0fd9ea35e303decad55596d37030d3c6e4cb830b96d4c4f1f3764941f1d8
7
+ data.tar.gz: a46e13fb03da556e98a9d7822df48315993799c4f446d57f7dd51eae65cbba5e7aa22962e2a71d675b1a67fba4fa7b75215d602481a9c25223d3eee1f39062d4
@@ -1,47 +1,66 @@
1
- === 1.6.2 / 未リリース
2
-
3
- *
4
-
5
- * Now requires libxml >= 2.6.21 (was previously >= 2.6.17).
6
-
7
- * 機能
8
-
9
- * Add cross building of fat binary gems for 64-Bit Windows (x64-mingw32)
10
- and add support for native builds on Windows. #864, #989, #1072
11
- * (MRI) iconvが Windows-31J をサポートしていない場合は CP932 のエイリアスとして扱うようにした #836
12
- * (MRI) 同梱ライブラリを静的にリンクするようになった (静的リンクをオフにするにはextconf.rbに --disable-static を渡す) #923
13
- * (MRI) CRubyのバグ #9760 に起因するライブラリパス(LIBPATH)の優先順位問題に対応した
14
- * (MRI) 同梱ライブラリのビルド後に不要になったディレクトリ群を自動的に削除するようになった (デバッグ等の目的で残すようにするにはextconf.rbに --disable-clean を渡す) #952
15
- * (MRI) FreeBSDなど、libiconvがシステム標準ディレクトリ外にある環境でlibxml2がiconvサポート付きで正しくビルドされるようになった
16
- * nthセレクタにおいてan-bを認識するようになった #886 (Magnus Bergmarkに感謝!)
17
- * :not疑似クラスが、先行セレクタがない場合や複数重ねられた場合にも対応した #887 (Magnus Bergmarkに感謝!)
18
- * (MRI) extconf.rb のオプション --use-system-libraries を追加
19
- 環境変数 NOKOGIRI_USE_SYSTEM_LIBRARIES を設定する代わりに使える
20
- * (MRI) 同梱の libxslt 1.1.28 に、 zlib 1.2.8 に、 libiconv を 1.14 にそれぞれ更新した
21
- * Nokogiri::HTML::Document#title= 及び #meta_encoding= は、head要素がない場合でも常に、最適な場所を探しつつ要素を追加するようになった
22
- * Nokogiri::XML::DTD#html_dtd? と #html5_dtd? を追加
23
- * Nokogiri::XML::Node#prepend_child を追加 #664
24
- * Nokogiri::XML::SAX::ParserContext#recovery is added. #453
25
-
26
- * バグ修正
27
-
28
- * :only-child疑似クラスが:not疑似クラスの中にある場合に正常な動作が行われるようになった #858 (Yamagishi Kazutoshiに感謝!)
29
- * 同梱のライブラリを使う場合にはextconf.rbでpkg_configを呼ばなくなった #931 (Shota Fukumoriに感謝!)
30
- * Nokogiri.parse()がRSS文書などをHTML文書として誤認する問題を修正 #932 (Yamagishi Kazutoshiに感謝!)
31
- * (MRI) ノードに対して子ノードを追加する際、ノードタイプをチェックするようにした。従来はテキストノードに別のテキストノードを追加する操作によりSEGVが発生していた。 #1092
32
- * (JRuby) XSD validation crashes in Java version. #373
33
- * (JRuby) Document already has a root node error while using Builder. #646
34
- * (JRuby) c14n tests are all passing on JRuby. #226
35
- * Parsing empty documents raise SyntaxError in strict mode. #1005
36
- * (JRuby) Make xpath faster by caching the xpath context. #741
37
- * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
38
- * (JRUby) JRubyによるディフォルトネームスペースエイリアスの振る舞いがCRubyと同じではない。#940
39
- * (JRuby) JRubyによるネームスペースのパースと追加の振る舞いが一致していない。 #943
40
- * (JRuby) Builderで作ったドキュメントとクローンしたドキュメントではXpathの結果が違う。#1034
41
- * (JRuby) Javaの実装はネームスペースを忘れることがある。 #902
42
- * (JRuby) JRuby-Nokogiriはネームスペーススコープ内のアトリビュートを正しく認識しない。#1081
43
- * (JRuby) JRuby-Nokogiriはコメントノードの名前が違う。#1080
44
- * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processingに問題がある。 #1070
1
+ === 1.6.2.1 / 2014年5月13日
2
+
3
+ ==== バグ修正
4
+
5
+ * Fix statically-linked libxml2 installation when using universal builds of Ruby. #1104
6
+ * Patching `mini_portile` to address the git dependency detailed in #1102.
7
+ * Library load fix to address segfault reported on some systems. #1097
8
+
9
+
10
+ === 1.6.2 / 2014年5月12日
11
+
12
+ ==== Security
13
+
14
+ A set of security and bugfix patches have been backported from the libxml2 and libxslt repositories onto the version of 2.8.0 packaged with Nokogiri, including these notable security fixes:
15
+
16
+ * https://git.gnome.org/browse/libxml2/commit/?id=4629ee02ac649c27f9c0cf98ba017c6b5526070f
17
+ * CVE-2013-2877 https://git.gnome.org/browse/libxml2/commit/?id=e50ba8164eee06461c73cd8abb9b46aa0be81869
18
+ * CVE-2014-0191 https://git.gnome.org/browse/libxml2/commit/?id=9cd1c3cfbd32655d60572c0a413e017260c854df
19
+
20
+ It is recommended that you upgrade from 1.6.x to this version as soon as possible.
21
+
22
+ ==== Compatibility
23
+
24
+ Now requires libxml >= 2.6.21 (was previously >= 2.6.17).
25
+
26
+ ==== 機能
27
+
28
+ * Add cross building of fat binary gems for 64-Bit Windows (x64-mingw32)
29
+ and add support for native builds on Windows. #864, #989, #1072
30
+ * (MRI) iconvWindows-31J をサポートしていない場合は CP932 のエイリアスとして扱うようにした #836
31
+ * (MRI) 同梱ライブラリを静的にリンクするようになった (静的リンクをオフにするにはextconf.rbに --disable-static を渡す) #923
32
+ * (MRI) CRubyのバグ #9760 に起因するライブラリパス(LIBPATH)の優先順位問題に対応した
33
+ * (MRI) 同梱ライブラリのビルド後に不要になったディレクトリ群を自動的に削除するようになった (デバッグ等の目的で残すようにするにはextconf.rbに --disable-clean を渡す) #952
34
+ * (MRI) FreeBSDなど、libiconvがシステム標準ディレクトリ外にある環境でlibxml2がiconvサポート付きで正しくビルドされるようになった
35
+ * nthセレクタにおいてan-bを認識するようになった #886 (Magnus Bergmarkに感謝!)
36
+ * :not疑似クラスが、先行セレクタがない場合や複数重ねられた場合にも対応した #887 (Magnus Bergmarkに感謝!)
37
+ * (MRI) extconf.rb のオプション --use-system-libraries を追加
38
+ 環境変数 NOKOGIRI_USE_SYSTEM_LIBRARIES を設定する代わりに使える
39
+ * (MRI) 同梱の libxslt を 1.1.28 に、 zlib を 1.2.8 に、 libiconv を 1.14 にそれぞれ更新した
40
+ * Nokogiri::HTML::Document#title= 及び #meta_encoding= は、head要素がない場合でも常に、最適な場所を探しつつ要素を追加するようになった
41
+ * Nokogiri::XML::DTD#html_dtd? #html5_dtd? を追加
42
+ * Nokogiri::XML::Node#prepend_child を追加 #664
43
+ * Nokogiri::XML::SAX::ParserContext#recovery is added. #453
44
+
45
+ ==== バグ修正
46
+
47
+ * :only-child疑似クラスが:not疑似クラスの中にある場合に正常な動作が行われるようになった #858 (Yamagishi Kazutoshiに感謝!)
48
+ * 同梱のライブラリを使う場合にはextconf.rbでpkg_configを呼ばなくなった #931 (Shota Fukumoriに感謝!)
49
+ * Nokogiri.parse()がRSS文書などをHTML文書として誤認する問題を修正 #932 (Yamagishi Kazutoshiに感謝!)
50
+ * (MRI) ノードに対して子ノードを追加する際、ノードタイプをチェックするようにした。従来はテキストノードに別のテキストノードを追加する操作によりSEGVが発生していた。 #1092
51
+ * (JRuby) XSD validation crashes in Java version. #373
52
+ * (JRuby) Document already has a root node error while using Builder. #646
53
+ * (JRuby) c14n tests are all passing on JRuby. #226
54
+ * Parsing empty documents raise SyntaxError in strict mode. #1005
55
+ * (JRuby) Make xpath faster by caching the xpath context. #741
56
+ * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
57
+ * (JRUby) JRubyによるディフォルトネームスペースエイリアスの振る舞いがCRubyと同じではない。#940
58
+ * (JRuby) JRubyによるネームスペースのパースと追加の振る舞いが一致していない。 #943
59
+ * (JRuby) Builderで作ったドキュメントとクローンしたドキュメントではXpathの結果が違う。#1034
60
+ * (JRuby) Javaの実装はネームスペースを忘れることがある。 #902
61
+ * (JRuby) JRuby-Nokogiriはネームスペーススコープ内のアトリビュートを正しく認識しない。#1081
62
+ * (JRuby) JRuby-Nokogiriはコメントノードの名前が違う。#1080
63
+ * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processingに問題がある。 #1070
45
64
 
46
65
  === 1.6.1 / 2013年12月14日
47
66
 
@@ -1,63 +1,66 @@
1
- === 1.6.2 / unreleased
2
-
3
- * Notes
4
-
5
- * Now requires libxml >= 2.6.21 (was previously >= 2.6.17).
6
-
7
- * Features
8
-
9
- * Add cross building of fat binary gems for 64-Bit Windows (x64-mingw32)
10
- and add support for native builds on Windows. #864, #989, #1072
11
- * (MRI) Alias CP932 to Windows-31J if iconv does not support Windows-31J.
12
- * (MRI) Nokogiri now links packaged libraries statically. To
13
- disable static linking, pass --disable-static to extconf.rb. #923
14
- * (MRI) Fix a library path (LIBPATH) precedence problem caused by CRuby
15
- bug #9760.
16
- * (MRI) Nokogiri automatically deletes directories of packaged
17
- libraries only used during build. To keep them for debugging
18
- purposes, pass --disable-clean to extconf.rb. #952
19
- * (MRI) Nokogiri now builds libxml2 properly with iconv support on
20
- platforms where libiconv is installed outside the system default
21
- directories, such as FreeBSD.
22
- * Add support for an-b in nth selectors. #886 (Thanks, Magnus Bergmark!)
23
- * Add support for bare and multiple :not() functions in selectors. #887
24
- (Thanks, Magnus Bergmark!)
25
- * (MRI) Add an extconf.rb option --use-system-libraries, alternative to
26
- setting the environment variable NOKOGIRI_USE_SYSTEM_LIBRARIES.
27
- * (MRI) Update packaged libraries: libxslt to 1.1.28, zlib to 1.2.8,
28
- and libiconv to 1.14, respectively.
29
- * Nokogiri::HTML::Document#title= and #meta_encoding= now always add
30
- an element if not present, trying hard to find the best place to
31
- put it.
32
- * Nokogiri::XML::DTD#html_dtd? and #html5_dtd? are added.
33
- * Nokogiri::XML::Node#prepend_child is added. #664
34
- * Nokogiri::XML::SAX::ParserContext#recovery is added. #453
35
- * Fix documentation for XML::Node#namespace. #803 #802 (Thanks, Hoylen Sue)
36
- * Allow Nokogiri::XML::Node#parse from unparented non-element nodes. #407
37
-
38
- * Bugfixes
39
-
40
- * Ensure :only-child pseudo class works within :not pseudo class. #858
41
- (Thanks, Yamagishi Kazutoshi!)
42
- * Don't call pkg_config when using bundled libraries in extconf.rb
43
- #931 (Thanks, Shota Fukumori!)
44
- * Nokogiri.parse() does not mistake a non-HTML document like a RSS
45
- document as HTML document. #932 (Thanks, Yamagishi Kazutoshi!)
46
- * (MRI) Perform a node type check before adding a child node to another. Previously adding a text node to another as a child could cause a SEGV. #1092
47
- * (JRuby) XSD validation crashes in Java version. #373
48
- * (JRuby) Document already has a root node error while using Builder. #646
49
- * (JRuby) c14n tests are all passing on JRuby. #226
50
- * Parsing empty documents raise SyntaxError in strict mode. #1005
51
- * (JRuby) Make xpath faster by caching the xpath context. #741
52
- * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
53
- * (JRUby) Inconsistent behavior aliasing the default namespace. #940
54
- * (JRuby) Inconsistent behavior between parsing and adding namespaces. #943
55
- * (JRuby) Xpath returns inconsistent result set on cloned document with
56
- namespaces and attributes. #1034
57
- * (JRuby) Java-Implementation forgets element namespaces #902
58
- * (JRuby) JRuby-Nokogiri does not recognise attributes inside namespaces #1081
59
- * (JRuby) JRuby-Nokogiri has different comment node name #1080
60
- * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processing #1070
1
+ === 1.6.2.1 / 2014-05-13
2
+
3
+ ==== Bug fixes
4
+
5
+ * Fix statically-linked libxml2 installation when using universal builds of Ruby. #1104
6
+ * Patching `mini_portile` to address the git dependency detailed in #1102.
7
+ * Library load fix to address segfault reported on some systems. #1097
8
+
9
+
10
+ === 1.6.2 / 2014-05-12
11
+
12
+ ==== Security Note
13
+
14
+ A set of security and bugfix patches have been backported from the libxml2 and libxslt repositories onto the version of 2.8.0 packaged with Nokogiri, including these notable security fixes:
15
+
16
+ * https://git.gnome.org/browse/libxml2/commit/?id=4629ee02ac649c27f9c0cf98ba017c6b5526070f
17
+ * CVE-2013-2877 https://git.gnome.org/browse/libxml2/commit/?id=e50ba8164eee06461c73cd8abb9b46aa0be81869
18
+ * CVE-2014-0191 https://git.gnome.org/browse/libxml2/commit/?id=9cd1c3cfbd32655d60572c0a413e017260c854df
19
+
20
+ It is recommended that you upgrade from 1.6.x to this version as soon as possible.
21
+
22
+ ==== Compatibility Note
23
+
24
+ Now requires libxml >= 2.6.21 (was previously >= 2.6.17).
25
+
26
+ ==== Features
27
+
28
+ * Add cross building of fat binary gems for 64-Bit Windows (x64-mingw32) and add support for native builds on Windows. #864, #989, #1072
29
+ * (MRI) Alias CP932 to Windows-31J if iconv does not support Windows-31J.
30
+ * (MRI) Nokogiri now links packaged libraries statically. To disable static linking, pass --disable-static to extconf.rb. #923
31
+ * (MRI) Fix a library path (LIBPATH) precedence problem caused by CRuby bug #9760.
32
+ * (MRI) Nokogiri automatically deletes directories of packaged libraries only used during build. To keep them for debugging purposes, pass --disable-clean to extconf.rb. #952
33
+ * (MRI) Nokogiri now builds libxml2 properly with iconv support on platforms where libiconv is installed outside the system default directories, such as FreeBSD.
34
+ * Add support for an-b in nth selectors. #886 (Thanks, Magnus Bergmark!)
35
+ * Add support for bare and multiple :not() functions in selectors. #887 (Thanks, Magnus Bergmark!)
36
+ * (MRI) Add an extconf.rb option --use-system-libraries, alternative to setting the environment variable NOKOGIRI_USE_SYSTEM_LIBRARIES.
37
+ * (MRI) Update packaged libraries: libxslt to 1.1.28, zlib to 1.2.8, and libiconv to 1.14, respectively.
38
+ * Nokogiri::HTML::Document#title= and #meta_encoding= now always add an element if not present, trying hard to find the best place to put it.
39
+ * Nokogiri::XML::DTD#html_dtd? and #html5_dtd? are added.
40
+ * Nokogiri::XML::Node#prepend_child is added. #664
41
+ * Nokogiri::XML::SAX::ParserContext#recovery is added. #453
42
+ * Fix documentation for XML::Node#namespace. #803 #802 (Thanks, Hoylen Sue)
43
+ * Allow Nokogiri::XML::Node#parse from unparented non-element nodes. #407
44
+
45
+ ==== Bugfixes
46
+
47
+ * Ensure :only-child pseudo class works within :not pseudo class. #858 (Thanks, Yamagishi Kazutoshi!)
48
+ * Don't call pkg_config when using bundled libraries in extconf.rb #931 (Thanks, Shota Fukumori!)
49
+ * Nokogiri.parse() does not mistake a non-HTML document like a RSS document as HTML document. #932 (Thanks, Yamagishi Kazutoshi!)
50
+ * (MRI) Perform a node type check before adding a child node to another. Previously adding a text node to another as a child could cause a SEGV. #1092
51
+ * (JRuby) XSD validation crashes in Java version. #373
52
+ * (JRuby) Document already has a root node error while using Builder. #646
53
+ * (JRuby) c14n tests are all passing on JRuby. #226
54
+ * Parsing empty documents raise SyntaxError in strict mode. #1005
55
+ * (JRuby) Make xpath faster by caching the xpath context. #741
56
+ * (JRuby) XML SAX push parser leaks memory on JRuby, but not on MRI. #998
57
+ * (JRuby) Inconsistent behavior aliasing the default namespace. #940
58
+ * (JRuby) Inconsistent behavior between parsing and adding namespaces. #943
59
+ * (JRuby) Xpath returns inconsistent result set on cloned document with namespaces and attributes. #1034
60
+ * (JRuby) Java-Implementation forgets element namespaces #902
61
+ * (JRuby) JRuby-Nokogiri does not recognise attributes inside namespaces #1081
62
+ * (JRuby) JRuby-Nokogiri has different comment node name #1080
63
+ * (JRuby) JAXPExtensionsProvider / Java 7 / Secure Processing #1070
61
64
 
62
65
  === 1.6.1 / 2013-12-14
63
66
 
data/Gemfile CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  source "https://rubygems.org/"
6
6
 
7
- gem "mini_portile", "~>0.5.2"
7
+ gem "mini_portile", "=0.6.0"
8
8
 
9
9
  gem "rdoc", "~>4.0", :group => [:development, :test]
10
10
  gem "hoe-bundler", ">=1.1", :group => [:development, :test]
@@ -248,6 +248,8 @@ ports/patches/libxml2/0006-Do-not-fetch-external-parsed-entities.patch
248
248
  ports/patches/libxml2/0007-Enforce-XML_PARSER_EOF-state-handling-through-the-pa.patch
249
249
  ports/patches/libxml2/0008-Improve-handling-of-xmlStopParser.patch
250
250
  ports/patches/libxml2/0009-Fix-a-couple-of-return-without-value.patch
251
+ ports/patches/libxml2/0010-Keep-non-significant-blanks-node-in-HTML-parser.patch
252
+ ports/patches/libxml2/0011-Do-not-fetch-external-parameter-entities.patch
251
253
  ports/patches/libxslt/0001-Adding-doc-update-related-to-1.1.28.patch
252
254
  ports/patches/libxslt/0002-Fix-a-couple-of-places-where-f-printf-parameters-wer.patch
253
255
  ports/patches/libxslt/0003-Initialize-pseudo-random-number-generator-with-curre.patch
@@ -295,6 +297,7 @@ test/files/saml/xmldsig_schema.xsd
295
297
  test/files/shift_jis.html
296
298
  test/files/shift_jis.xml
297
299
  test/files/shift_jis_no_charset.html
300
+ test/files/slow-xpath.xml
298
301
  test/files/snuggles.xml
299
302
  test/files/staff.dtd
300
303
  test/files/staff.xml
@@ -318,9 +321,12 @@ test/html/test_named_characters.rb
318
321
  test/html/test_node.rb
319
322
  test/html/test_node_encoding.rb
320
323
  test/namespaces/test_additional_namespaces_in_builder_doc.rb
324
+ test/namespaces/test_namespaces_aliased_default.rb
321
325
  test/namespaces/test_namespaces_in_builder_doc.rb
326
+ test/namespaces/test_namespaces_in_cloned_doc.rb
322
327
  test/namespaces/test_namespaces_in_created_doc.rb
323
328
  test/namespaces/test_namespaces_in_parsed_doc.rb
329
+ test/namespaces/test_namespaces_preservation.rb
324
330
  test/test_convert_xpath.rb
325
331
  test/test_css_cache.rb
326
332
  test/test_encoding_handler.rb
@@ -1,9 +1,8 @@
1
1
  = Nokogiri (鋸) {<img src="https://secure.travis-ci.org/sparklemotion/nokogiri.png?rvm=1.9.3" />}[http://travis-ci.org/sparklemotion/nokogiri] {<img src="https://codeclimate.com/badge.png" />}[https://codeclimate.com/github/sparklemotion/nokogiri]
2
2
 
3
- * http://nokogiri.org/
4
- * https://github.com/sparklemotion/nokogiri/wikis
5
- * https://github.com/sparklemotion/nokogiri/tree/master
6
- * https://groups.google.com/group/nokogiri-list
3
+ * http://nokogiri.org
4
+ * https://github.com/sparklemotion/nokogiri
5
+ * https://groups.google.com/group/nokogiri-talk
7
6
  * https://github.com/sparklemotion/nokogiri/issues
8
7
 
9
8
  == DESCRIPTION:
@@ -1,7 +1,7 @@
1
1
  = Nokogiri {<img src="https://secure.travis-ci.org/sparklemotion/nokogiri.png?rvm=1.9.3" />}[http://travis-ci.org/sparklemotion/nokogiri] {<img src="https://codeclimate.com/github/sparklemotion/nokogiri.png" />}[https://codeclimate.com/github/sparklemotion/nokogiri] {<img src="https://www.versioneye.com/ruby/nokogiri/badge.png" alt="Dependency Status" />}[https://www.versioneye.com/ruby/nokogiri]
2
+
2
3
  * http://nokogiri.org
3
- * https://github.com/sparklemotion/nokogiri/wikis
4
- * https://github.com/sparklemotion/nokogiri/tree/master
4
+ * https://github.com/sparklemotion/nokogiri
5
5
  * https://groups.google.com/group/nokogiri-talk
6
6
  * https://github.com/sparklemotion/nokogiri/issues
7
7
 
data/Rakefile CHANGED
@@ -132,7 +132,11 @@ HOE = Hoe.spec 'nokogiri' do
132
132
 
133
133
  unless java?
134
134
  self.extra_deps += [
135
- ["mini_portile", "~> 0.5.2"],
135
+ # this dependency locked because we're monkey-punching mini_portile.
136
+ # for more details, see:
137
+ # - https://github.com/sparklemotion/nokogiri/issues/1102
138
+ # - https://github.com/luislavena/mini_portile/issues/32
139
+ ["mini_portile", "= 0.6.0"],
136
140
  ]
137
141
  end
138
142
 
@@ -3,7 +3,13 @@ ENV['RC_ARCHS'] = '' if RUBY_PLATFORM =~ /darwin/
3
3
 
4
4
  require 'mkmf'
5
5
 
6
- if arg_config('--help')
6
+ ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
7
+
8
+ #
9
+ # functions
10
+ #
11
+
12
+ def do_help
7
13
  print <<HELP
8
14
  usage: ruby #{$0} [options]
9
15
 
@@ -44,28 +50,7 @@ def message!(important_message)
44
50
  rescue Errno::ENXIO
45
51
  end
46
52
 
47
- RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
48
-
49
- ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
50
- # Workaround for Ruby bug #8074, introduced in Ruby 2.0.0, fixed in Ruby 2.1.0
51
- # https://bugs.ruby-lang.org/issues/8074
52
- @libdir_basename = "lib" if RUBY_VERSION < '2.1.0'
53
-
54
- # Workaround for Ruby bug #9760, will be fixed in Ruby 2.2
55
- class Array
56
- alias orig_or |
57
-
58
- def | other
59
- if self.equal?($DEFLIBPATH) && other.equal?($LIBPATH)
60
- # Make sure library directories we set take precedence over $(libdir)
61
- other.orig_or(self)
62
- else
63
- self.orig_or(other)
64
- end
65
- end
66
- end if RUBY_VERSION < '2.2.0'
67
-
68
- if arg_config('--clean')
53
+ def do_clean
69
54
  require 'pathname'
70
55
  require 'fileutils'
71
56
 
@@ -93,16 +78,9 @@ if arg_config('--clean')
93
78
  end
94
79
  end
95
80
 
96
- exit
97
- end
98
-
99
- if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
100
- $LIBRUBYARG_STATIC.gsub!(/-static/, '')
81
+ exit! 0
101
82
  end
102
83
 
103
- $CFLAGS << " #{ENV["CFLAGS"]}"
104
- $LIBS << " #{ENV["LIBS"]}"
105
-
106
84
  def preserving_globals
107
85
  values = [
108
86
  $arg_config,
@@ -180,14 +158,32 @@ def process_recipe(name, version, static_p, cross_p)
180
158
  recipe.host = RbConfig::CONFIG["host_alias"].empty? ? RbConfig::CONFIG["host"] : RbConfig::CONFIG["host_alias"]
181
159
  recipe.patch_files = Dir[File.join(portsdir, "patches", name, "*.patch")].sort
182
160
 
161
+ yield recipe
162
+
163
+ env = Hash.new { |hash, key|
164
+ hash[key] = "#{ENV[key]}" # (ENV[key].dup rescue '')
165
+ }
166
+
167
+ recipe.configure_options.flatten!
168
+
169
+ recipe.configure_options.delete_if { |option|
170
+ case option.shellsplit.first
171
+ when /\A(\w+)=(.*)\z/
172
+ env[$1] = $2
173
+ true
174
+ else
175
+ false
176
+ end
177
+ }
178
+
183
179
  if static_p
184
- recipe.configure_options = [
180
+ recipe.configure_options += [
185
181
  "--disable-shared",
186
182
  "--enable-static",
187
- "CFLAGS='-fPIC #{ENV["CFLAGS"]}'",
188
183
  ]
184
+ env['CFLAGS'] = "-fPIC #{env['CFLAGS']}"
189
185
  else
190
- recipe.configure_options = [
186
+ recipe.configure_options += [
191
187
  "--enable-shared",
192
188
  "--disable-static",
193
189
  ]
@@ -200,7 +196,17 @@ def process_recipe(name, version, static_p, cross_p)
200
196
  ]
201
197
  end
202
198
 
203
- yield recipe
199
+ if RbConfig::CONFIG['target_cpu'] == 'universal'
200
+ %w[CFLAGS LDFLAGS].each { |key|
201
+ unless env[key].shellsplit.include?('-arch')
202
+ env[key] << ' ' << RbConfig::CONFIG['ARCH_FLAG']
203
+ end
204
+ }
205
+ end
206
+
207
+ recipe.configure_options += env.map { |key, value|
208
+ "#{key}=#{value}".shellescape
209
+ }
204
210
 
205
211
  if recipe.patch_files.empty?
206
212
  message! "Building #{name}-#{version} for nokogiri.\n"
@@ -251,6 +257,54 @@ XPath optimization bugs.
251
257
  end
252
258
  end
253
259
 
260
+ def lib_a(ldflag)
261
+ case ldflag
262
+ when /\A-l(.+)/
263
+ "lib#{$1}.#{$LIBEXT}"
264
+ end
265
+ end
266
+
267
+ #
268
+ # monkey patches
269
+ #
270
+
271
+ # Workaround for Ruby bug #8074, introduced in Ruby 2.0.0, fixed in Ruby 2.1.0
272
+ # https://bugs.ruby-lang.org/issues/8074
273
+ @libdir_basename = "lib" if RUBY_VERSION < '2.1.0'
274
+
275
+ # Workaround for #1102
276
+ def monkey_patch_mini_portile
277
+ MiniPortile.class_eval do
278
+ def patch
279
+ @patch_files.each do |full_path|
280
+ next unless File.exists?(full_path)
281
+ output "Running patch with #{full_path}..."
282
+ execute('patch', %Q(patch -p1 < #{full_path}))
283
+ end
284
+ end
285
+ end
286
+ end
287
+
288
+ #
289
+ # main
290
+ #
291
+
292
+ case
293
+ when arg_config('--help')
294
+ do_help
295
+ when arg_config('--clean')
296
+ do_clean
297
+ end
298
+
299
+ RbConfig::MAKEFILE_CONFIG['CC'] = ENV['CC'] if ENV['CC']
300
+
301
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby'
302
+ $LIBRUBYARG_STATIC.gsub!(/-static/, '')
303
+ end
304
+
305
+ $CFLAGS << " #{ENV["CFLAGS"]}"
306
+ $LIBS << " #{ENV["LIBS"]}"
307
+
254
308
  case RbConfig::CONFIG['target_os']
255
309
  when 'mingw32', /mswin/
256
310
  windows_p = true
@@ -304,6 +358,7 @@ else
304
358
  message! "Building nokogiri using packaged libraries.\n"
305
359
 
306
360
  require 'mini_portile'
361
+ monkey_patch_mini_portile
307
362
  require 'yaml'
308
363
 
309
364
  static_p = enable_config('static', true) or
@@ -433,24 +488,16 @@ else
433
488
  }.shelljoin
434
489
 
435
490
  if static_p
436
- message 'checking for linker flags for static linking... '
437
-
438
- case
439
- when try_link('int main(void) { return 0; }',
440
- ['-Wl,-Bstatic', '-lxml2', '-Wl,-Bdynamic'].shelljoin)
441
- message "-Wl,-Bstatic\n"
442
-
443
- $libs = $libs.shellsplit.flat_map { |arg|
444
- case arg
445
- when '-lxml2', '-lxslt', '-lexslt'
446
- ['-Wl,-Bstatic', arg, '-Wl,-Bdynamic']
447
- else
448
- arg
449
- end
450
- }.shelljoin
451
- else
452
- message "NONE\n"
453
- end
491
+ $libs = $libs.shellsplit.map { |arg|
492
+ case arg
493
+ when '-lxml2'
494
+ File.join(libxml2_recipe.path, 'lib', lib_a(arg))
495
+ when '-lxslt', '-lexslt'
496
+ File.join(libxslt_recipe.path, 'lib', lib_a(arg))
497
+ else
498
+ arg
499
+ end
500
+ }.shelljoin
454
501
  end
455
502
  end
456
503