* [ruby-core:69421] [Ruby trunk - Bug #11201] [Open] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
@ 2015-06-01 6:48 ` hanmac
2015-06-01 8:51 ` [ruby-core:69422] [Ruby trunk - Bug #11201] [Feedback] " nobu
` (6 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: hanmac @ 2015-06-01 6:48 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been reported by Hans Mackowiak.
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201
* Author: Hans Mackowiak
* Status: Open
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
where it does work (existing package)
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
where it does work (non-existing package)
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
where it maybe not work (other (pkg)-config program)
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:69422] [Ruby trunk - Bug #11201] [Feedback] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
2015-06-01 6:48 ` [ruby-core:69421] [Ruby trunk - Bug #11201] [Open] pkg_config NoMethodError when finding other -config program hanmac
@ 2015-06-01 8:51 ` nobu
2015-06-01 9:00 ` [ruby-core:69423] [Ruby trunk - Bug #11201] " hanmac
` (5 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: nobu @ 2015-06-01 8:51 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Nobuyoshi Nakada.
Description updated
Status changed from Open to Feedback
Does `pkg-config --libs-only-l wx` work?
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-52694
* Author: Hans Mackowiak
* Status: Feedback
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:69423] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
2015-06-01 6:48 ` [ruby-core:69421] [Ruby trunk - Bug #11201] [Open] pkg_config NoMethodError when finding other -config program hanmac
2015-06-01 8:51 ` [ruby-core:69422] [Ruby trunk - Bug #11201] [Feedback] " nobu
@ 2015-06-01 9:00 ` hanmac
2015-06-01 9:46 ` [ruby-core:69424] " nobu
` (4 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: hanmac @ 2015-06-01 9:00 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Hans Mackowiak.
wx from wxWidgets does have its own wx-config script with does have other flags than pkg-config
(pkg-config in its second version can call (pkg)-config scripts)
thats why:
wx-config --libs-only-l
*** Error: Unrecognised option: '--libs-only-l'
imo it would be nice if it would have checked if that libs-only-l returns something/a string before shellsplit does try to cut it.
i am okay with it that pkg_config("wx") might not be able to get something but imo it would be better if it does return nil instead of NoMethodError
PS: but i think it still would have been nice if it would have been able to return something meaningful.
another sample would be xml2-config from libxml2
PS: i might try to fix that on my own and then i will add a patch
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-52695
* Author: Hans Mackowiak
* Status: Feedback
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:69424] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
` (2 preceding siblings ...)
2015-06-01 9:00 ` [ruby-core:69423] [Ruby trunk - Bug #11201] " hanmac
@ 2015-06-01 9:46 ` nobu
2015-06-01 12:44 ` [ruby-core:69428] " hanmac
` (3 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: nobu @ 2015-06-01 9:46 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Nobuyoshi Nakada.
Thank you, does this patch work?
~~~diff
diff --git i/lib/mkmf.rb w/lib/mkmf.rb
index be9b06c..615e2dc 100644
--- i/lib/mkmf.rb
+++ w/lib/mkmf.rb
@@ -1818,11 +1818,15 @@ SRC
cflags = get['cflags']
end
libs = get['libs-only-l']
- ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
- $CFLAGS += " " << cflags
- $CXXFLAGS += " " << cflags
+ if cflags
+ $CFLAGS += " " << cflags
+ $CXXFLAGS += " " << cflags
+ end
+ if libs
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+ $libs += " " << libs
+ end
$LDFLAGS = [orig_ldflags, ldflags].join(' ')
- $libs += " " << libs
Logging::message "package configuration for %s\n", pkg
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
cflags, ldflags, libs
~~~
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-52696
* Author: Hans Mackowiak
* Status: Feedback
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [ruby-core:69428] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
` (3 preceding siblings ...)
2015-06-01 9:46 ` [ruby-core:69424] " nobu
@ 2015-06-01 12:44 ` hanmac
2015-06-30 4:12 ` [ruby-core:69802] " usa
` (2 subsequent siblings)
7 siblings, 0 replies; 8+ messages in thread
From: hanmac @ 2015-06-01 12:44 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Hans Mackowiak.
Priority changed from Normal to Low
i try to modify your possible patch a bit,
now it can parse the libs from the libflags again.
makes it work with wx-config and freetype-config
~~~diff
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 0f588a5..7e8b22d 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -1816,11 +1816,18 @@ SRC
cflags = get['cflags']
end
libs = get['libs-only-l']
- ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
- $CFLAGS += " " << cflags
- $CXXFLAGS += " " << cflags
- $LDFLAGS = [orig_ldflags, ldflags].join(' ')
+ if cflags
+ $CFLAGS += " " << cflags
+ $CXXFLAGS += " " << cflags
+ end
+ if libs
+ ldflags = (Shellwords.shellwords(ldflags) - Shellwords.shellwords(libs)).quote.join(" ")
+ else
+ libs, ldflags = Shellwords.shellwords(ldflags).partition {|s| s =~ /-l([^ ]+)/ }.map {|l| l.quote.join(" ") }
+ end
$libs += " " << libs
+
+ $LDFLAGS = [orig_ldflags, ldflags].join(' ')
Logging::message "package configuration for %s\n", pkg
Logging::message "cflags: %s\nldflags: %s\nlibs: %s\n\n",
cflags, ldflags, libs
~~~
sdl2-config and xml2-config makes problems with "cflags-only-I" and "libs-only-l" because they do not return error so $?.success? does think the data is ok
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-52700
* Author: Hans Mackowiak
* Status: Feedback
* Priority: Low
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [ruby-core:69802] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
` (4 preceding siblings ...)
2015-06-01 12:44 ` [ruby-core:69428] " hanmac
@ 2015-06-30 4:12 ` usa
2015-07-03 9:45 ` [ruby-core:69857] " usa
2015-07-03 20:14 ` [ruby-core:69867] " nagachika00
7 siblings, 0 replies; 8+ messages in thread
From: usa @ 2015-06-30 4:12 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN to 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-53196
* Author: Hans Mackowiak
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:69857] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
` (5 preceding siblings ...)
2015-06-30 4:12 ` [ruby-core:69802] " usa
@ 2015-07-03 9:45 ` usa
2015-07-03 20:14 ` [ruby-core:69867] " nagachika00
7 siblings, 0 replies; 8+ messages in thread
From: usa @ 2015-07-03 9:45 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Usaku NAKAMURA.
Backport changed from 2.0.0: WONTFIX, 2.1: REQUIRED, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED
ruby_2_1 r51123 merged revision(s) 50717.
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-53258
* Author: Hans Mackowiak
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread
* [ruby-core:69867] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program
[not found] <redmine.issue-11201.20150601064810@ruby-lang.org>
` (6 preceding siblings ...)
2015-07-03 9:45 ` [ruby-core:69857] " usa
@ 2015-07-03 20:14 ` nagachika00
7 siblings, 0 replies; 8+ messages in thread
From: nagachika00 @ 2015-07-03 20:14 UTC (permalink / raw)
To: ruby-core
Issue #11201 has been updated by Tomoyuki Chikanaga.
Backport changed from 2.0.0: WONTFIX, 2.1: DONE, 2.2: REQUIRED to 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE
Backported into `ruby_2_2` branch at r51135.
----------------------------------------
Bug #11201: pkg_config NoMethodError when finding other -config program
https://bugs.ruby-lang.org/issues/11201#change-53271
* Author: Hans Mackowiak
* Status: Closed
* Priority: Normal
* Assignee:
* ruby -v: ruby 2.3.0dev (2015-05-28 trunk 50658) [x86_64-linux]
* Backport: 2.0.0: WONTFIX, 2.1: DONE, 2.2: DONE
----------------------------------------
where it does work (existing package)
~~~ruby
pkg_config("gtk+-x11-2.0") # => ["-pthread", "", "-lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype"]
pkg_config("gtk+-x11-2.0", "version") # => "0.28"
~~~
where it does work (non-existing package)
~~~ruby
pkg_config("wx-bla", "version") # => nil
pkg_config("wx-bla") # => nil
~~~
where it maybe not work (other (pkg)-config program)
~~~ruby
pkg_config("wx", "version") # => "3.1.0"
pkg_config("wx") #either should try to return the same stuff as pkg_config("gtk+-x11-2.0") if possible, or if not return nil
~~~
~~~
NoMethodError: undefined method `scan' for nil:NilClass
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/shellwords.rb:73:in `shellsplit'
from /usr/local/rvm/rubies/ruby-head/lib/ruby/2.3.0/mkmf.rb:1819:in `pkg_config'
from (irb):11
from /usr/local/rvm/rubies/ruby-head/bin/irb:11:in `<main>'
~~~
--
https://bugs.ruby-lang.org/
^ permalink raw reply [flat|nested] 8+ messages in thread