gme 0.1.0-x86-linux → 0.1.1-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
data/Rakefile CHANGED
@@ -1,3 +1,4 @@
1
+ # -*- encoding: utf-8 -*-
1
2
  require 'rubygems'
2
3
 
3
4
  begin
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -4,25 +4,25 @@ SHELL = /bin/sh
4
4
  #### Start of system configuration section. ####
5
5
 
6
6
  srcdir = ..
7
- topdir = /usr/lib/ruby/1.8/i486-linux
7
+ topdir = /home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/i686-linux
8
8
  hdrdir = $(topdir)
9
9
  VPATH = $(srcdir):$(topdir):$(hdrdir)
10
10
  exec_prefix = $(prefix)
11
- prefix = $(DESTDIR)/usr
11
+ prefix = $(DESTDIR)/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249
12
12
  sharedstatedir = $(prefix)/com
13
- mandir = $(prefix)/share/man
13
+ mandir = $(datarootdir)/man
14
14
  psdir = $(docdir)
15
15
  oldincludedir = $(DESTDIR)/usr/include
16
16
  localedir = $(datarootdir)/locale
17
17
  bindir = $(exec_prefix)/bin
18
- libexecdir = $(prefix)/lib/ruby1.8
19
- sitedir = $(DESTDIR)/usr/local/lib/site_ruby
18
+ libexecdir = $(exec_prefix)/libexec
19
+ sitedir = $(libdir)/ruby/site_ruby
20
20
  htmldir = $(docdir)
21
21
  vendorarchdir = $(vendorlibdir)/$(sitearch)
22
22
  includedir = $(prefix)/include
23
- infodir = $(prefix)/share/info
23
+ infodir = $(datarootdir)/info
24
24
  vendorlibdir = $(vendordir)/$(ruby_version)
25
- sysconfdir = $(DESTDIR)/etc
25
+ sysconfdir = $(prefix)/etc
26
26
  libdir = $(exec_prefix)/lib
27
27
  sbindir = $(exec_prefix)/sbin
28
28
  rubylibdir = $(libdir)/ruby/$(ruby_version)
@@ -34,22 +34,22 @@ pdfdir = $(docdir)
34
34
  archdir = $(rubylibdir)/$(arch)
35
35
  sitearchdir = $(sitelibdir)/$(sitearch)
36
36
  datadir = $(datarootdir)
37
- localstatedir = $(DESTDIR)/var
37
+ localstatedir = $(prefix)/var
38
38
  sitelibdir = $(sitedir)/$(ruby_version)
39
39
 
40
40
  CC = gcc
41
- LIBRUBY = $(LIBRUBY_SO)
41
+ LIBRUBY = $(LIBRUBY_A)
42
42
  LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
43
- LIBRUBYARG_SHARED = -l$(RUBY_SO_NAME)
43
+ LIBRUBYARG_SHARED = -Wl,-R -Wl,$(libdir) -L$(libdir)
44
44
  LIBRUBYARG_STATIC = -l$(RUBY_SO_NAME)-static
45
45
 
46
46
  RUBY_EXTCONF_H =
47
- CFLAGS = -fPIC -fno-strict-aliasing -g -g -O2 -fPIC $(cflags)
48
- INCFLAGS = -I. -I. -I/usr/lib/ruby/1.8/i486-linux -I..
47
+ CFLAGS = -fPIC -g -O2 $(cflags)
48
+ INCFLAGS = -I. -I. -I/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/i686-linux -I..
49
49
  DEFS = -D_FILE_OFFSET_BITS=64
50
50
  CPPFLAGS = -D_FILE_OFFSET_BITS=64
51
51
  CXXFLAGS = $(CFLAGS)
52
- ldflags = -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic
52
+ ldflags = -L. -rdynamic -Wl,-export-dynamic
53
53
  dldflags =
54
54
  archflag =
55
55
  DLDFLAGS = $(ldflags) $(dldflags) $(archflag)
@@ -57,12 +57,12 @@ LDSHARED = $(CC) -shared
57
57
  AR = ar
58
58
  EXEEXT =
59
59
 
60
- RUBY_INSTALL_NAME = ruby1.8
61
- RUBY_SO_NAME = ruby1.8
62
- arch = i486-linux
63
- sitearch = i486-linux
60
+ RUBY_INSTALL_NAME = ruby
61
+ RUBY_SO_NAME = ruby
62
+ arch = i686-linux
63
+ sitearch = i686-linux
64
64
  ruby_version = 1.8
65
- ruby = /usr/bin/ruby1.8
65
+ ruby = /home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/bin/ruby
66
66
  RUBY = $(ruby)
67
67
  RM = rm -f
68
68
  MAKEDIRS = mkdir -p
@@ -76,7 +76,7 @@ COPY = cp
76
76
  preload =
77
77
 
78
78
  libpath = . $(libdir)
79
- LIBPATH = -L. -L$(libdir)
79
+ LIBPATH = -L. -L$(libdir) -Wl,-R$(libdir)
80
80
  DEFFILE =
81
81
 
82
82
  CLEANFILES = mkmf.log
@@ -86,7 +86,7 @@ extout =
86
86
  extout_prefix =
87
87
  target_prefix =
88
88
  LOCAL_LIBS =
89
- LIBS = $(LIBRUBYARG_SHARED) -lgme -lpthread -lrt -ldl -lcrypt -lm -lc
89
+ LIBS = -lgme -lrt -ldl -lcrypt -lm -lc
90
90
  SRCS = gme.c util.c gme_funcs.c gme_helpers.c
91
91
  OBJS = gme.o util.o gme_funcs.o gme_helpers.o
92
92
  TARGET = gme_ext
data/ext/gme/build/gme.o CHANGED
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  have_library: checking for main() in -lgme... -------------------- yes
2
2
 
3
- "gcc -o conftest -I. -I/usr/lib/ruby/1.8/i486-linux -I.. -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -g -g -O2 -fPIC conftest.c -L. -L/usr/lib -L. -Wl,-Bsymbolic-functions -rdynamic -Wl,-export-dynamic -lruby1.8-static -lgme -lpthread -lrt -ldl -lcrypt -lm -lc"
3
+ "gcc -o conftest -I. -I/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/i686-linux -I.. -D_FILE_OFFSET_BITS=64 -g -O2 -O0 -ggdb conftest.c -L. -L/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/lib -Wl,-R/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249/lib -L. -rdynamic -Wl,-export-dynamic -lruby-static -lgme -lrt -ldl -lcrypt -lm -lc"
4
4
  checked program was:
5
5
  /* begin */
6
6
  1: /*top*/
data/ext/gme/build/util.o CHANGED
Binary file
data/ext/gme/gme_funcs.c CHANGED
@@ -2,8 +2,6 @@
2
2
  #include "gme_helpers.h"
3
3
  #include "util.h"
4
4
 
5
- #include <rubyio.h>
6
-
7
5
  extern VALUE cEmulator;
8
6
  extern VALUE eGenericException;
9
7
  extern VALUE eInvalidFile;
@@ -104,9 +102,15 @@ VALUE gme_ruby_close(VALUE self)
104
102
  // recovers a pointer to the internal buffer
105
103
  c_buffer = (short*) NUM2LONG(rb_iv_get(self, "@internal_buffer"));
106
104
 
107
- // releases the memory
105
+ // releases the memory for the buffer
108
106
  if(c_buffer != NULL) free(c_buffer);
109
107
 
108
+ // release the memory for the emulator struct
109
+ // TODO: Do we really need this? why the gc isn't releasing this memory?
110
+ // Apparently, uncommenting this line causes a double free error.
111
+ // So, the GC actually calls it, but still there are memory leaks...
112
+ // gme_ruby_emu_free(emulator);
113
+
110
114
  return Qnil;
111
115
  }
112
116
 
@@ -167,7 +171,6 @@ VALUE gme_ruby_start_track(int argc, VALUE* argv, VALUE self)
167
171
  VALUE gme_ruby_get_samples(VALUE self)
168
172
  {
169
173
  Music_Emu* emulator;
170
- int c_samples;
171
174
  short* c_buffer;
172
175
  int c_buffer_len;
173
176
 
@@ -52,8 +52,12 @@ FILE* get_stdio_pointer(VALUE file)
52
52
  {
53
53
  FILE* stdio_pointer = NULL;
54
54
 
55
- // TODO: fix for ruby-1.9 (fptr->stdio_file)
55
+ // recover the file pointer depending on the ruby version
56
+ #if HAVE_RUBY_IO_H
57
+ stdio_pointer = rb_io_stdio_file(RFILE(file)->fptr);
58
+ #else
56
59
  stdio_pointer = RFILE(file)->fptr->f;
60
+ #endif
57
61
 
58
62
  return stdio_pointer;
59
63
  }
@@ -2,7 +2,13 @@
2
2
  #define _GME_HELPERS_H
3
3
 
4
4
  #include <ruby.h>
5
+ #ifdef HAVE_RUBY_IO_H
6
+ #include <ruby/io.h>
7
+ #else
5
8
  #include <rubyio.h>
9
+ #endif
10
+
11
+ #include <gme/gme.h>
6
12
 
7
13
  extern VALUE eTrackNotStarted;
8
14
  extern VALUE eGenericException;
data/ext/gme/util.c CHANGED
@@ -3,7 +3,7 @@
3
3
  void handle_error(const char* string, VALUE exception)
4
4
  {
5
5
  if(string) {
6
- rb_raise(exception, string);
6
+ rb_raise(exception, "%s", string);
7
7
  }
8
8
  }
9
9
 
data/lib/gme_ext.so CHANGED
Binary file
@@ -9,6 +9,10 @@ describe Emulator, "when first created" do
9
9
  path = File.expand_path(File.dirname(__FILE__) + '/fixtures/sample.spc')
10
10
  @song = Emulator.open(path)
11
11
  end
12
+
13
+ after(:each) do
14
+ @song.close
15
+ end
12
16
 
13
17
  it "should not be nil" do
14
18
  @song.should_not be_nil
@@ -62,7 +66,6 @@ describe Emulator, "when first created" do
62
66
 
63
67
  it "should play track 0 and write the samples to the specified file" do
64
68
  lambda { @song.play_to_file(@file) }.should_not raise_exception
65
- @song.close
66
69
  File.size("temp.out").should == 706560
67
70
  # TODO: check correctness of the generated file
68
71
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gme
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 25
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 1
8
- - 0
9
- version: 0.1.0
9
+ - 1
10
+ version: 0.1.1
10
11
  platform: x86-linux
11
12
  authors:
12
13
  - "Carlos Beltr\xC3\xA1n-Recabarren"
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-05-14 00:00:00 -04:00
18
+ date: 2010-05-15 00:00:00 -04:00
18
19
  default_executable:
19
20
  dependencies: []
20
21
 
@@ -51,6 +52,8 @@ files:
51
52
  - lib/gme/exceptions.rb
52
53
  - lib/gme/gme.rb
53
54
  - lib/gme_ext.so
55
+ - spec/spec_helper.rb
56
+ - spec/emulator_spec.rb
54
57
  has_rdoc: true
55
58
  homepage: http://www.beltran-recabarren.com
56
59
  licenses: []
@@ -61,23 +64,27 @@ rdoc_options:
61
64
  require_paths:
62
65
  - lib
63
66
  required_ruby_version: !ruby/object:Gem::Requirement
67
+ none: false
64
68
  requirements:
65
69
  - - ">="
66
70
  - !ruby/object:Gem::Version
71
+ hash: 3
67
72
  segments:
68
73
  - 0
69
74
  version: "0"
70
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
+ none: false
71
77
  requirements:
72
78
  - - ">="
73
79
  - !ruby/object:Gem::Version
80
+ hash: 3
74
81
  segments:
75
82
  - 0
76
83
  version: "0"
77
84
  requirements:
78
85
  - libgme v0.5.5 (http://code.google.com/p/game-music-emu/) by Blargg
79
86
  rubyforge_project:
80
- rubygems_version: 1.3.6
87
+ rubygems_version: 1.3.7
81
88
  signing_key:
82
89
  specification_version: 3
83
90
  summary: gme for Ruby