taglib-ruby 1.1.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.github/FUNDING.yml +1 -0
  3. data/CHANGELOG.md +22 -0
  4. data/README.md +16 -12
  5. data/docs/taglib/mpeg.rb +1 -9
  6. data/ext/extconf_common.rb +21 -12
  7. data/ext/taglib_aiff/taglib_aiff.i +5 -0
  8. data/ext/taglib_aiff/taglib_aiff_wrap.cxx +327 -111
  9. data/ext/taglib_base/includes.i +14 -14
  10. data/ext/taglib_base/taglib_base.i +37 -4
  11. data/ext/taglib_base/taglib_base_wrap.cxx +414 -422
  12. data/ext/taglib_flac/taglib_flac.i +8 -3
  13. data/ext/taglib_flac/taglib_flac_wrap.cxx +356 -406
  14. data/ext/taglib_flac_picture/taglib_flac_picture.i +4 -0
  15. data/ext/taglib_flac_picture/taglib_flac_picture_wrap.cxx +229 -122
  16. data/ext/taglib_id3v1/taglib_id3v1_wrap.cxx +196 -102
  17. data/ext/taglib_id3v2/taglib_id3v2.i +5 -0
  18. data/ext/taglib_id3v2/taglib_id3v2_wrap.cxx +727 -568
  19. data/ext/taglib_mp4/taglib_mp4.i +22 -18
  20. data/ext/taglib_mp4/taglib_mp4_wrap.cxx +2141 -1493
  21. data/ext/taglib_mpeg/taglib_mpeg.i +6 -0
  22. data/ext/taglib_mpeg/taglib_mpeg_wrap.cxx +546 -379
  23. data/ext/taglib_ogg/taglib_ogg.i +0 -2
  24. data/ext/taglib_ogg/taglib_ogg_wrap.cxx +162 -107
  25. data/ext/taglib_vorbis/taglib_vorbis.i +1 -0
  26. data/ext/taglib_vorbis/taglib_vorbis_wrap.cxx +141 -109
  27. data/ext/taglib_wav/taglib_wav.i +6 -2
  28. data/ext/taglib_wav/taglib_wav_wrap.cxx +290 -147
  29. data/lib/taglib/version.rb +3 -3
  30. data/taglib-ruby.gemspec +1 -0
  31. data/tasks/ext.rake +23 -39
  32. data/tasks/swig.rake +14 -4
  33. data/test/id3v2_write_test.rb +1 -1
  34. data/test/wav_examples_test.rb +1 -1
  35. data/test/wav_file_test.rb +1 -1
  36. data/test/wav_file_write_test.rb +6 -6
  37. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1289419ad11f81f79052e260fbb9e1debbf2cd956389797bb6b664356e287ec0
4
- data.tar.gz: '0582a88e09b6e96108a2e4a51a34e5c486f0552918780f38b1c4f05a448745d3'
3
+ metadata.gz: 659d2ce981f60aaee4cdc2ada2ace70d33d55f2f1414478f03a8088facaedb98
4
+ data.tar.gz: 4baf4450e6903749e1f5a9829d2f83e4fa3809ec24974950d006992a50c35c78
5
5
  SHA512:
6
- metadata.gz: 966e6e0fed73bb68ed20a6f4e9cab07b98f476220e5a294d77f679ea748ddb245e5221241845c7ad515337d1d3f673ebce6cb293cc97ca5e773a385e7e7110e3
7
- data.tar.gz: 35ac3a6342f59be0c6641b861a0c9c9f2b00a2914d12fa8bc4bc05b5ba3af5c2f0199d8b3eb67155146b142274597ab8456ed1df48a72b30bbf90a1ebe86caf5
6
+ metadata.gz: 3df1ff745ae3e67a269f69f20820372c25d91a5d51fe916ffc590014518dad82d8674a526df4763449543246bef6e23d4ba6766513d5214c96e68b3a14b89846
7
+ data.tar.gz: f114af2a78f0ea69335ceff09cc1152ca9050b8519ebc318b85a854734d063f531cdf6176c10e1c487533d7fef58819e0a35431940a4c75e836c2e76e1f3e1c0
@@ -0,0 +1 @@
1
+ github: robinst
data/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ All notable changes to this project will be documented in this file.
6
6
  The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
7
7
  and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
8
8
 
9
+ ## 2.0.0
10
+ ### Changed
11
+ - Regenerate SWIG wrapper code against TagLib 2.0.1. This breaks
12
+ compatibility with TagLib 1.x. You will get a compiler error if you
13
+ try to install taglib-ruby 2.x on a system that has TagLib 1.x.
14
+ Please use taglib-ruby 1.x if your system has TagLib 1.x, and
15
+ taglib-ruby 2.x if your system has TagLib 2.x.
16
+ - The optional `strip_others` argument to `TagLib::MPEG::File#save` no
17
+ longer takes a boolean value. It now uses the constants
18
+ `TagLib::File::StripOthers` and `TagLib::File::StripNone`.
19
+
20
+ ### Removed
21
+ - `TagLib::MPEG::File#tag` has been removed because it no longer
22
+ exists in TagLib 2.x. Please use `TagLib::MPEG::File#id3v2_tag` or
23
+ `TagLib::MPEG::File#id3v1_tag`.
24
+
25
+ ## 1.1.3 - 2022-12-29
26
+ ### Changed
27
+ - Fix warning `warning: undefining the allocator of T_DATA class
28
+ swig_runtime_data` on Ruby 3.2
29
+ - Upgraded to SWIG 4.1.1
30
+
9
31
  ## 1.1.2 - 2022-04-13
10
32
  ### Fixed
11
33
  - Fix UserTextIdentificationFrame's constructor so that overloaded
data/README.md CHANGED
@@ -30,9 +30,13 @@ installed with header files (and a C++ compiler of course):
30
30
  * Brew: `brew install taglib`
31
31
  * MacPorts: `sudo port install taglib`
32
32
 
33
- Then do:
33
+ Then install the latest taglib-ruby 1.x by running:
34
34
 
35
- gem install taglib-ruby
35
+ gem install taglib-ruby --version '< 2'
36
+
37
+ If you are using TagLib 2.0.1 or higher, you need to install taglib-ruby 2.x instead:
38
+
39
+ gem install taglib-ruby --version '>= 2'
36
40
 
37
41
  ### MacOS
38
42
 
@@ -40,16 +44,20 @@ Depending on your brew setup, TagLib might be installed in different locations,
40
44
  which makes it hard for taglib-ruby to find it. To get the library location, run:
41
45
 
42
46
  $ brew info taglib
43
- taglib: stable 1.12 (bottled), HEAD
47
+ taglib: stable 1.13 (bottled), HEAD
44
48
  Audio metadata library
45
49
  https://taglib.org/
46
- /usr/local/Cellar/taglib/1.12 (122 files, 1.5MB) *
50
+ /opt/homebrew/Cellar/taglib/1.13 (122 files, 1.6MB) *
47
51
  ...
48
52
 
49
53
  Note the line with the path at the end. Provide that using the `TAGLIB_DIR`
50
54
  environment variable when installing, like this:
51
55
 
52
- TAGLIB_DIR=/usr/local/Cellar/taglib/1.12 gem install taglib-ruby
56
+ TAGLIB_DIR=/opt/homebrew/Cellar/taglib/1.13 gem install taglib-ruby
57
+
58
+ If you're using bundler, like this:
59
+
60
+ TAGLIB_DIR=/opt/homebrew/Cellar/taglib/1.13 bundle install
53
61
 
54
62
  Another problem might be that `clang++` doesn't work with a specific version
55
63
  of TagLib. In that case, try compiling taglib-ruby's C++ extensions with a
@@ -116,18 +124,14 @@ Build a specific version of Taglib:
116
124
  The above command will automatically download Taglib 1.11.1, build it and
117
125
  install it in `tmp/x86_64-linux/taglib-1.11.1`.
118
126
 
119
- The `swig` and `compile` tasks can then be executed against that specific
127
+ The `swig`, `compile` and `test` tasks can then be executed against that specific
120
128
  version of Taglib by setting the `TAGLIB_DIR` environment variable to
121
129
  `$PWD/tmp/x86_64-linux/taglib-1.11.1` (it is assumed that taglib headers are
122
130
  located at `$TAGLIB_DIR/include` and taglib libraries at `$TAGLIB_DIR/lib`).
123
131
 
124
- The `test` task can then be run for that version of Taglib by adding
125
- `$PWD/tmp/x86_64-linux/taglib-1.11.1/lib` to the `LD_LIBRARY_PATH` environment
126
- variable.
127
-
128
132
  To do everything in one command:
129
133
 
130
- PLATFORM=x86_64-linux TAGLIB_VERSION=1.11.1 TAGLIB_DIR=$PWD/tmp/x86_64-linux/taglib-1.11.1 LD_LIBRARY_PATH=$PWD/tmp/x86_64-linux/taglib-1.11.1/lib rake vendor compile test
134
+ PLATFORM=x86_64-linux TAGLIB_VERSION=1.11.1 TAGLIB_DIR=$PWD/tmp/x86_64-linux/taglib-1.11.1 rake vendor compile test
131
135
 
132
136
  ### Workflow
133
137
 
@@ -151,7 +155,7 @@ To do everything in one command:
151
155
 
152
156
  ## License
153
157
 
154
- Copyright (c) 2010-2020 Robin Stocker and others, see Git history.
158
+ Copyright (c) 2010-2022 Robin Stocker and others, see Git history.
155
159
 
156
160
  `taglib-ruby` is distributed under the MIT License, see
157
161
  [LICENSE.txt](LICENSE.txt) for details.
data/docs/taglib/mpeg.rb CHANGED
@@ -32,14 +32,6 @@ module TagLib::MPEG
32
32
  def initialize(filename, read_properties=true)
33
33
  end
34
34
 
35
- # Returns a tag that contains attributes from both the ID3v2 and
36
- # ID3v1 tag, with ID3v2 attributes having precendence.
37
- #
38
- # @return [TagLib::Tag]
39
- # @return [nil] if not present
40
- def tag
41
- end
42
-
43
35
  # Returns the ID3v1 tag.
44
36
  #
45
37
  # @param create if a new tag should be created when none exists
@@ -88,7 +80,7 @@ module TagLib::MPEG
88
80
  # ArgumentError.
89
81
  #
90
82
  # @return [Boolean] whether saving was successful
91
- def save(tags=TagLib::MPEG::File::AllTags, strip_others=true)
83
+ def save(tags=TagLib::MPEG::File::AllTags, strip_others=TagLib::File::StripOthers)
92
84
  end
93
85
 
94
86
  # Strip the specified tags from the file. Note that this directly
@@ -1,15 +1,19 @@
1
1
  # frozen-string-literal: true
2
2
 
3
- # Default opt dirs to help mkmf find taglib
4
- opt_dirs = ['/usr/local', '/opt/local', '/sw']
5
-
6
- # Heroku vendor dir
7
- vendor = ENV.fetch('GEM_HOME', '')[/^[^ ]*\/vendor\//]
8
- opt_dirs << "#{vendor}taglib" if vendor
9
- opt_dirs_joined = opt_dirs.join(':')
10
-
11
- configure_args = "--with-opt-dir=#{opt_dirs_joined} "
12
- ENV['CONFIGURE_ARGS'] = configure_args + ENV.fetch('CONFIGURE_ARGS', '')
3
+ taglib_dir = ENV['TAGLIB_DIR']
4
+
5
+ unless taglib_dir
6
+ # Default opt dirs to help mkmf find taglib
7
+ opt_dirs = ['/usr/local', '/opt/local', '/sw']
8
+
9
+ # Heroku vendor dir
10
+ vendor = ENV.fetch('GEM_HOME', '')[/^[^ ]*\/vendor\//]
11
+ opt_dirs << "#{vendor}taglib" if vendor
12
+ opt_dirs_joined = opt_dirs.join(':')
13
+
14
+ configure_args = "--with-opt-dir=#{opt_dirs_joined} "
15
+ ENV['CONFIGURE_ARGS'] = configure_args + ENV.fetch('CONFIGURE_ARGS', '')
16
+ end
13
17
 
14
18
  require 'mkmf'
15
19
 
@@ -18,14 +22,14 @@ def error(msg)
18
22
  abort
19
23
  end
20
24
 
21
- if ENV.key?('TAGLIB_DIR') && !File.directory?(ENV['TAGLIB_DIR'])
25
+ if taglib_dir && !File.directory?(taglib_dir)
22
26
  error 'When defined, the TAGLIB_DIR environment variable must point to a valid directory.'
23
27
  end
24
28
 
25
29
  # If specified, use the TAGLIB_DIR environment variable as the prefix
26
30
  # for finding taglib headers and libs. See MakeMakefile#dir_config
27
31
  # for more details.
28
- dir_config('tag', (ENV['TAGLIB_DIR'] if ENV.key?('TAGLIB_DIR')))
32
+ dir_config('tag', taglib_dir)
29
33
 
30
34
  # When compiling statically, -lstdc++ would make the resulting .so to
31
35
  # have a dependency on an external libstdc++ instead of the static one.
@@ -46,5 +50,10 @@ end
46
50
 
47
51
  $CFLAGS << ' -DSWIG_TYPE_TABLE=taglib'
48
52
 
53
+ # TagLib 2.0 requires C++17. Some compilers default to an older standard
54
+ # so we add this '-std=' option to make sure the compiler accepts C++17
55
+ # code.
56
+ $CXXFLAGS << ' -std=c++17'
57
+
49
58
  # Allow users to override the Ruby runtime's preferred CXX
50
59
  RbConfig::MAKEFILE_CONFIG['CXX'] = ENV['TAGLIB_RUBY_CXX'] if ENV['TAGLIB_RUBY_CXX']
@@ -14,15 +14,20 @@
14
14
  %ignore TagLib::RIFF::AIFF::Properties::length;
15
15
  %ignore TagLib::RIFF::AIFF::Properties::sampleWidth;
16
16
 
17
+ %ignore TagLib::RIFF::File;
18
+ %include <taglib/rifffile.h>
19
+
17
20
  %include <taglib/aiffproperties.h>
18
21
 
19
22
  %freefunc TagLib::RIFF::AIFF::File "free_taglib_riff_aiff_file";
20
23
 
21
24
  // Ignore IOStream and all the constructors using it.
22
25
  %ignore IOStream;
26
+ %ignore TagLib::RIFF::AIFF::File::File(IOStream *, bool, Properties::ReadStyle, ID3v2::FrameFactory *);
23
27
  %ignore TagLib::RIFF::AIFF::File::File(IOStream *, bool, Properties::ReadStyle);
24
28
  %ignore TagLib::RIFF::AIFF::File::File(IOStream *, bool);
25
29
  %ignore TagLib::RIFF::AIFF::File::File(IOStream *);
30
+ %ignore TagLib::RIFF::AIFF::File::isSupported(IOStream *);
26
31
 
27
32
  // Ignore the unified property interface.
28
33
  %ignore TagLib::RIFF::AIFF::File::properties;