rtaglib 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. data/History.txt +4 -0
  2. data/Manifest.txt +84 -9
  3. data/README.txt +0 -0
  4. data/Rakefile +30 -27
  5. data/{test/data → data}/440Hz-5sec.flac +0 -0
  6. data/{test/data → data}/440Hz-5sec.mp3 +0 -0
  7. data/{test/data → data}/440Hz-5sec.mpc +0 -0
  8. data/{test/data → data}/440Hz-5sec.ogg +0 -0
  9. data/{test/data → data}/440Hz-5sec.wv +0 -0
  10. data/data/test_jason.mp3 +0 -0
  11. data/data/test_jason.ogg +0 -0
  12. data/ext/Rakefile +10 -0
  13. data/ext/tagfile/Rakefile.rb +42 -0
  14. data/ext/tagfile/rake_ext_conf.rb +29 -0
  15. data/ext/tagfile/tagfile.c +11 -7
  16. data/ext/taglib/Rakefile.rb +48 -0
  17. data/ext/taglib/rake_ext_conf.rb +33 -0
  18. data/ext/taglib/taglib-mswin32/bin/tag.dll +0 -0
  19. data/ext/taglib/taglib-mswin32/bin/tag_c.dll +0 -0
  20. data/ext/taglib/taglib-mswin32/bin/tag_cd.dll +0 -0
  21. data/ext/taglib/taglib-mswin32/bin/tagd.dll +0 -0
  22. data/ext/taglib/taglib-mswin32/bin/taglib-config +55 -0
  23. data/ext/taglib/taglib-mswin32/include/taglib/apefooter.h +173 -0
  24. data/ext/taglib/taglib-mswin32/include/taglib/apeitem.h +204 -0
  25. data/ext/taglib/taglib-mswin32/include/taglib/apetag.h +162 -0
  26. data/ext/taglib/taglib-mswin32/include/taglib/attachedpictureframe.h +220 -0
  27. data/ext/taglib/taglib-mswin32/include/taglib/audioproperties.h +110 -0
  28. data/ext/taglib/taglib-mswin32/include/taglib/commentsframe.h +168 -0
  29. data/ext/taglib/taglib-mswin32/include/taglib/fileref.h +262 -0
  30. data/ext/taglib/taglib-mswin32/include/taglib/flacfile.h +201 -0
  31. data/ext/taglib/taglib-mswin32/include/taglib/flacproperties.h +92 -0
  32. data/ext/taglib/taglib-mswin32/include/taglib/generalencapsulatedobjectframe.h +174 -0
  33. data/ext/taglib/taglib-mswin32/include/taglib/id3v1genres.h +66 -0
  34. data/ext/taglib/taglib-mswin32/include/taglib/id3v1tag.h +180 -0
  35. data/ext/taglib/taglib-mswin32/include/taglib/id3v2extendedheader.h +93 -0
  36. data/ext/taglib/taglib-mswin32/include/taglib/id3v2footer.h +82 -0
  37. data/ext/taglib/taglib-mswin32/include/taglib/id3v2frame.h +414 -0
  38. data/ext/taglib/taglib-mswin32/include/taglib/id3v2framefactory.h +167 -0
  39. data/ext/taglib/taglib-mswin32/include/taglib/id3v2header.h +175 -0
  40. data/ext/taglib/taglib-mswin32/include/taglib/id3v2synchdata.h +70 -0
  41. data/ext/taglib/taglib-mswin32/include/taglib/id3v2tag.h +300 -0
  42. data/ext/taglib/taglib-mswin32/include/taglib/mpcfile.h +175 -0
  43. data/ext/taglib/taglib-mswin32/include/taglib/mpcproperties.h +85 -0
  44. data/ext/taglib/taglib-mswin32/include/taglib/mpegfile.h +277 -0
  45. data/ext/taglib/taglib-mswin32/include/taglib/mpegheader.h +166 -0
  46. data/ext/taglib/taglib-mswin32/include/taglib/mpegproperties.h +118 -0
  47. data/ext/taglib/taglib-mswin32/include/taglib/oggfile.h +112 -0
  48. data/ext/taglib/taglib-mswin32/include/taglib/oggflacfile.h +118 -0
  49. data/ext/taglib/taglib-mswin32/include/taglib/oggpage.h +203 -0
  50. data/ext/taglib/taglib-mswin32/include/taglib/oggpageheader.h +232 -0
  51. data/ext/taglib/taglib-mswin32/include/taglib/relativevolumeframe.h +274 -0
  52. data/ext/taglib/taglib-mswin32/include/taglib/speexfile.h +99 -0
  53. data/ext/taglib/taglib-mswin32/include/taglib/speexproperties.h +89 -0
  54. data/ext/taglib/taglib-mswin32/include/taglib/tag.h +173 -0
  55. data/ext/taglib/taglib-mswin32/include/taglib/tag_c.h +288 -0
  56. data/ext/taglib/taglib-mswin32/include/taglib/taglib.h +177 -0
  57. data/ext/taglib/taglib-mswin32/include/taglib/taglib_export.h +39 -0
  58. data/ext/taglib/taglib-mswin32/include/taglib/tbytevector.h +409 -0
  59. data/ext/taglib/taglib-mswin32/include/taglib/tbytevectorlist.h +91 -0
  60. data/ext/taglib/taglib-mswin32/include/taglib/textidentificationframe.h +258 -0
  61. data/ext/taglib/taglib-mswin32/include/taglib/tfile.h +271 -0
  62. data/ext/taglib/taglib-mswin32/include/taglib/tlist.h +252 -0
  63. data/ext/taglib/taglib-mswin32/include/taglib/tlist.tcc +316 -0
  64. data/ext/taglib/taglib-mswin32/include/taglib/tmap.h +200 -0
  65. data/ext/taglib/taglib-mswin32/include/taglib/tmap.tcc +196 -0
  66. data/ext/taglib/taglib-mswin32/include/taglib/trueaudiofile.h +180 -0
  67. data/ext/taglib/taglib-mswin32/include/taglib/trueaudioproperties.h +93 -0
  68. data/ext/taglib/taglib-mswin32/include/taglib/tstring.h +456 -0
  69. data/ext/taglib/taglib-mswin32/include/taglib/tstringlist.h +115 -0
  70. data/ext/taglib/taglib-mswin32/include/taglib/uniquefileidentifierframe.h +113 -0
  71. data/ext/taglib/taglib-mswin32/include/taglib/unknownframe.h +79 -0
  72. data/ext/taglib/taglib-mswin32/include/taglib/unsynchronizedlyricsframe.h +157 -0
  73. data/ext/taglib/taglib-mswin32/include/taglib/urllinkframe.h +172 -0
  74. data/ext/taglib/taglib-mswin32/include/taglib/vorbisfile.h +118 -0
  75. data/ext/taglib/taglib-mswin32/include/taglib/vorbisproperties.h +125 -0
  76. data/ext/taglib/taglib-mswin32/include/taglib/wavpackfile.h +164 -0
  77. data/ext/taglib/taglib-mswin32/include/taglib/wavpackproperties.h +94 -0
  78. data/ext/taglib/taglib-mswin32/include/taglib/xingheader.h +100 -0
  79. data/ext/taglib/taglib-mswin32/include/taglib/xiphcomment.h +202 -0
  80. data/ext/taglib/taglib-mswin32/lib/pkgconfig/taglib_c.pc +12 -0
  81. data/ext/taglib/taglib-mswin32/lib/tag.lib +0 -0
  82. data/ext/taglib/taglib-mswin32/lib/tag_c.lib +0 -0
  83. data/ext/taglib/taglib_i386-mingw32.source +22645 -0
  84. data/ext/taglib/taglib_i386-mswin32.source +22645 -0
  85. data/ext/taglib/{taglib.cxx → taglib_x86_64-linux.source} +508 -75
  86. data/lib/TagLib.rb +3 -2
  87. data/lib/TagLib_doc.rb +1532 -1526
  88. data/lib/rtaglib_mswin32.rb +4 -0
  89. data/lib/tagfile.rb +6 -0
  90. data/swig/Doxyfile +0 -0
  91. data/swig/Rakefile +44 -19
  92. data/swig/TagLib_doc.rb +2755 -0
  93. data/swig/make_doc.rb +5 -4
  94. data/swig/process_cxx.rb +2 -2
  95. data/swig/rake_ext_conf.rb +33 -0
  96. data/swig/taglib.i +8 -5
  97. data/swig/test.rb +47 -39
  98. data/test/test_read.rb +4 -3
  99. data/test/test_taglib.rb +47 -39
  100. data/test/test_write.rb +4 -3
  101. metadata +96 -20
  102. data/ext/tagfile/extconf.rb +0 -14
  103. data/ext/taglib/extconf.rb +0 -22
  104. data/swig/extconf.rb +0 -22
@@ -1,3 +1,7 @@
1
+ === 0.3.0 / 2009-08-16
2
+ * New build configuration, based on Rakefiles instead of extconf.rb . Allows to compile cleanly on mswin32, mingw and *nix
3
+ * Input string should be created with TagLib::String.new. Allows to insert UTF8 or Latin-1.
4
+
1
5
  === 0.2.3 / 2009-05-20
2
6
 
3
7
  * Better configuration for compilation on *nix archs.
@@ -2,24 +2,99 @@ History.txt
2
2
  Manifest.txt
3
3
  README.txt
4
4
  Rakefile
5
- ext/tagfile/extconf.rb
5
+ data/440Hz-5sec.flac
6
+ data/440Hz-5sec.mp3
7
+ data/440Hz-5sec.mpc
8
+ data/440Hz-5sec.ogg
9
+ data/440Hz-5sec.wv
10
+ data/test_jason.mp3
11
+ data/test_jason.ogg
12
+ ext/Rakefile
13
+ ext/tagfile/Rakefile.rb
14
+ ext/tagfile/rake_ext_conf.rb
6
15
  ext/tagfile/tagfile.c
7
- ext/taglib/extconf.rb
8
- ext/taglib/taglib.cxx
16
+ ext/taglib/Rakefile.rb
17
+ ext/taglib/rake_ext_conf.rb
18
+ ext/taglib/taglib-mswin32/bin/tag.dll
19
+ ext/taglib/taglib-mswin32/bin/tag_c.dll
20
+ ext/taglib/taglib-mswin32/bin/tag_cd.dll
21
+ ext/taglib/taglib-mswin32/bin/tagd.dll
22
+ ext/taglib/taglib-mswin32/bin/taglib-config
23
+ ext/taglib/taglib-mswin32/include/taglib/apefooter.h
24
+ ext/taglib/taglib-mswin32/include/taglib/apeitem.h
25
+ ext/taglib/taglib-mswin32/include/taglib/apetag.h
26
+ ext/taglib/taglib-mswin32/include/taglib/attachedpictureframe.h
27
+ ext/taglib/taglib-mswin32/include/taglib/audioproperties.h
28
+ ext/taglib/taglib-mswin32/include/taglib/commentsframe.h
29
+ ext/taglib/taglib-mswin32/include/taglib/fileref.h
30
+ ext/taglib/taglib-mswin32/include/taglib/flacfile.h
31
+ ext/taglib/taglib-mswin32/include/taglib/flacproperties.h
32
+ ext/taglib/taglib-mswin32/include/taglib/generalencapsulatedobjectframe.h
33
+ ext/taglib/taglib-mswin32/include/taglib/id3v1genres.h
34
+ ext/taglib/taglib-mswin32/include/taglib/id3v1tag.h
35
+ ext/taglib/taglib-mswin32/include/taglib/id3v2extendedheader.h
36
+ ext/taglib/taglib-mswin32/include/taglib/id3v2footer.h
37
+ ext/taglib/taglib-mswin32/include/taglib/id3v2frame.h
38
+ ext/taglib/taglib-mswin32/include/taglib/id3v2framefactory.h
39
+ ext/taglib/taglib-mswin32/include/taglib/id3v2header.h
40
+ ext/taglib/taglib-mswin32/include/taglib/id3v2synchdata.h
41
+ ext/taglib/taglib-mswin32/include/taglib/id3v2tag.h
42
+ ext/taglib/taglib-mswin32/include/taglib/mpcfile.h
43
+ ext/taglib/taglib-mswin32/include/taglib/mpcproperties.h
44
+ ext/taglib/taglib-mswin32/include/taglib/mpegfile.h
45
+ ext/taglib/taglib-mswin32/include/taglib/mpegheader.h
46
+ ext/taglib/taglib-mswin32/include/taglib/mpegproperties.h
47
+ ext/taglib/taglib-mswin32/include/taglib/oggfile.h
48
+ ext/taglib/taglib-mswin32/include/taglib/oggflacfile.h
49
+ ext/taglib/taglib-mswin32/include/taglib/oggpage.h
50
+ ext/taglib/taglib-mswin32/include/taglib/oggpageheader.h
51
+ ext/taglib/taglib-mswin32/include/taglib/relativevolumeframe.h
52
+ ext/taglib/taglib-mswin32/include/taglib/speexfile.h
53
+ ext/taglib/taglib-mswin32/include/taglib/speexproperties.h
54
+ ext/taglib/taglib-mswin32/include/taglib/tag.h
55
+ ext/taglib/taglib-mswin32/include/taglib/tag_c.h
56
+ ext/taglib/taglib-mswin32/include/taglib/taglib.h
57
+ ext/taglib/taglib-mswin32/include/taglib/taglib_export.h
58
+ ext/taglib/taglib-mswin32/include/taglib/tbytevector.h
59
+ ext/taglib/taglib-mswin32/include/taglib/tbytevectorlist.h
60
+ ext/taglib/taglib-mswin32/include/taglib/textidentificationframe.h
61
+ ext/taglib/taglib-mswin32/include/taglib/tfile.h
62
+ ext/taglib/taglib-mswin32/include/taglib/tlist.h
63
+ ext/taglib/taglib-mswin32/include/taglib/tlist.tcc
64
+ ext/taglib/taglib-mswin32/include/taglib/tmap.h
65
+ ext/taglib/taglib-mswin32/include/taglib/tmap.tcc
66
+ ext/taglib/taglib-mswin32/include/taglib/trueaudiofile.h
67
+ ext/taglib/taglib-mswin32/include/taglib/trueaudioproperties.h
68
+ ext/taglib/taglib-mswin32/include/taglib/tstring.h
69
+ ext/taglib/taglib-mswin32/include/taglib/tstringlist.h
70
+ ext/taglib/taglib-mswin32/include/taglib/uniquefileidentifierframe.h
71
+ ext/taglib/taglib-mswin32/include/taglib/unknownframe.h
72
+ ext/taglib/taglib-mswin32/include/taglib/unsynchronizedlyricsframe.h
73
+ ext/taglib/taglib-mswin32/include/taglib/urllinkframe.h
74
+ ext/taglib/taglib-mswin32/include/taglib/vorbisfile.h
75
+ ext/taglib/taglib-mswin32/include/taglib/vorbisproperties.h
76
+ ext/taglib/taglib-mswin32/include/taglib/wavpackfile.h
77
+ ext/taglib/taglib-mswin32/include/taglib/wavpackproperties.h
78
+ ext/taglib/taglib-mswin32/include/taglib/xingheader.h
79
+ ext/taglib/taglib-mswin32/include/taglib/xiphcomment.h
80
+ ext/taglib/taglib-mswin32/lib/pkgconfig/taglib_c.pc
81
+ ext/taglib/taglib-mswin32/lib/tag.lib
82
+ ext/taglib/taglib-mswin32/lib/tag_c.lib
83
+ ext/taglib/taglib_i386-mingw32.source
84
+ ext/taglib/taglib_i386-mswin32.source
85
+ ext/taglib/taglib_x86_64-linux.source
9
86
  lib/TagLib.rb
10
87
  lib/TagLib_doc.rb
88
+ lib/rtaglib_mswin32.rb
89
+ lib/tagfile.rb
11
90
  swig/Doxyfile
12
91
  swig/Rakefile
13
- swig/extconf.rb
92
+ swig/TagLib_doc.rb
14
93
  swig/make_doc.rb
15
94
  swig/process_cxx.rb
95
+ swig/rake_ext_conf.rb
16
96
  swig/taglib.i
17
97
  swig/test.rb
18
- test/data/440Hz-5sec.flac
19
- test/data/440Hz-5sec.mp3
20
- test/data/440Hz-5sec.mpc
21
- test/data/440Hz-5sec.ogg
22
- test/data/440Hz-5sec.wv
23
98
  test/test_read.rb
24
99
  test/test_taglib.rb
25
100
  test/test_write.rb
data/README.txt CHANGED
File without changes
data/Rakefile CHANGED
@@ -2,7 +2,16 @@
2
2
  # -*- ruby -*-
3
3
  require 'rake/testtask'
4
4
  require 'rake/rdoctask'
5
+ require 'rubygems'
6
+ require 'fileutils'
7
+ require 'hoe'
8
+ $:.unshift("./ext")
9
+ $:.unshift("./lib")
10
+
5
11
 
12
+
13
+
14
+ taglib_source="taglib_#{PLATFORM}.source"
6
15
  desc "compile and test"
7
16
  task :default => [:compile, :test]
8
17
 
@@ -12,15 +21,16 @@ BASE_TAGLIB=File.dirname(__FILE__)+"/ext/taglib"
12
21
 
13
22
 
14
23
 
15
- file "#{BASE_TAGFILE}/tagfile.so" => ["#{BASE_TAGFILE}/tagfile.c", "#{BASE_TAGFILE}/Makefile"] do |t|
16
- system %(cd "#{BASE_TAGFILE}" && make)
24
+ file "#{BASE_TAGFILE}/tagfile.so" => ["#{BASE_TAGFILE}/tagfile.c", "#{BASE_TAGFILE}/Rakefile.rb"] do |t|
25
+ system %(cd "#{BASE_TAGFILE}" && rake)
17
26
  end
18
27
 
19
- file "#{BASE_TAGLIB}/taglib.so" => ["#{BASE_TAGLIB}/taglib.cxx", "#{BASE_TAGLIB}/Makefile"] do |t|
20
- system %(cd "#{BASE_TAGLIB}" && make)
28
+ file "#{BASE_TAGLIB}/TagLib.so" => ["#{BASE_TAGLIB}/#{taglib_source}", "#{BASE_TAGLIB}/rake_ext_conf.rb", "#{BASE_TAGLIB}/Rakefile.rb"] do |t|
29
+ system %(cd "#{BASE_TAGLIB}" && rake)
21
30
  end
31
+
22
32
  if system %(which swig)
23
- file "#{BASE_TAGLIB}/taglib.cxx" => ["swig/taglib.i","swig/extconf.rb"] do |t|
33
+ file "#{BASE_TAGLIB}/#{taglib_source}" => ["swig/taglib.i", "swig/rake_ext_conf.rb", "swig/Rakefile"] do |t|
24
34
  system %{cd swig && rake}
25
35
  end
26
36
  end
@@ -28,20 +38,16 @@ end
28
38
  file "lib/TagLib_doc.rb" => "swig/TagLib_doc.rb" do |t|
29
39
  system %(cd swig && rake copy)
30
40
  end
31
- exts=[BASE_TAGFILE,BASE_TAGLIB]
32
- exts.each {|base|
33
- file "#{base}/Makefile" => ["#{base}/extconf.rb"] do |t|
34
- system %(cd "#{base}" && ruby "extconf.rb")
35
- end
36
- }
37
41
 
38
42
  desc "compile the extensions"
39
- task :compile => ["#{BASE_TAGFILE}/tagfile.so","#{BASE_TAGLIB}/taglib.so"]
40
-
41
- Rake::TestTask.new do |t|
42
- t.libs << "ext"
43
- t.test_files = FileList['test/test*.rb']
44
- t.verbose = true
43
+ task :compile => ["#{BASE_TAGFILE}/tagfile.so","#{BASE_TAGLIB}/TagLib.so"]
44
+
45
+ task :clean do |t|
46
+ FileUtils.rm_rf("pkg")
47
+ FileUtils.rm_rf("doc")
48
+ [BASE_TAGFILE, BASE_TAGLIB,"swig"].each{|dir|
49
+ system %(cd #{dir} && rake clean)
50
+ }
45
51
  end
46
52
 
47
53
  Rake::RDocTask.new(:rdoc) do |rdoc|
@@ -50,11 +56,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
50
56
  rdoc.rdoc_files=["README.txt", "ext/tagfile/tagfile.c", "lib/TagLib_doc.rb"]
51
57
  end
52
58
 
53
- require 'rubygems'
54
- require 'hoe'
55
- $LOAD_PATH << "./ext"
56
- require "./lib/TagLib.rb"
57
-
58
59
  task :svn => [:default] do |t|
59
60
  system %(cd #{File.dirname(__FILE__)})
60
61
  system %(svn commit)
@@ -62,10 +63,12 @@ task :svn => [:default] do |t|
62
63
  end
63
64
 
64
65
 
66
+ require 'TagLib'
67
+ Hoe.spec 'rtaglib' do |p|
65
68
 
66
- Hoe.new('rtaglib', TagLib::VERSION) do |p|
67
- p.developer('cdx', 'clbustos@surnet.cl')
68
- p.author="Claudio Bustos"
69
+ p.name="rtaglib"
70
+ p.version=TagLib::VERSION
71
+ p.developer('cdx', 'clbustos@gmail.com')
69
72
  p.summary="Bindings for taglib"
70
73
  p.description= <<-EOF
71
74
  Rtaglib is a binding for Taglib's library (http://developer.kde.org/~wheeler/taglib.html).
@@ -78,9 +81,9 @@ EOF
78
81
  p.url = "http://rtaglib.rubyforge.org/"
79
82
  p.test_globs=['test/test_*.rb']
80
83
  p.remote_rdoc_dir = '' # Release to root
81
- p.rdoc_pattern=/(lib\/TagLib_doc.rb|ext\/tagfile\/.*\.c|\.txt)/
84
+ #p.rdoc_pattern=/(lib\/TagLib_doc.rb|ext\/tagfile\/.*\.c|\.txt)/
82
85
  #p.clean_globs = ['ext/taglib/*.log','ext/taglib/*.o','ext/taglib/*.so', 'ext/tagfile/*.log','ext/tagfile/*.o','ext/tagfile/*.so']
83
86
  #p.platform = Gem::Platform::RUBY
84
- p.spec_extras= {'requirements'=>'libtag >=1.5', 'autorequire'=>'', 'extensions' => ['ext/tagfile/extconf.rb','ext/taglib/extconf.rb']}
87
+ p.spec_extras= {'requirements'=>'libtag >=1.5', 'extensions' => ["ext/Rakefile"]}
85
88
  end
86
89
  # vim: syntax=Ruby
File without changes
File without changes
File without changes
File without changes
File without changes
Binary file
Binary file
@@ -0,0 +1,10 @@
1
+ require 'rake'
2
+ task :default=>["tagfile/tagfile.so","taglib/TagLib.so"]
3
+
4
+ file "tagfile/tagfile.so" => ["tagfile/Rakefile.rb"] do |t|
5
+ system %(cd tagfile && rake)
6
+ end
7
+
8
+ file "taglib/TagLib.so" => ["taglib/Rakefile.rb"] do |t|
9
+ system %(cd taglib && rake)
10
+ end
@@ -0,0 +1,42 @@
1
+ require 'rake'
2
+ require 'fileutils'
3
+
4
+ c_file="tagfile.c"
5
+ ext_file="tagfile.so"
6
+
7
+
8
+ if PLATFORM=~/mswin32/
9
+ task :default => [:compile, :manifest]
10
+ else
11
+ task :default => [:compile]
12
+ end
13
+
14
+ task :compile => ["Makefile", c_file] do |t|
15
+ if PLATFORM=~/mswin32/
16
+ system %(nmake)
17
+ else
18
+ system %(make)
19
+ end
20
+ end
21
+
22
+ file "Makefile" => ["rake_ext_conf.rb"] do |t|
23
+ system %(ruby rake_ext_conf.rb)
24
+ end
25
+
26
+
27
+ task :manifest => [ext_file, "#{ext_file}.manifest"] do |t|
28
+ system %(mt.exe -manifest #{ext_file}.manifest -outputresource:#{ext_file};2)
29
+ end
30
+
31
+ task :clean do |t|
32
+ %w{so o log exp def}.each{|g|
33
+ Dir.glob("*.#{g}").each {|f|
34
+ FileUtils.rm(f)
35
+ }
36
+ }
37
+ if File.exists? "Makefile"
38
+ system %(make clean)
39
+ system %(nmake clean)
40
+ end
41
+ FileUtils.rm("Makefile") if File.exists? "Makefile"
42
+ end
@@ -0,0 +1,29 @@
1
+ require 'mkmf'
2
+ puts "Building for #{PLATFORM}"
3
+ if(PLATFORM=~/mswin32/)
4
+ package_dir=File.expand_path(File.dirname(__FILE__)+"/..")
5
+ prefix=package_dir+"/taglib/taglib-mswin32"
6
+ puts "Building for MsWin32"
7
+ $CFLAGS+= " -I\"#{prefix}\\include\" -I\"#{prefix}\\include\\taglib\""
8
+ $LDFLAGS += " -link -libpath:\"#{prefix}\\lib\" "
9
+
10
+ elsif(PLATFORM=~/mingw/)
11
+ puts "Building for MinGW"
12
+ $libs = append_library($libs, "stdc++")
13
+ $libs = append_library($libs, "supc++")
14
+ $CFLAGS= " -I/mingw/include/taglib"
15
+ else
16
+ taglib_config = find_executable("taglib-config")
17
+ if taglib_config
18
+ prefix = `#{taglib_config} --prefix`.strip
19
+ $CFLAGS += " -I#{prefix}/include"
20
+ $LDFLAGS += " -L#{prefix}/lib"
21
+ else
22
+ prefix = "/usr"
23
+ end
24
+ $libs = append_library($libs, "supc++")
25
+ $CFLAGS += " -I#{prefix}/include/taglib"
26
+ end
27
+ if have_library("tag_c")
28
+ create_makefile("tagfile")
29
+ end
@@ -2,15 +2,17 @@
2
2
  #include <taglib/tag_c.h>
3
3
  #define GET_TL_TAG(self,tag) \
4
4
  taglib_t *tl; \
5
+ TagLib_Tag *tag; \
5
6
  Data_Get_Struct(self, taglib_t, tl); \
6
7
  if(NULL==tl->file || tl->open==0) {tl_closed();} \
7
- TagLib_Tag *tag=tl->tag;
8
+ tag=tl->tag;
8
9
 
9
10
  #define GET_TL_CHECK(self,file) \
10
11
  taglib_t *tl; \
12
+ TagLib_File *file; \
11
13
  Data_Get_Struct(self, taglib_t, tl); \
12
14
  if(NULL==tl->file || tl->open==0) {tl_closed();} \
13
- TagLib_File *file=tl->file;
15
+ file=tl->file;
14
16
 
15
17
 
16
18
  typedef struct {
@@ -129,7 +131,9 @@ cTagFileFile_new(int argc, VALUE * argv, VALUE class)
129
131
  TagLib_File *tlf;
130
132
  VALUE path;
131
133
  VALUE file_type;
132
- char *cpath;
134
+ VALUE c_argv[2];
135
+ VALUE tdata;
136
+ char *cpath;
133
137
  rb_scan_args(argc, argv, "11", &path, &file_type);
134
138
  Check_Type(path, T_STRING);
135
139
  SafeStringValue(path);
@@ -155,8 +159,7 @@ cTagFileFile_new(int argc, VALUE * argv, VALUE class)
155
159
  if (NULL == tl->tag) {
156
160
  rb_raise(eBadAudioProperties, "Bad Audio");
157
161
  }
158
- VALUE c_argv[2];
159
- VALUE tdata =
162
+ tdata =
160
163
  Data_Wrap_Struct(class, 0, _tag_lib_file_free, tl);
161
164
  c_argv[0] = path;
162
165
  c_argv[1] = file_type;
@@ -199,14 +202,15 @@ VALUE
199
202
  _get_string(VALUE self, char *(*func) ())
200
203
  {
201
204
  VALUE string;
205
+ char *cstring;
202
206
  GET_TL_TAG(self, tag);
203
- char *cstring = func(tag);
207
+ cstring = func(tag);
204
208
  string = rb_str_new2(cstring);
205
209
  taglib_tag_free_strings();
206
210
  return string;
207
211
  }
208
212
 
209
- VALUE
213
+ VALUE
210
214
  _get_uint(VALUE self, unsigned int (*func) ())
211
215
  {
212
216
  GET_TL_TAG(self, tag);
@@ -0,0 +1,48 @@
1
+ require 'rake'
2
+ require 'fileutils'
3
+ c_source="taglib_#{PLATFORM}.source"
4
+ cpp_file="taglib_#{PLATFORM}.cxx"
5
+
6
+ if PLATFORM=~/mswin32/
7
+ task :default => [:compile, :manifest]
8
+ else
9
+ task :default => [:compile]
10
+ end
11
+
12
+ task :compile => ["Makefile", cpp_file] do |t|
13
+ if PLATFORM=~/mswin32/
14
+ system %(nmake)
15
+ else
16
+ system %(make)
17
+ end
18
+ end
19
+
20
+ file cpp_file => c_source do |t|
21
+ Dir.glob("*.cpp").each {|f|
22
+ FileUtils.rm(f)
23
+ }
24
+ FileUtils.cp(c_source, cpp_file)
25
+ end
26
+
27
+
28
+ file "Makefile" => ["rake_ext_conf.rb", cpp_file] do |t|
29
+ system %(ruby rake_ext_conf.rb)
30
+ end
31
+
32
+
33
+ task :manifest => ["TagLib.so", "TagLib.so.manifest"] do |t|
34
+ system %(mt.exe -manifest TagLib.so.manifest -outputresource:TagLib.so;2)
35
+ end
36
+
37
+ task :clean do |t|
38
+ %w{so o log exp def cxx}.each{|g|
39
+ Dir.glob("*.#{g}").each {|f|
40
+ FileUtils.rm(f)
41
+ }
42
+ }
43
+ if File.exists? "Makefile"
44
+ system %(make clean)
45
+ system %(nmake clean)
46
+ end
47
+ FileUtils.rm("Makefile") if File.exists? "Makefile"
48
+ end
@@ -0,0 +1,33 @@
1
+ require 'mkmf'
2
+ if(PLATFORM=~/mswin32/)
3
+ if(File.expand_path(File.dirname(__FILE__))=~/swig/)
4
+ package_dir=File.expand_path(File.dirname(__FILE__)+"/..")
5
+ prefix=package_dir+"/ext/taglib/taglib-mswin32"
6
+ else
7
+ prefix="./taglib-mswin32"
8
+ end
9
+ puts "Building for MsWin32"
10
+ $CFLAGS+= " -I\"#{prefix}\\include\" -I\"#{prefix}\\include\\taglib\""
11
+ $LDFLAGS += " -link -libpath:\"#{prefix}\\lib\" "
12
+
13
+ elsif(PLATFORM=~/mingw/)
14
+ puts "Building for MinGW"
15
+ $libs = append_library($libs, "stdc++")
16
+ $libs = append_library($libs, "supc++")
17
+ $CFLAGS= " -I/mingw/include/taglib"
18
+ else
19
+ puts "Building for other architecture"
20
+ taglib_config = find_executable("taglib-config")
21
+ if taglib_config
22
+ prefix = `#{taglib_config} --prefix`.strip
23
+ $CFLAGS += " -I#{prefix}/include"
24
+ $LDFLAGS += " -L#{prefix}/lib"
25
+ else
26
+ prefix = "/usr"
27
+ end
28
+ $libs = append_library($libs, "supc++")
29
+ $CFLAGS += " -I#{prefix}/include/taglib"
30
+ end
31
+ if have_library("tag")
32
+ create_makefile("TagLib")
33
+ end