hallon-openal 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -19,3 +19,5 @@ tmp
19
19
  *.bundle
20
20
  Makefile
21
21
  mkmf.log
22
+ .vagrant
23
+ *.so
@@ -1,3 +1,7 @@
1
+ # v0.0.3
2
+ - Check for headers in multiple locations: OpenAL/ and AL/
3
+ - Link against openal on non-OSX platforms
4
+
1
5
  # v0.0.2
2
6
  - Update dependency information; Hallon v0.12 or higher is required.
3
7
 
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
19
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
20
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
21
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -14,4 +14,4 @@ I’d be happy to discuss any and all of these with you. Feel free to [create an
14
14
 
15
15
  ## License
16
16
 
17
- X11 license. See LICENSE.txt for details.
17
+ 2-clause (simplified) BSD license. See LICENSE.txt for details.
@@ -1,15 +1,31 @@
1
1
  require 'mkmf'
2
2
 
3
+ # Miscellaneous
3
4
  def error(message)
4
5
  abort "[ERROR] #{message}"
5
6
  end
6
7
 
7
8
  $CFLAGS << ' -ggdb -O0 -Wextra'
8
9
 
10
+ # Check for headers
11
+
9
12
  error 'Missing ruby header' unless have_header 'ruby.h'
10
- error 'Missing OpenAL/alc.h' unless have_header 'OpenAL/alc.h'
11
- error 'Missing OpenAL/al.h' unless have_header 'OpenAL/al.h'
12
13
 
13
- with_ldflags('-framework OpenAL') { RUBY_PLATFORM =~ /darwin/ }
14
+ if have_header('OpenAL/alc.h')
15
+ # yay, probably mac os!
16
+ elsif have_header('AL/alc.h')
17
+ # woot, probably everybody else!
18
+ else
19
+ error 'Missing openal headers'
20
+ end
21
+
22
+ # Add library
23
+ if RUBY_PLATFORM =~ /darwin/
24
+ $LDFLAGS << ' -framework OpenAL '
25
+ elsif have_library('openal', 'alSourceQueueBuffers')
26
+ $LDFLAGS << ' -lopenal '
27
+ else
28
+ error 'Missing openal library'
29
+ end
14
30
 
15
31
  create_makefile('openal_ext')
@@ -1,8 +1,14 @@
1
1
  #include <ruby.h>
2
- #include <OpenAL/alc.h>
3
- #include <OpenAL/al.h>
4
2
  #include <unistd.h>
5
3
 
4
+ #ifdef HAVE_AL_ALC_H
5
+ # include <AL/alc.h>
6
+ # include <AL/al.h>
7
+ #elif HAVE_OPENAL_ALC_H
8
+ # include <OpenAL/alc.h>
9
+ # include <OpenAL/al.h>
10
+ #endif
11
+
6
12
  #if DEBUG_H
7
13
  # define DEBUG printf
8
14
  #else
@@ -1,5 +1,5 @@
1
1
  module Hallon
2
2
  class OpenAL
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
@@ -4,17 +4,11 @@ require 'hallon/openal'
4
4
  describe Hallon::OpenAL do
5
5
  let(:klass) { described_class }
6
6
  let(:format) { Hash.new }
7
- subject { klass.new(format) }
7
+ subject { klass.new }
8
8
 
9
- describe "#initialize" do
10
- it "should raise an error if not given a format" do
11
- expect { klass.new {} }.to raise_error(ArgumentError)
12
- end
13
- end
14
-
15
- describe "#start" do
9
+ describe "#play" do
16
10
  it "should not raise an error" do
17
- expect { subject.start }.to_not raise_error
11
+ expect { subject.play }.to_not raise_error
18
12
  end
19
13
  end
20
14
 
@@ -38,9 +32,7 @@ describe Hallon::OpenAL do
38
32
 
39
33
  describe "#format" do
40
34
  it "should be settable and gettable" do
41
- format = { channels: 1, rate: 44100 }
42
-
43
- subject.format.should == {}
35
+ subject.format.should be_nil
44
36
  subject.format = format
45
37
  subject.format.should eq format
46
38
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hallon-openal
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-04 00:00:00.000000000 Z
12
+ date: 2012-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: hallon
16
- requirement: &70281050669480 !ruby/object:Gem::Requirement
16
+ requirement: &70277904130900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.13'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70281050669480
24
+ version_requirements: *70277904130900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70281050668320 !ruby/object:Gem::Requirement
27
+ requirement: &70277904130280 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '2.7'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70281050668320
35
+ version_requirements: *70277904130280
36
36
  description:
37
37
  email:
38
38
  - kim@burgestrand.se
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  version: '0'
77
77
  requirements: []
78
78
  rubyforge_project:
79
- rubygems_version: 1.8.12
79
+ rubygems_version: 1.8.15
80
80
  signing_key:
81
81
  specification_version: 3
82
82
  summary: ! 'OpenAL audio drivers for Hallon: http://rubygems.org/gems/hallon'