wit 1.0.5 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/ext/wit/extconf.rb +46 -16
- data/ext/wit/extconf.rb_ +39 -0
- data/ext/wit/wit.c +0 -1
- metadata +8 -8
- data/ext/wit/libwit/lib/libwit.a +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
MzY1NWI4ODFiMzhkMTNhMzA4NjEwYTQ3MDQwOGI4MjMwNWViYjE1Mw==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTRjZTg4MGVhYWJkYzUzNTZkMTFhNDc0NzE3ZDA4ZGM1MjJlYmMyNw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NDQ3MjgwMjQ3YmViMGRlMTY4OGVlMTVmMmRkZTkwZTE1ODdjNDExYWIyMjkw
|
10
|
+
YTc5YzVjODc3NTk4MDNlMjkyM2IwN2QyNjk3ZDg3Y2M1ZWI0MjFhZDg3ZTUx
|
11
|
+
OWEyYTNiZmM0YzA0ODFiNTAzMDZlZDhmYmE4NjczYmE2MWJmYmM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MWZkZGI0Y2Q4NjQ0OTZjOTZlZTNkMjg0YzYyYjgyYWU1Yzc2ODg1ZmIxMDVm
|
14
|
+
NGFlNDQxNzU1ZDI5OGY3MzkwMGYzNzVjYmQ0ZjExODA2ZWFlYmI0OTU3MTky
|
15
|
+
MzU5N2RlYTIwMDNhNGI2YjZiNGFjNDcyNjQzZjc3NzNiNGFiODY=
|
data/ext/wit/extconf.rb
CHANGED
@@ -1,38 +1,68 @@
|
|
1
1
|
require "mkmf"
|
2
|
+
require 'open-uri'
|
3
|
+
require 'fileutils'
|
2
4
|
|
3
5
|
PATH = File.expand_path(File.dirname(__FILE__))
|
4
6
|
|
5
7
|
LIBDIR = RbConfig::CONFIG['libdir']
|
6
8
|
INCLUDEDIR = RbConfig::CONFIG['includedir']
|
7
9
|
HEADER_DIRS = [
|
8
|
-
PATH
|
10
|
+
"#{PATH}/libwit/include",
|
9
11
|
INCLUDEDIR
|
10
12
|
]
|
11
13
|
LIB_DIRS = [
|
12
|
-
PATH
|
14
|
+
"#{PATH}/libwit/lib",
|
13
15
|
LIBDIR
|
14
16
|
]
|
15
17
|
|
16
|
-
if RUBY_PLATFORM.include?
|
17
|
-
LIBWIT_FILE =
|
18
|
-
elsif RUBY_PLATFORM.include?
|
19
|
-
if RUBY_PLATFORM.include?
|
20
|
-
LIBWIT_FILE =
|
18
|
+
if RUBY_PLATFORM.include? 'arm'
|
19
|
+
LIBWIT_FILE = 'libwit-armv6.a'
|
20
|
+
elsif RUBY_PLATFORM.include? '64'
|
21
|
+
if RUBY_PLATFORM.include? 'darwin'
|
22
|
+
LIBWIT_FILE = 'libwit-64-darwin.a'
|
21
23
|
else
|
22
|
-
LIBWIT_FILE =
|
24
|
+
LIBWIT_FILE = 'libwit-64-linux.a'
|
23
25
|
end
|
24
26
|
else
|
25
|
-
LIBWIT_FILE =
|
27
|
+
LIBWIT_FILE = 'libwit-32-linux.a'
|
26
28
|
end
|
27
|
-
|
29
|
+
LIBWIT_PATH = "#{PATH}/libwit/lib/libwit.a"
|
28
30
|
|
29
|
-
|
31
|
+
if !File.file?(LIBWIT_PATH)
|
32
|
+
puts "Fetching libwit..."
|
33
|
+
dir = File.dirname(LIBWIT_PATH)
|
34
|
+
unless File.directory?(dir)
|
35
|
+
FileUtils.mkdir_p(dir)
|
36
|
+
end
|
37
|
+
open(LIBWIT_PATH, 'wb') do |file|
|
38
|
+
total = nil
|
39
|
+
file << open("https://github.com/wit-ai/libwit/releases/download/1.1.2/#{LIBWIT_FILE}",
|
40
|
+
:content_length_proc => lambda {|t|
|
41
|
+
total = t
|
42
|
+
print "0/#{total} bytes downloaded"
|
43
|
+
STDOUT.flush
|
44
|
+
},
|
45
|
+
:progress_proc => lambda {|s|
|
46
|
+
print "\r#{s}/#{total} bytes downloaded"
|
47
|
+
STDOUT.flush
|
48
|
+
}).read
|
49
|
+
end
|
50
|
+
STDOUT.print(" done\n")
|
51
|
+
end
|
52
|
+
|
53
|
+
if RUBY_PLATFORM.include? 'darwin'
|
54
|
+
libs = ['wit', 'ssl', 'crypto', 'z', 'sox', 'System', 'pthread', 'c', 'm']
|
55
|
+
else
|
56
|
+
libs = ['wit', 'rt', 'sox', 'ssl', 'crypto', 'dl', 'pthread', 'rt', 'gcc_s', 'pthread', 'c', 'm']
|
57
|
+
end
|
58
|
+
|
59
|
+
$LOCAL_LIBS = '-l' + libs.join(' -l')
|
30
60
|
|
31
61
|
dir_config 'wit', HEADER_DIRS, LIB_DIRS
|
32
62
|
|
33
|
-
|
34
|
-
abort "missing
|
35
|
-
|
36
|
-
abort
|
63
|
+
for lib in libs
|
64
|
+
abort "Error: missing #{lib}" unless have_library lib
|
65
|
+
end
|
66
|
+
abort 'Error: missing wit.h' unless have_header 'wit.h'
|
37
67
|
|
38
|
-
create_makefile
|
68
|
+
create_makefile 'wit'
|
data/ext/wit/extconf.rb_
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require "mkmf"
|
2
|
+
|
3
|
+
PATH = File.expand_path(File.dirname(__FILE__))
|
4
|
+
|
5
|
+
LIBDIR = RbConfig::CONFIG['libdir']
|
6
|
+
INCLUDEDIR = RbConfig::CONFIG['includedir']
|
7
|
+
HEADER_DIRS = [
|
8
|
+
PATH + '/libwit/include',
|
9
|
+
INCLUDEDIR
|
10
|
+
]
|
11
|
+
LIB_DIRS = [
|
12
|
+
PATH + '/libwit/lib',
|
13
|
+
LIBDIR
|
14
|
+
]
|
15
|
+
|
16
|
+
if RUBY_PLATFORM.include? "arm"
|
17
|
+
LIBWIT_FILE = "libwit-armv6.a"
|
18
|
+
elsif RUBY_PLATFORM.include? "64"
|
19
|
+
if RUBY_PLATFORM.include? "darwin"
|
20
|
+
LIBWIT_FILE = "libwit-64-darwin.a"
|
21
|
+
else
|
22
|
+
LIBWIT_FILE = "libwit-64-linux.a"
|
23
|
+
end
|
24
|
+
else
|
25
|
+
LIBWIT_FILE = "libwit-32-linux.a"
|
26
|
+
end
|
27
|
+
|
28
|
+
abort "unable to retrieve libwit" unless system('curl -Ss -L -o libwit.a https://github.com/wit-ai/libwit/releases/download/1.1.1/' + LIBWIT_FILE, :chdir=> PATH + '/libwit/lib')
|
29
|
+
|
30
|
+
$LOCAL_LIBS = '-lwit -lsox -lcurl'
|
31
|
+
|
32
|
+
dir_config 'wit', HEADER_DIRS, LIB_DIRS
|
33
|
+
|
34
|
+
abort "missing sox" unless have_library "sox"
|
35
|
+
abort "missing curl" unless have_library "curl"
|
36
|
+
abort "missing wit.h" unless have_header "wit.h"
|
37
|
+
abort "missing libwit" unless have_library "wit"
|
38
|
+
|
39
|
+
create_makefile "wit"
|
data/ext/wit/wit.c
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Odent
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby SDK for Wit.AI
|
14
14
|
email: julien@wit.ai
|
@@ -18,12 +18,12 @@ extensions:
|
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
20
|
- ext/wit/extconf.rb
|
21
|
+
- ext/wit/extconf.rb_
|
21
22
|
- ext/wit/libwit/include/wit.h
|
22
|
-
- ext/wit/libwit/lib/libwit.a
|
23
23
|
- ext/wit/wit.c
|
24
24
|
homepage: http://wit.ai
|
25
25
|
licenses:
|
26
|
-
-
|
26
|
+
- GPL-2.0
|
27
27
|
metadata: {}
|
28
28
|
post_install_message:
|
29
29
|
rdoc_options: []
|
@@ -31,17 +31,17 @@ require_paths:
|
|
31
31
|
- lib
|
32
32
|
required_ruby_version: !ruby/object:Gem::Requirement
|
33
33
|
requirements:
|
34
|
-
- -
|
34
|
+
- - ! '>='
|
35
35
|
- !ruby/object:Gem::Version
|
36
|
-
version:
|
36
|
+
version: 1.9.3
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - ! '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: '0'
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
|
-
rubygems_version: 2.
|
44
|
+
rubygems_version: 2.2.2
|
45
45
|
signing_key:
|
46
46
|
specification_version: 4
|
47
47
|
summary: Ruby SDK for Wit
|
data/ext/wit/libwit/lib/libwit.a
DELETED
File without changes
|