You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using the pkg-config gem as a runtime dependency of nokogiri results in a
license conflict. pkg-config is LGPL but nokogiri is MIT.
Making the pkg-config gem optional solves this issue.
Fixes#1488 and #1496 .
Copy file name to clipboardexpand all lines: ext/nokogiri/extconf.rb
+15-14
Original file line number
Diff line number
Diff line change
@@ -106,27 +106,28 @@ def do_clean
106
106
exit!0
107
107
end
108
108
109
-
# The gem version constraint in the Rakefile is not respected at install time.
110
-
# Keep this version in sync with the one in the Rakefile !
111
-
require'rubygems'
112
-
gem'pkg-config','~> 1.1.7'
113
-
require'pkg-config'
114
-
message"Using pkg-config version #{PKGConfig::VERSION}\n"
115
-
116
109
defpackage_configpkg,options={}
117
110
package=pkg_config(pkg)
118
111
returnpackageifpackage
119
112
120
-
returnnilunlessPKGConfig.have_package(pkg)
113
+
begin
114
+
require'rubygems'
115
+
gem'pkg-config',(gem_ver='~> 1.1.7')
116
+
require'pkg-config'andmessage("Using pkg-config gem version #{PKGConfig::VERSION}\n")
117
+
rescueLoadError
118
+
message"pkg-config could not be used to find #{pkg}\nPlease install either `pkg-config` or the pkg-config gem per\n\n gem install pkg-config -v #{gem_ver.inspect}\n\n"
119
+
else
120
+
returnnilunlessPKGConfig.have_package(pkg)
121
121
122
-
cflags=PKGConfig.cflags(pkg)
123
-
ldflags=PKGConfig.libs_only_L(pkg)
124
-
libs=PKGConfig.libs_only_l(pkg)
122
+
cflags=PKGConfig.cflags(pkg)
123
+
ldflags=PKGConfig.libs_only_L(pkg)
124
+
libs=PKGConfig.libs_only_l(pkg)
125
125
126
-
Logging::message"PKGConfig package configuration for %s\n",pkg
0 commit comments