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 +1 -0
- data/VERSION +1 -1
- data/ext/gme/build/Makefile +20 -20
- data/ext/gme/build/gme.o +0 -0
- data/ext/gme/build/gme_ext.so +0 -0
- data/ext/gme/build/gme_funcs.o +0 -0
- data/ext/gme/build/gme_helpers.o +0 -0
- data/ext/gme/build/mkmf.log +1 -1
- data/ext/gme/build/util.o +0 -0
- data/ext/gme/gme_funcs.c +7 -4
- data/ext/gme/gme_helpers.c +5 -1
- data/ext/gme/gme_helpers.h +6 -0
- data/ext/gme/util.c +1 -1
- data/lib/gme_ext.so +0 -0
- data/spec/emulator_spec.rb +4 -1
- metadata +11 -4
data/Rakefile
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
data/ext/gme/build/Makefile
CHANGED
@@ -4,25 +4,25 @@ SHELL = /bin/sh
|
|
4
4
|
#### Start of system configuration section. ####
|
5
5
|
|
6
6
|
srcdir = ..
|
7
|
-
topdir = /
|
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)/
|
11
|
+
prefix = $(DESTDIR)/home/cbeltranr/.rvm/rubies/ruby-1.8.7-p249
|
12
12
|
sharedstatedir = $(prefix)/com
|
13
|
-
mandir = $(
|
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 = $(
|
19
|
-
sitedir = $(
|
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 = $(
|
23
|
+
infodir = $(datarootdir)/info
|
24
24
|
vendorlibdir = $(vendordir)/$(ruby_version)
|
25
|
-
sysconfdir = $(
|
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 = $(
|
37
|
+
localstatedir = $(prefix)/var
|
38
38
|
sitelibdir = $(sitedir)/$(ruby_version)
|
39
39
|
|
40
40
|
CC = gcc
|
41
|
-
LIBRUBY = $(
|
41
|
+
LIBRUBY = $(LIBRUBY_A)
|
42
42
|
LIBRUBY_A = lib$(RUBY_SO_NAME)-static.a
|
43
|
-
LIBRUBYARG_SHARED = -
|
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 -
|
48
|
-
INCFLAGS = -I. -I. -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.
|
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 =
|
61
|
-
RUBY_SO_NAME =
|
62
|
-
arch =
|
63
|
-
sitearch =
|
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 = /
|
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 =
|
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
|
data/ext/gme/build/gme_ext.so
CHANGED
Binary file
|
data/ext/gme/build/gme_funcs.o
CHANGED
Binary file
|
data/ext/gme/build/gme_helpers.o
CHANGED
Binary file
|
data/ext/gme/build/mkmf.log
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
have_library: checking for main() in -lgme... -------------------- yes
|
2
2
|
|
3
|
-
"gcc -o conftest -I. -I/
|
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
|
|
data/ext/gme/gme_helpers.c
CHANGED
@@ -52,8 +52,12 @@ FILE* get_stdio_pointer(VALUE file)
|
|
52
52
|
{
|
53
53
|
FILE* stdio_pointer = NULL;
|
54
54
|
|
55
|
-
//
|
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
|
}
|
data/ext/gme/gme_helpers.h
CHANGED
data/ext/gme/util.c
CHANGED
data/lib/gme_ext.so
CHANGED
Binary file
|
data/spec/emulator_spec.rb
CHANGED
@@ -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
|
-
-
|
9
|
-
version: 0.1.
|
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-
|
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.
|
87
|
+
rubygems_version: 1.3.7
|
81
88
|
signing_key:
|
82
89
|
specification_version: 3
|
83
90
|
summary: gme for Ruby
|