Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ def package_info(self):
'usr-x64-mswin64_140.lib',
'wait_for_single_fd-x64-mswin64_140.lib']


self.output.warn(
"Since we are building a custom libffi, we are packaging it, as it's required for linking our ruby")
"Since we are building a custom libffi, we are packaging it, "
"as it's required for linking our ruby")
expected_libs += ['libffi.lib']

n_libs = len(libs)
Expand Down Expand Up @@ -355,3 +355,23 @@ def package_info(self):
self.output.info("cpp_info.libs = {}".format(self.cpp_info.libs))
self.output.info("cpp_info.includedirs = "
"{}".format(self.cpp_info.includedirs))

# PATH / ENV stuff
bindir = os.path.join(self.package_folder, "bin")
self.output.info('Appending PATH environment variable: '
'{}'.format(bindir))
self.env_info.PATH.append(bindir)
self.env_info.RUBY_EXEC_PREFIX = self.package_folder
self.env_info.RUBY_BINDIR = bindir
self.env_info.RUBY_LIBDIR = os.path.join(self.package_folder, "lib")

# Rewrite shebangs
bin_scripts = ['gem', 'ri', 'irb', 'rdoc', 'erb', 'rake']
for bin_script in bin_scripts:
bin_script_p = os.path.join(self.package_folder, 'bin', bin_script)
with open(bin_script_p, 'r') as f:
lines = f.read().splitlines()
lines[0] = "#!{}".format(os.path.join(self.package_folder,
'bin/ruby'))
with open(bin_script_p, 'w') as f:
f.write("\n".join(lines))
4 changes: 2 additions & 2 deletions test_package/openstudio_cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -680,9 +680,9 @@ class CLI
def command_list
{
gem_list: [ Proc.new { ::GemList }, {primary: false, working: true}],
gem_install: [ Proc.new { ::InstallGem }, {primary: false, working: false}], # DLM: needs Ruby built with FFI
gem_install: [ Proc.new { ::InstallGem }, {primary: false, working: true}], # DLM: needs Ruby built with FFI
execute_ruby_script: [ Proc.new { ::ExecuteRubyScript }, {primary: false, working: true}],
interactive_ruby: [ Proc.new { ::InteractiveRubyShell }, {primary: false, working: false}], # DLM: not working
interactive_ruby: [ Proc.new { ::InteractiveRubyShell }, {primary: false, working: true}], # DLM: not working
ruby_version: [ Proc.new { ::RubyVersion }, {primary: false, working: true}],
list_commands: [ Proc.new { ::ListCommands }, {primary: true, working: true}]
}
Expand Down