openbabel 2.3.2.1 → 2.3.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: be4c03f43400bcca6ea043742d88a91f0ffb4b27
4
- data.tar.gz: d716ff0e870245cd5566b6c9e338fdd640a9eb17
3
+ metadata.gz: aa9ca323e851eb2489c30ea3a98525d6cfe5a8bd
4
+ data.tar.gz: 0dad9d0991e79009b2407354f6cb474d0d13f5cc
5
5
  SHA512:
6
- metadata.gz: 1d76d501a8d0f959d27ed0e1be4b9ec997f0deadd2f8ca658f99f93635d09bde8908298c7ca109ff36985a8ab248b32aaeda91c18d9935ee4680601dddbb04c5
7
- data.tar.gz: 070471fa2298ad01ad3d8c5fb028b7d6a6093b07a7e778930658e65febf469b3fee6844315c176c050c67b8f6afdd21b708341ecaff8aad53844a90c4d5910c9
6
+ metadata.gz: 17debcb6ddd41aec78f9e864a1a52dea8fa3e2fc6d1285bd29f28a767c6542ae4d73b5f1c2dfa63629fb7e6f77c806a166b6b200cea4ad84d3bc3e9708ea5169
7
+ data.tar.gz: e8c75b99138f95b7d44c7184feb7ca8ea7a5cdd543ac0acfe17444fac9d99f3a37f88280f0ab192cff7d947e2962017d9abd0920895f7829d125ec2eab6b4577
@@ -1,83 +1,57 @@
1
1
  require 'fileutils'
2
- require 'mkmf'
3
2
  require 'rbconfig'
4
- $:.unshift File.expand_path('../../../lib', __FILE__)
5
- require 'openbabel/version'
3
+ require 'mkmf'
4
+
5
+ main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..",".."))
6
6
 
7
- ob_num_ver = OpenBabel::VERSION
8
- ob_ver = "openbabel-"+ob_num_ver
7
+ # install OpenBabel
9
8
 
10
- RUBY=File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
9
+ openbabel_version = "2.3.2"
11
10
 
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
11
+ openbabel_dir = File.join main_dir, "openbabel"
12
+ src_dir = openbabel_dir
13
+ build_dir = File.join src_dir, "build"
14
+ install_dir = openbabel_dir
16
15
  install_lib_dir = File.join install_dir, "lib"
17
- lib_dir = File.join main_dir, "lib", "openbabel"
16
+ lib_dir = File.join openbabel_dir, "lib", "openbabel"
18
17
  ruby_src_dir = File.join src_dir, "scripts", "ruby"
19
18
 
20
19
  begin
21
- nr_processors = `grep processor /proc/cpuinfo | wc -l` # speed up compilation, Linux only
20
+ nr_processors = `getconf _NPROCESSORS_ONLN`.to_i # should be POSIX compatible
22
21
  rescue
23
22
  nr_processors = 1
24
23
  end
25
24
 
26
- begin
27
- Dir.chdir main_dir do
28
- FileUtils.rm_rf src_dir
29
- puts "Downloading OpenBabel sources"
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
33
- system "sed -i -e 's/Config::CONFIG/RbConfig::CONFIG/' #{File.join src_dir, "scripts", "CMakeLists.txt" }" # fix Ruby Config
34
- system "sed -i -e 's/Config::CONFIG/RbConfig::CONFIG/' #{File.join ruby_src_dir, "extconf.rb" }" # fix Ruby Config
35
- end
36
- FileUtils.mkdir_p build_dir
37
- FileUtils.mkdir_p install_dir
38
- Dir.chdir build_dir do
39
- puts "Configuring OpenBabel"
40
- cmake = "cmake #{src_dir} -DCMAKE_INSTALL_PREFIX=#{install_dir} -DBUILD_GUI=OFF -DENABLE_TESTS=OFF -DRUBY_BINDINGS=ON"
41
- # set rpath for local installations
42
- # http://www.cmake.org/Wiki/CMake_RPATH_handling
43
- # http://vtk.1045678.n5.nabble.com/How-to-force-cmake-not-to-remove-install-rpath-td5721193.html
44
- cmake += " -DCMAKE_INSTALL_RPATH:STRING=\"#{install_lib_dir}\"" unless have_library('openbabel')
45
- system cmake
46
- end
47
- unless have_library('openbabel')
48
- # local installation in gem directory
49
- Dir.chdir build_dir do
50
- puts "OpenBabel not installed. Compiling sources."
51
- system "make -j#{nr_processors}"
52
- system "make install"
53
- ENV["PKG_CONFIG_PATH"] = File.dirname(File.expand_path(Dir["#{install_dir}/**/openbabel*pc"].first))
54
- end
55
- end
56
- # compile ruby bindings
57
- puts "Compiling and installing OpenBabel Ruby bindings."
58
- Dir.chdir ruby_src_dir do
59
- # fix rpath
60
- 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')
61
- # get include and lib from pkg-config
62
- ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'')
63
- ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'')
64
- system "#{RUBY} extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}"
65
- system "make -j#{nr_processors}"
66
- end
67
- FileUtils.cp(ruby_src_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./")
68
- File.open('Makefile', 'w') do |makefile|
69
- makefile.write <<"EOF"
70
- .PHONY: openbabel.#{RbConfig::CONFIG["DLEXT"]}
71
- openbabel.#{RbConfig::CONFIG["DLEXT"]}:
72
- chmod 755 openbabel.#{RbConfig::CONFIG["DLEXT"]}
25
+ FileUtils.mkdir_p openbabel_dir
26
+ Dir.chdir main_dir do
27
+ FileUtils.rm_rf src_dir
28
+ puts "Downloading OpenBabel sources"
29
+ system "git clone https://github.com/openbabel/openbabel.git"
30
+ end
31
+
32
+ FileUtils.mkdir_p build_dir
33
+ FileUtils.mkdir_p install_dir
34
+ Dir.chdir build_dir do
35
+ puts "Configuring OpenBabel"
36
+ cmake = "cmake #{src_dir} -DCMAKE_INSTALL_PREFIX=#{install_dir} -DBUILD_GUI=OFF -DENABLE_TESTS=OFF -DRUN_SWIG=ON -DRUBY_BINDINGS=ON"
37
+ # set rpath for local installations
38
+ # http://www.cmake.org/Wiki/CMake_RPATH_handling
39
+ # http://vtk.1045678.n5.nabble.com/How-to-force-cmake-not-to-remove-install-rpath-td5721193.html
40
+ cmake += " -DCMAKE_INSTALL_RPATH:STRING=\"#{install_lib_dir}\""
41
+ system cmake
42
+ end
73
43
 
74
- .PHONY: install
75
- install:
76
- mkdir -p #{lib_dir}
77
- mv openbabel.#{RbConfig::CONFIG["DLEXT"]} #{lib_dir}
78
- EOF
79
- FileUtils.remove_entry_secure src_dir, build_dir
80
- end
81
- ensure
82
- # Do NOT remove scr_dir and build_dir after build fails, they are necessary for debugging.
44
+ # local installation in gem directory
45
+ Dir.chdir build_dir do
46
+ puts "Compiling OpenBabel sources."
47
+ system "make -j#{nr_processors}"
48
+ system "make install"
49
+ ENV["PKG_CONFIG_PATH"] = File.dirname(File.expand_path(Dir["#{install_dir}/**/openbabel*pc"].first))
83
50
  end
51
+
52
+ # create a fake Makefile
53
+ File.open(File.join(File.dirname(__FILE__),"Makefile"),"w+") do |makefile|
54
+ makefile.puts "all:\n\ttrue\n\ninstall:\n\ttrue\n"
55
+ end
56
+
57
+ $makefile_created = true
@@ -1,4 +1,4 @@
1
- require 'openbabel/openbabel'
1
+ require_relative '../openbabel/lib/openbabel'
2
2
  require 'openbabel/version'
3
3
  # http://sourceforge.net/mailarchive/message.php?msg_id=31065700
4
4
  OpenBabel::OBConversion.new # required to load plugins
@@ -1,4 +1,4 @@
1
1
  module OpenBabel
2
2
  VERSION = '2.3.2'
3
- GEMVERSION = VERSION + '.1'
3
+ GEMVERSION = VERSION + '.2'
4
4
  end
@@ -1,7 +1,5 @@
1
1
  require 'test/unit'
2
2
 
3
- $:.unshift File.expand_path('../../lib', __FILE__)
4
- $:.unshift File.expand_path('../../ext', __FILE__)
5
3
  require 'openbabel'
6
4
  include OpenBabel
7
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openbabel
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2.1
4
+ version: 2.3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andreas Maunz, Christoph Helma, Katsuhiko Nishimra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2012-04-03 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: OpenBabel as a GEM
14
14
  email:
@@ -26,7 +26,7 @@ files:
26
26
  - test/test_openbabel.rb
27
27
  homepage: http://github.com/opentox/openbabel-gem
28
28
  licenses:
29
- - GPL-3
29
+ - GPL-3.0
30
30
  metadata: {}
31
31
  post_install_message:
32
32
  rdoc_options: []
@@ -44,7 +44,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
44
44
  version: '0'
45
45
  requirements: []
46
46
  rubyforge_project:
47
- rubygems_version: 2.4.5
47
+ rubygems_version: 2.5.1
48
48
  signing_key:
49
49
  specification_version: 4
50
50
  summary: OpenBabel!