1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 ncurses,
7 libvorbis,
8 SDL,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "mp3blaster";
13 version = "3.2.6";
14
15 src = fetchFromGitHub {
16 owner = "stragulus";
17 repo = "mp3blaster";
18 tag = "v${finalAttrs.version}";
19 hash = "sha256-Gke6OjcrDlF3CceSVyfu8SGd0004cef8RlZ76Aet/F8=";
20 };
21
22 patches = [
23 # Fix pending upstream inclusion for ncurses-6.3 support:
24 # https://github.com/stragulus/mp3blaster/pull/8
25 (fetchpatch {
26 name = "ncurses-6.3.patch";
27 url = "https://github.com/stragulus/mp3blaster/commit/62168cba5eaba6ffe56943552837cf033cfa96ed.patch";
28 hash = "sha256-4Xcg7/7nKc7iiBZe5otIXjZNjBW9cOs6p6jQQOcRFCE=";
29 })
30 ];
31
32 buildInputs = [
33 ncurses
34 libvorbis
35 ]
36 ++ lib.optional stdenv.hostPlatform.isDarwin SDL;
37
38 env.NIX_CFLAGS_COMPILE = toString (
39 [
40 "-Wno-narrowing"
41 ]
42 ++ lib.optionals stdenv.cc.isClang [
43 "-Wno-reserved-user-defined-literal"
44 "-Wno-register"
45 ]
46 );
47
48 meta = {
49 description = "Audio player for the text console";
50 homepage = "http://www.mp3blaster.org/";
51 license = lib.licenses.gpl2;
52 maintainers = with lib.maintainers; [ earldouglas ];
53 platforms = with lib.platforms; linux ++ darwin;
54 };
55})