Skip to content

Commit dec1b5c

Browse files
authored
Revert "SDL2{,_classic}_mixer_2_0: drop" (#407070)
2 parents 3250ac9 + 7ea90cf commit dec1b5c

File tree

4 files changed

+71
-2
lines changed

4 files changed

+71
-2
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
SDL2_mixer_2_0,
3+
SDL2_classic_mixer,
4+
}:
5+
6+
SDL2_mixer_2_0.override {
7+
SDL2_mixer = SDL2_classic_mixer;
8+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- a/music_mpg123.c 2018-10-31 10:59:00.000000000 -0400
2+
+++ b/music_mpg123.c 2023-09-05 21:31:51.529191521 -0400
3+
@@ -48,7 +48,11 @@
4+
int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
5+
const char* (*mpg123_plain_strerror)(int errcode);
6+
void (*mpg123_rates)(const long **list, size_t *number);
7+
+#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
8+
+ int (*mpg123_read)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done );
9+
+#else
10+
int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done );
11+
+#endif
12+
int (*mpg123_replace_reader_handle)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) );
13+
off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence );
14+
const char* (*mpg123_strerror)(mpg123_handle *mh);
15+
@@ -95,7 +99,11 @@
16+
FUNCTION_LOADER(mpg123_open_handle, int (*)(mpg123_handle *mh, void *iohandle))
17+
FUNCTION_LOADER(mpg123_plain_strerror, const char* (*)(int errcode))
18+
FUNCTION_LOADER(mpg123_rates, void (*)(const long **list, size_t *number));
19+
+#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
20+
+ FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done ))
21+
+#else
22+
FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done ))
23+
+#endif
24+
FUNCTION_LOADER(mpg123_replace_reader_handle, int (*)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) ))
25+
FUNCTION_LOADER(mpg123_seek, off_t (*)( mpg123_handle *mh, off_t sampleoff, int whence ))
26+
FUNCTION_LOADER(mpg123_strerror, const char* (*)(mpg123_handle *mh))
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
SDL2_mixer,
3+
fetchFromGitHub,
4+
fetchpatch,
5+
timidity,
6+
}:
7+
8+
let
9+
attrset = {
10+
version = "2.0.4";
11+
12+
src = fetchFromGitHub {
13+
owner = "libsdl-org";
14+
repo = "SDL_mixer";
15+
rev = "release-${attrset.version}";
16+
hash = "sha256-vo9twUGeK2emDiGd9kSGuA/X8TxVmQrRFFm71zawWYM=";
17+
};
18+
19+
patches = [
20+
# These patches fix incompatible function pointer conversion errors with clang 16.
21+
(fetchpatch {
22+
url = "https://github.com/libsdl-org/SDL_mixer/commit/4119ec3fe838d38d2433f4432cd18926bda5d093.patch";
23+
stripLen = 2;
24+
hash = "sha256-Ug1EEZIRcV8+e1MeMsGHuTW7Zn6j4szqujP8IkIq2VM=";
25+
})
26+
# Based on https://github.com/libsdl-org/SDL_mixer/commit/64ab759111ddb1b033bcce64e1a04e0cba6e498f
27+
./SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch
28+
];
29+
30+
# fix default path to timidity.cfg so MIDI files could be played
31+
postPatch = ''
32+
substituteInPlace timidity/options.h \
33+
--replace "/usr/share/timidity" "${timidity}/share/timidity"
34+
'';
35+
};
36+
in
37+
SDL2_mixer.overrideAttrs (_: attrset)

pkgs/top-level/aliases.nix

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,8 +1655,6 @@ mapAliases {
16551655
SDL1 = throw "'SDL1' has been removed as development ended long ago with SDL 2.0 replacing it, use SDL_compat instead"; # Added 2025-03-27
16561656
SDL_gpu = throw "'SDL_gpu' has been removed due to lack of upstream maintenance and known users"; # Added 2025-03-15
16571657
SDL_image_2_0 = throw "'SDL_image_2_0' has been removed in favor of the latest version"; # Added 2025-04-20
1658-
SDL2_mixer_2_0 = throw "'SDL2_mixer_2_0' has been removed in favor of the latest version"; # Added 2025-04-27
1659-
SDL2_classic_mixer_2_0 = throw "'SDL2_classic_mixer_2_0' has been removed in favor of the latest version"; # Added 2025-04-27
16601658
s2n = throw "'s2n' has been renamed to/replaced by 's2n-tls'"; # Converted to throw 2024-10-17
16611659
sandboxfs = throw "'sandboxfs' has been removed due to being unmaintained, consider using linux namespaces for sandboxing instead"; # Added 2024-06-06
16621660
sane-backends-git = throw "'sane-backends-git' has been renamed to/replaced by 'sane-backends'"; # Converted to throw 2024-10-17

0 commit comments

Comments
 (0)