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 0C1E617D688C for ; Mon, 1 Jun 2015 18:27:34 +0900 (JST) Received: from funfun.nagaokaut.ac.jp (funfun.nagaokaut.ac.jp [133.44.2.201]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 1193BB5D888 for ; Mon, 1 Jun 2015 18:46:37 +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 3D59197A820 for ; Mon, 1 Jun 2015 18:46:39 +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 d0MalYd7o6bG for ; Mon, 1 Jun 2015 18:46:38 +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 C4DCF97A839 for ; Mon, 1 Jun 2015 18:46:38 +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 47417952408 for ; Mon, 1 Jun 2015 18:46:36 +0900 (JST) Received: from [221.186.184.76] (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 7E20D120439; Mon, 1 Jun 2015 18:46:35 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o10.shared.sendgrid.net (o10.shared.sendgrid.net [173.193.132.135]) by neon.ruby-lang.org (Postfix) with ESMTPS id A6D31120411 for ; Mon, 1 Jun 2015 18:46:31 +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=rPsosCxHRVMEm4xwTOYcIxoKZKk=; b=bJQ3lXvhdVrN7oPK/4 gJkB+g/g+kg3icT0ZYD/Qbi6bWjDatvHhJjYal4CD5aAasFZJ7Ude2qwIeAftLuc pcr8dXtuOi/xqtdkJYsPqHUApftHos6b2qE9WKswp21qIZy8f0IJosBy1X9LjTsh LGn2b62m+qYQm4BLIeqsOp0Ac= Received: by filter0427p1mdw1.sendgrid.net with SMTP id filter0427p1mdw1.10426.556C29F312 2015-06-01 09:46:27.654041688 +0000 UTC Received: from herokuapp.com (ec2-54-161-103-63.compute-1.amazonaws.com [54.161.103.63]) by ismtpd-032 (SG) with ESMTP id 14dae83df5a.5579.33d44b for ; Mon, 01 Jun 2015 09:46:27 +0000 (UTC) Date: Mon, 01 Jun 2015 09:46:27 +0000 From: nobu@ruby-lang.org 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: 43875 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 11201 X-Redmine-Issue-Author: Hanmac X-Redmine-Sender: nobu 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/Ymy4QrNMhiuLXJG8OTL2vJD1yS4seMR0vwW8S8iGllG1RMlm0iH+4fcnBUfzjN ln1SD2lhILbsaG1Xf+6iwi8E+nfYe4b5BEXCvMpkZEysXafNkkjoF6XLw09ooUHTaelOhJVi3hl/JX Kmdh8Gdeka3GCa0cP87wGWdfY0E6BATnkc1M X-ML-Name: ruby-core X-Mail-Count: 69424 Subject: [ruby-core:69424] [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 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 `
' ~~~ -- https://bugs.ruby-lang.org/