openbabel 2.3.1.6 → 2.3.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/ext/openbabel/extconf.rb +17 -10
- metadata +39 -21
- data/ext/openbabel/Makefile +0 -8
data/ext/openbabel/extconf.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'fileutils'
|
2
2
|
require 'tmpdir'
|
3
|
+
require 'mkmf'
|
3
4
|
|
4
5
|
ob_num_ver="2.3.1"
|
5
6
|
ob_ver="openbabel-"+ob_num_ver
|
@@ -19,13 +20,7 @@ begin
|
|
19
20
|
Dir.chdir ob_main_dir do
|
20
21
|
puts "Configuring OpenBabel"
|
21
22
|
puts `cmake #{ob_main_dir} -DCMAKE_INSTALL_PREFIX=#{lib_dir}`
|
22
|
-
openbabel_libs =
|
23
|
-
openbabel_libs = true if `/sbin/ldconfig -p`.split("\n").grep(/openbabel/)
|
24
|
-
unless openbabel_libs
|
25
|
-
ENV["LD_LIBRARY_PATH"].split(":").each do |dir|
|
26
|
-
openbabel_libs = true unless Dir[File.join(dir,"*libopenbabel*")].empty?
|
27
|
-
end
|
28
|
-
end
|
23
|
+
openbabel_libs = have_library('openbabel')
|
29
24
|
unless openbabel_libs
|
30
25
|
puts "OpenBabel not installed. Compiling sources."
|
31
26
|
puts `make`
|
@@ -34,15 +29,27 @@ begin
|
|
34
29
|
end
|
35
30
|
Dir.chdir ob_bindings_dir do
|
36
31
|
puts "Compiling and instaling OpenBabel Ruby bindings."
|
37
|
-
`sed -i 's/Init_OpenBabel/Init_openbabel/g' *cpp`
|
32
|
+
`sed -i -e 's/Init_OpenBabel/Init_openbabel/g' *cpp`
|
38
33
|
# get include and lib from pkg-config
|
39
34
|
ob_include=`pkg-config openbabel-2.0 --cflags-only-I`.sub(/\s+/,'').sub(/-I/,'')
|
40
35
|
ob_lib=`pkg-config openbabel-2.0 --libs-only-L`.sub(/\s+/,'').sub(/-L/,'')
|
41
36
|
`ruby extconf.rb --with-openbabel-include=#{ob_include} --with-openbabel-lib=#{ob_lib}`
|
42
|
-
`sed -i 's/-flat_namespace//' Makefile`
|
37
|
+
`sed -i -e 's/-flat_namespace//' Makefile`
|
43
38
|
puts `make`
|
44
39
|
end
|
45
|
-
FileUtils.cp(ob_bindings_dir+"/openbabel
|
40
|
+
FileUtils.cp(ob_bindings_dir+"/openbabel.#{RbConfig::CONFIG["DLEXT"]}", "./")
|
41
|
+
File.open('Makefile', 'w') do |makefile|
|
42
|
+
makefile.write <<"EOF"
|
43
|
+
.PHONY: openbabel.#{RbConfig::CONFIG["DLEXT"]}
|
44
|
+
openbabel.#{RbConfig::CONFIG["DLEXT"]}:
|
45
|
+
chmod 755 openbabel.#{RbConfig::CONFIG["DLEXT"]}
|
46
|
+
|
47
|
+
.PHONY: install
|
48
|
+
install:
|
49
|
+
mkdir -p ../../lib/openbabel
|
50
|
+
mv openbabel.#{RbConfig::CONFIG["DLEXT"]} ../../lib/openbabel
|
51
|
+
EOF
|
52
|
+
end
|
46
53
|
ensure
|
47
54
|
FileUtils.remove_entry_secure main_dir
|
48
55
|
end
|
metadata
CHANGED
@@ -1,51 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: openbabel
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 125
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 3
|
9
|
+
- 1
|
10
|
+
- 7
|
11
|
+
version: 2.3.1.7
|
6
12
|
platform: ruby
|
7
|
-
authors:
|
13
|
+
authors:
|
8
14
|
- Andreas Maunz, Christoph Helma
|
9
15
|
autorequire:
|
10
16
|
bindir: bin
|
11
17
|
cert_chain: []
|
12
|
-
|
18
|
+
|
19
|
+
date: 2012-04-03 00:00:00 Z
|
13
20
|
dependencies: []
|
21
|
+
|
14
22
|
description: OpenBabel as a GEM
|
15
23
|
email: andreas@maunz.de
|
16
24
|
executables: []
|
17
|
-
|
25
|
+
|
26
|
+
extensions:
|
18
27
|
- ext/openbabel/extconf.rb
|
19
28
|
extra_rdoc_files: []
|
20
|
-
|
29
|
+
|
30
|
+
files:
|
21
31
|
- Rakefile
|
22
32
|
- lib/openbabel.rb
|
23
|
-
- ext/openbabel/Makefile
|
24
33
|
- test/test_openbabel.rb
|
25
34
|
- ext/openbabel/extconf.rb
|
26
35
|
homepage: http://cs.maunz.de
|
27
36
|
licenses: []
|
37
|
+
|
28
38
|
post_install_message:
|
29
39
|
rdoc_options: []
|
30
|
-
|
40
|
+
|
41
|
+
require_paths:
|
31
42
|
- lib
|
32
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
33
44
|
none: false
|
34
|
-
requirements:
|
35
|
-
- -
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
|
38
|
-
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
hash: 3
|
49
|
+
segments:
|
50
|
+
- 0
|
51
|
+
version: "0"
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
39
53
|
none: false
|
40
|
-
requirements:
|
41
|
-
- -
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
54
|
+
requirements:
|
55
|
+
- - ">="
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
hash: 3
|
58
|
+
segments:
|
59
|
+
- 0
|
60
|
+
version: "0"
|
44
61
|
requirements: []
|
62
|
+
|
45
63
|
rubyforge_project:
|
46
|
-
rubygems_version: 1.8.
|
64
|
+
rubygems_version: 1.8.15
|
47
65
|
signing_key:
|
48
66
|
specification_version: 3
|
49
67
|
summary: OpenBabel!
|
50
|
-
test_files:
|
68
|
+
test_files:
|
51
69
|
- test/test_openbabel.rb
|