lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

libid3tag: apply fixes before build

Amongst other things, this stops things like mpd spinning up to full
memory when updating the database.

authored by

Mateusz Kowalczyk and committed by
Bjørn Forsman
8f5f9f6c c585786c

+96 -4
+89
pkgs/development/libraries/libid3tag/debian-patches.patch
··· 1 + diff --git a/compat.gperf b/compat.gperf 2 + index 4e24613..5635980 100644 3 + --- a/compat.gperf 4 + +++ b/compat.gperf 5 + @@ -236,6 +236,10 @@ int id3_compat_fixup(struct id3_tag *tag) 6 + 7 + encoding = id3_parse_uint(&data, 1); 8 + string = id3_parse_string(&data, end - data, encoding, 0); 9 + + if (!string) 10 + + { 11 + + continue; 12 + + } 13 + 14 + if (id3_ucs4_length(string) < 4) { 15 + free(string); 16 + diff --git a/genre.dat b/genre.dat 17 + index 17acab5..1f02779 100644 18 + --- a/genre.dat 19 + +++ b/genre.dat 20 + @@ -277,8 +277,8 @@ static id3_ucs4_t const genre_PUNK_ROCK[] = 21 + { 'P', 'u', 'n', 'k', ' ', 'R', 'o', 'c', 'k', 0 }; 22 + static id3_ucs4_t const genre_DRUM_SOLO[] = 23 + { 'D', 'r', 'u', 'm', ' ', 'S', 'o', 'l', 'o', 0 }; 24 + -static id3_ucs4_t const genre_A_CAPPELLA[] = 25 + - { 'A', ' ', 'C', 'a', 'p', 'p', 'e', 'l', 'l', 'a', 0 }; 26 + +static id3_ucs4_t const genre_A_CAPELLA[] = 27 + + { 'A', ' ', 'C', 'a', 'p', 'e', 'l', 'l', 'a', 0 }; 28 + static id3_ucs4_t const genre_EURO_HOUSE[] = 29 + { 'E', 'u', 'r', 'o', '-', 'H', 'o', 'u', 's', 'e', 0 }; 30 + static id3_ucs4_t const genre_DANCE_HALL[] = 31 + @@ -452,7 +452,7 @@ static id3_ucs4_t const *const genre_table[] = { 32 + genre_DUET, 33 + genre_PUNK_ROCK, 34 + genre_DRUM_SOLO, 35 + - genre_A_CAPPELLA, 36 + + genre_A_CAPELLA, 37 + genre_EURO_HOUSE, 38 + genre_DANCE_HALL, 39 + genre_GOA, 40 + diff --git a/genre.dat.in b/genre.dat.in 41 + index 872de40..e71e34b 100644 42 + --- a/genre.dat.in 43 + +++ b/genre.dat.in 44 + @@ -153,7 +153,7 @@ Freestyle 45 + Duet 46 + Punk Rock 47 + Drum Solo 48 + -A Cappella 49 + +A Capella 50 + Euro-House 51 + Dance Hall 52 + Goa 53 + diff --git a/parse.c b/parse.c 54 + index 86a3f21..947c249 100644 55 + --- a/parse.c 56 + +++ b/parse.c 57 + @@ -165,6 +165,9 @@ id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, id3_length_t length, 58 + case ID3_FIELD_TEXTENCODING_UTF_8: 59 + ucs4 = id3_utf8_deserialize(ptr, length); 60 + break; 61 + + default: 62 + + /* FIXME: Unknown encoding! Print warning? */ 63 + + return NULL; 64 + } 65 + 66 + if (ucs4 && !full) { 67 + diff --git a/utf16.c b/utf16.c 68 + index 70ee9d5..6e60a75 100644 69 + --- a/utf16.c 70 + +++ b/utf16.c 71 + @@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **ptr, id3_length_t length, 72 + 73 + free(utf16); 74 + 75 + + if (end == *ptr && length % 2 != 0) 76 + + { 77 + + /* We were called with a bogus length. It should always 78 + + * be an even number. We can deal with this in a few ways: 79 + + * - Always give an error. 80 + + * - Try and parse as much as we can and 81 + + * - return an error if we're called again when we 82 + + * already tried to parse everything we can. 83 + + * - tell that we parsed it, which is what we do here. 84 + + */ 85 + + (*ptr)++; 86 + + } 87 + + 88 + return ucs4; 89 + }
+7 -4
pkgs/development/libraries/libid3tag/default.nix
··· 1 - {stdenv, fetchurl, zlib}: 1 + {stdenv, fetchurl, zlib, gperf}: 2 2 3 3 stdenv.mkDerivation { 4 4 name = "libid3tag-0.15.1b"; ··· 7 7 sha256 = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151"; 8 8 }; 9 9 10 - propagatedBuildInputs = [zlib]; 10 + propagatedBuildInputs = [ zlib gperf ]; 11 + 12 + patches = [ ./debian-patches.patch ]; 11 13 12 - meta = { 14 + meta = with stdenv.lib; { 13 15 description = "ID3 tag manipulation library"; 14 16 homepage = http://mad.sourceforge.net/; 15 - license = "GPL"; 17 + license = licenses.gpl2; 18 + maintainers = [ maintainers.fuuzetsu ]; 16 19 }; 17 20 }