diff --git a/bin/orops b/bin/orops index 819489b2..7f6d04fe 100755 --- a/bin/orops +++ b/bin/orops @@ -3,6 +3,7 @@ require 'orocos' require 'pp' require 'utilrb/pkgconfig' +require 'optparse' do_cleanup = false parser = OptionParser.new do |opt| diff --git a/bin/oroshell b/bin/oroshell index 6e572be1..d8fb42ca 100755 --- a/bin/oroshell +++ b/bin/oroshell @@ -2,6 +2,7 @@ require 'irb' require 'orocos' +require 'optparse' parser = OptionParser.new do |opt| opt.on('--host=HOST', String, "the host we should connect to for naming") do |hostname| diff --git a/lib/orocos/process.rb b/lib/orocos/process.rb index 5e3c0a83..3eee08be 100644 --- a/lib/orocos/process.rb +++ b/lib/orocos/process.rb @@ -345,8 +345,8 @@ def self.resolve_prefix(model, prefix) # starting the process and cleaning up when the process # dies. class Process < ProcessBase - # The component PkgConfig instance - attr_reader :pkg + # The path to the binary file + attr_reader :binfile # The component process ID attr_reader :pid @@ -430,7 +430,11 @@ def initialize(name, model = name, loader: Orocos.default_pkgconfig_loader) loader.deployment_model_from_name(model) else model end - @pkg = loader.available_deployments[model.name] + @binfile = + if loader.respond_to?(:find_deployment_binfile) + loader.find_deployment_binfile(model.name) + else loader.available_deployments[model.name].binfile + end super(name, model) end @@ -951,11 +955,7 @@ def spawn(log_level: nil, working_directory: Orocos.default_working_directory, ENV['ORBInitRef'] = "NameService=corbaname::#{name_service.ip}" end - module_bin = pkg.binfile - if !module_bin # assume an older orogen version - module_bin = "#{pkg.exec_prefix}/bin/#{name}" - end - cmdline = [module_bin] + cmdline = [binfile] # check arguments for log_level if log_level diff --git a/lib/orocos/typekits.rb b/lib/orocos/typekits.rb index 518c6e41..1800191a 100644 --- a/lib/orocos/typekits.rb +++ b/lib/orocos/typekits.rb @@ -26,9 +26,13 @@ def self.export_types=(value); default_loader.export_types = value end # Given a pkg-config file and a base name for a shared library, finds the # full path to the library def self.find_plugin_library(pkg, libname) - pkg.library_dirs.find do |dir| + libs = pkg.expand_field('Libs', pkg.raw_fields['Libs']) + libs = libs.grep(/^-L/).map { |s| s[2..-1] } + libs.find do |dir| full_path = File.join(dir, "lib#{libname}.#{Orocos.shared_library_suffix}") - break(full_path) if File.file?(full_path) + if File.file?(full_path) + return full_path, libs + end end end @@ -72,13 +76,12 @@ def self.load_plugin_library(libpath) # :nodoc: def self.load_typekit(name) @lock.synchronize do typekit = default_pkgconfig_loader.typekit_model_from_name(name) - typekit_pkg = find_typekit_pkg(name) - load_typekit_plugins(name, typekit_pkg) + load_typekit_plugins(name) end end def self.find_typekit_pkg(name) - Utilrb::PkgConfig.new("#{name}-typekit-#{Orocos.orocos_target}") + Utilrb::PkgConfig.get("#{name}-typekit-#{Orocos.orocos_target}", minimal: true) rescue Utilrb::PkgConfig::NotFound raise TypekitNotFound, "the '#{name}' typekit is not available to pkgconfig" end @@ -142,7 +145,7 @@ def self.find_typekit_plugin_paths(name, typekit_pkg = nil) AUTOLOADED_TRANSPORTS.each do |transport_name, required| plugin_name = transport_library_name(name, transport_name, Orocos.orocos_target) begin - pkg = Utilrb::PkgConfig.new(plugin_name) + pkg = Utilrb::PkgConfig.get(plugin_name, minimal: true) if pkg.disabled != "true" plugins[plugin_name] = [pkg, required] elsif required @@ -157,12 +160,12 @@ def self.find_typekit_plugin_paths(name, typekit_pkg = nil) end plugins.each_pair do |file, (pkg, required)| - lib = find_plugin_library(pkg, file) + lib, lib_dirs = find_plugin_library(pkg, file) if !lib if required - raise NotFound, "cannot find shared library #{file} for #{name} (searched in #{pkg.library_dirs.join(", ")})" + raise NotFound, "cannot find shared library #{file} for #{name} (searched in #{lib_dirs})" else - Orocos.warn "plugin #{file} is registered through pkg-config, but the library cannot be found in #{pkg.library_dirs.join(", ")}" + Orocos.warn "plugin #{file} is registered through pkg-config, but the library cannot be found in #{lib_dirs}" end else libs << [lib, required] diff --git a/manifest.xml b/manifest.xml index ba364fdd..fbd93278 100644 --- a/manifest.xml +++ b/manifest.xml @@ -17,6 +17,8 @@ + +