From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (kankan.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 10FD017D688C for ; Mon, 1 Jun 2015 21:26:13 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 70D62B5D99B for ; Mon, 1 Jun 2015 21:45:17 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (localhost.nagaokaut.ac.jp [127.0.0.1]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id 052EE97A826 for ; Mon, 1 Jun 2015 21:45:20 +0900 (JST) X-Virus-Scanned: amavisd-new at nagaokaut.ac.jp Authentication-Results: funfun.nagaokaut.ac.jp (amavisd-new); dkim=fail (1024-bit key) reason="fail (message has been altered)" header.d=sendgrid.me Received: from funfun.nagaokaut.ac.jp ([127.0.0.1]) by funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id PqFYI6l_XWvF for ; Mon, 1 Jun 2015 21:45:19 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by funfun.nagaokaut.ac.jp (Postfix) with ESMTP id CD64397A820 for ; Mon, 1 Jun 2015 21:45:19 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id 35067952408 for ; Mon, 1 Jun 2015 21:45:16 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 3CEE0120433; Mon, 1 Jun 2015 21:45:16 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o2.heroku.sendgrid.net (o2.heroku.sendgrid.net [67.228.50.55]) by neon.ruby-lang.org (Postfix) with ESMTPS id 82A2B12040F for ; Mon, 1 Jun 2015 21:45:08 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=wZibPEKG0rFgngo+R8FnouGb2Qc=; b=EsZGdpS9uehkUk/PUM i+JVnl/1CPPyhYmPQYX9QinEm5C5huxyLJimHBGxSV/RaSJ0tXXTnTqwXY5sG1Rj 8bD9KZ+hciUgaqwaVGsZrMIhAmXSXtiGy2CNMux+14e1Uli8E8qkTJBxamVs4hTW ZpRzEunT/RfT5wkKrsiEEoqiA= Received: by filter0556p1mdw1.sendgrid.net with SMTP id filter0556p1mdw1.4853.556C53B327 2015-06-01 12:45:01.223793071 +0000 UTC Received: from herokuapp.com (ec2-107-21-148-21.compute-1.amazonaws.com [107.21.148.21]) by ismtpd-039 (SG) with ESMTP id 14daf27598f.2e94.556f2a for ; Mon, 01 Jun 2015 12:45:01 +0000 (UTC) Date: Mon, 01 Jun 2015 12:44:55 +0000 From: hanmac@gmx.de To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Redmine-MailingListIntegration-Message-Ids: 43881 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11201 X-Redmine-Issue-Author: Hanmac X-Redmine-Sender: Hanmac X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS6U1exL51LRNh+eECvBzfF1T2WQ/lKRjWv/D0 AfzXK0ySHp994NLBltU7E+KArinUIRVD0mEeVL+2DVzsAubB4ddxrqza35cV9RRmS6dXEchFPN32/x TYQTyT/YMnadlwQlKFhVFwYKEhiG50xEidkY X-ML-Name: ruby-core X-Mail-Count: 69428 Subject: [ruby-core:69428] [Ruby trunk - Bug #11201] pkg_config NoMethodError when finding other -config program X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: ruby-core-bounces@ruby-lang.org Sender: "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 `
' ~~~ -- https://bugs.ruby-lang.org/