openbabel 2.3.1.9 → 2.3.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: cddb2ede193a07ad6d35d1c99ae5a544ec81883b
4
+ data.tar.gz: a9dbe5168fe13176b055ebad6599708db272ad85
5
+ SHA512:
6
+ metadata.gz: b0670741fd4c602e1258fbd5014da664541b9ea37f773d35665ec9da67f89555a70c3493ef5f1d6d1e2e5ef1726afa198ddd185212d0e6fc0e421c7e1586016f
7
+ data.tar.gz: 732079f24513e2b06226243e807b7ecc51d1a73e4cd41fa37a4315d32f4d6606cc518866591d6d7677c4c2d0fd6ecafdfe6fd819f4b10ee48e12107f77b7ce63
@@ -1,48 +1,68 @@
1
1
  require 'fileutils'
2
- require 'tmpdir'
3
2
  require 'mkmf'
3
+ require 'rbconfig'
4
4
  $:.unshift File.expand_path('../../../lib', __FILE__)
5
5
  require 'openbabel/version'
6
6
 
7
7
  ob_num_ver = OpenBabel::VERSION
8
8
  ob_ver = "openbabel-"+ob_num_ver
9
9
 
10
- RUBY=File.join(RbConfig::CONFIG['bindir'],
11
- RbConfig::CONFIG['ruby_install_name'])
10
+ RUBY=File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
12
11
 
13
- main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..","..","src"))
14
- lib_dir = File.expand_path(File.join(File.dirname(__FILE__),"..","..","src"))
15
- Dir.mkdir main_dir
16
- ob_main_dir = File.join(main_dir,ob_ver)
17
- ob_bindings_dir = File.join(ob_main_dir,"scripts","ruby")
12
+ main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..",".."))
13
+ src_dir = File.join main_dir, ob_ver
14
+ build_dir = File.join main_dir, "build"
15
+ install_dir = main_dir
16
+ install_lib_dir = File.join install_dir, "lib"
17
+ lib_dir = File.join main_dir, "lib", "openbabel"
18
+ ruby_src_dir = File.join src_dir, "scripts", "ruby"
19
+
20
+ begin
21
+ nr_processors = `grep processor /proc/cpuinfo | wc -l` # speed up compilation, Linux only
22
+ rescue
23
+ nr_processors = 1
24
+ end
18
25
 
19
26
  begin
20
27
  Dir.chdir main_dir do
21
- FileUtils.rm_rf ob_main_dir
28
+ FileUtils.rm_rf src_dir
22
29
  puts "Downloading OpenBabel sources"
23
30
  system "curl -L -d use_mirror=netcologne 'http://downloads.sourceforge.net/project/openbabel/openbabel/#{ob_num_ver}/openbabel-#{ob_num_ver}.tar.gz' | tar xz"
31
+ system "sed -i -e 's/-Wl,-flat_namespace//;s/-flat_namespace//' #{File.join ruby_src_dir, "extconf.rb"}" # remove unrecognized compiler option
32
+ system "sed -i -e 's/Init_OpenBabel/Init_openbabel/g' #{File.join ruby_src_dir,"*cpp"}" # fix swig bindings
24
33
  end
25
- Dir.chdir ob_main_dir do
34
+ FileUtils.mkdir_p build_dir
35
+ FileUtils.mkdir_p install_dir
36
+ Dir.chdir build_dir do
26
37
  puts "Configuring OpenBabel"
27
- system "cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}"
28
- openbabel_libs = have_library('openbabel')
29
- unless openbabel_libs
38
+ cmake = "cmake #{src_dir} -DCMAKE_INSTALL_PREFIX=#{install_dir} -DBUILD_GUI=OFF -DENABLE_TESTS=OFF -DRUBY_BINDINGS=ON"
39
+ # set rpath for local installations
40
+ # http://www.cmake.org/Wiki/CMake_RPATH_handling
41
+ # http://vtk.1045678.n5.nabble.com/How-to-force-cmake-not-to-remove-install-rpath-td5721193.html
42
+ cmake += " -DCMAKE_INSTALL_RPATH:STRING=\"#{install_lib_dir}\"" unless have_library('openbabel')
43
+ system cmake
44
+ end
45
+ unless have_library('openbabel')
46
+ # local installation in gem directory
47
+ Dir.chdir build_dir do
30
48
  puts "OpenBabel not installed. Compiling sources."
31
- system "make"
49
+ system "make -j#{nr_processors}"
32
50
  system "make install"
51
+ ENV["PKG_CONFIG_PATH"] = File.dirname(File.expand_path(Dir["#{install_dir}/**/openbabel*pc"].first))
33
52
  end
34
53
  end
35
- Dir.chdir ob_bindings_dir do
36
- puts "Compiling and instaling OpenBabel Ruby bindings."
37
- system "sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp"
54
+ # compile ruby bindings
55
+ puts "Compiling and installing OpenBabel Ruby bindings."
56
+ Dir.chdir ruby_src_dir do
57
+ # fix rpath
58
+ system "sed -i 's|with_ldflags.*$|with_ldflags(\"#\$LDFLAGS -dynamic -Wl,-rpath,#{install_lib_dir}\") do|' #{File.join(ruby_src_dir,'extconf.rb')}" unless have_library('openbabel')
38
59
  # get include and lib from pkg-config
39
60
  ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'')
40
61
  ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'')
41
62
  system "#{RUBY} extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}"
42
- system "sed -i -e 's/-Wl,-flat_namespace//;s/-flat_namespace//' Makefile"
43
- system "make"
63
+ system "make -j#{nr_processors}"
44
64
  end
45
- FileUtils.cp(ob_bindings_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./")
65
+ FileUtils.cp(ruby_src_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./")
46
66
  File.open('Makefile', 'w') do |makefile|
47
67
  makefile.write <<"EOF"
48
68
  .PHONY: openbabel.#{RbConfig::CONFIG["DLEXT"]}
@@ -51,10 +71,10 @@ openbabel.#{RbConfig::CONFIG["DLEXT"]}:
51
71
 
52
72
  .PHONY: install
53
73
  install:
54
- mkdir -p ../../lib/openbabel
55
- mv openbabel.#{RbConfig::CONFIG["DLEXT"]} ../../lib/openbabel
74
+ mkdir -p #{lib_dir}
75
+ mv openbabel.#{RbConfig::CONFIG["DLEXT"]} #{lib_dir}
56
76
  EOF
57
77
  end
58
78
  ensure
59
- FileUtils.remove_entry_secure main_dir
79
+ FileUtils.remove_entry_secure src_dir, build_dir
60
80
  end
@@ -1,2 +1,4 @@
1
1
  require 'openbabel/openbabel'
2
2
  require 'openbabel/version'
3
+ # http://sourceforge.net/mailarchive/message.php?msg_id=31065700
4
+ OpenBabel::OBConversion.new # required to load plugins
@@ -1,4 +1,4 @@
1
1
  module OpenBabel
2
- VERSION = '2.3.1'
3
- GEMVERSION = VERSION + '.9'
2
+ VERSION = '2.3.2'
3
+ GEMVERSION = VERSION + '.0'
4
4
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbabel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.1.9
5
- prerelease:
4
+ version: 2.3.2.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Andreas Maunz, Christoph Helma, Katsuhiko Nishimra
@@ -12,7 +11,9 @@ cert_chain: []
12
11
  date: 2012-04-03 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: OpenBabel as a GEM
15
- email: andreas@maunz.de
14
+ email:
15
+ - andreas@maunz.de
16
+ - helma@in-silico.ch
16
17
  executables: []
17
18
  extensions:
18
19
  - ext/openbabel/extconf.rb
@@ -23,29 +24,29 @@ files:
23
24
  - lib/openbabel/version.rb
24
25
  - test/test_openbabel.rb
25
26
  - ext/openbabel/extconf.rb
26
- homepage: http://cs.maunz.de
27
- licenses: []
27
+ homepage: http://github.com/opentox/openbabel-gem
28
+ licenses:
29
+ - GPL-3
30
+ metadata: {}
28
31
  post_install_message:
29
32
  rdoc_options: []
30
33
  require_paths:
31
34
  - lib
32
35
  required_ruby_version: !ruby/object:Gem::Requirement
33
- none: false
34
36
  requirements:
35
- - - ! '>='
37
+ - - '>='
36
38
  - !ruby/object:Gem::Version
37
39
  version: '0'
38
40
  required_rubygems_version: !ruby/object:Gem::Requirement
39
- none: false
40
41
  requirements:
41
- - - ! '>='
42
+ - - '>='
42
43
  - !ruby/object:Gem::Version
43
44
  version: '0'
44
45
  requirements: []
45
46
  rubyforge_project:
46
- rubygems_version: 1.8.11
47
+ rubygems_version: 2.0.2
47
48
  signing_key:
48
- specification_version: 3
49
+ specification_version: 4
49
50
  summary: OpenBabel!
50
51
  test_files:
51
52
  - test/test_openbabel.rb