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 +4 -4
- data/ext/openbabel/extconf.rb +42 -68
- data/lib/openbabel.rb +1 -1
- data/lib/openbabel/version.rb +1 -1
- data/test/test_openbabel.rb +0 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa9ca323e851eb2489c30ea3a98525d6cfe5a8bd
|
4
|
+
data.tar.gz: 0dad9d0991e79009b2407354f6cb474d0d13f5cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 17debcb6ddd41aec78f9e864a1a52dea8fa3e2fc6d1285bd29f28a767c6542ae4d73b5f1c2dfa63629fb7e6f77c806a166b6b200cea4ad84d3bc3e9708ea5169
|
7
|
+
data.tar.gz: e8c75b99138f95b7d44c7184feb7ca8ea7a5cdd543ac0acfe17444fac9d99f3a37f88280f0ab192cff7d947e2962017d9abd0920895f7829d125ec2eab6b4577
|
data/ext/openbabel/extconf.rb
CHANGED
@@ -1,83 +1,57 @@
|
|
1
1
|
require 'fileutils'
|
2
|
-
require 'mkmf'
|
3
2
|
require 'rbconfig'
|
4
|
-
|
5
|
-
|
3
|
+
require 'mkmf'
|
4
|
+
|
5
|
+
main_dir = File.expand_path(File.join(File.dirname(__FILE__),"..",".."))
|
6
6
|
|
7
|
-
|
8
|
-
ob_ver = "openbabel-"+ob_num_ver
|
7
|
+
# install OpenBabel
|
9
8
|
|
10
|
-
|
9
|
+
openbabel_version = "2.3.2"
|
11
10
|
|
12
|
-
|
13
|
-
src_dir =
|
14
|
-
build_dir = File.join
|
15
|
-
install_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
|
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 = `
|
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
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
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
|
data/lib/openbabel.rb
CHANGED
data/lib/openbabel/version.rb
CHANGED
data/test/test_openbabel.rb
CHANGED
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.
|
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:
|
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.
|
47
|
+
rubygems_version: 2.5.1
|
48
48
|
signing_key:
|
49
49
|
specification_version: 4
|
50
50
|
summary: OpenBabel!
|