btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / mp / mp3blaster / package.nix
blob02711ab4e1314c193a1f0582aa45824981783502
1 { lib, stdenv, fetchFromGitHub, fetchpatch, ncurses, libvorbis, SDL }:
3 stdenv.mkDerivation rec {
4   pname = "mp3blaster";
5   version = "3.2.6";
7   src = fetchFromGitHub {
8     owner = "stragulus";
9     repo = pname;
10     rev = "v${version}";
11     sha256 = "0pzwml3yhysn8vyffw9q9p9rs8gixqkmg4n715vm23ib6wxbliqs";
12   };
14   patches = [
15     # Fix pending upstream inclusion for ncurses-6.3 support:
16     #  https://github.com/stragulus/mp3blaster/pull/8
17     (fetchpatch {
18       name = "ncurses-6.3.patch";
19       url = "https://github.com/stragulus/mp3blaster/commit/62168cba5eaba6ffe56943552837cf033cfa96ed.patch";
20       sha256 = "088l27kl1l58lwxfnw5x2n64sdjy925ycphni3icwag7zvpj0xz1";
21     })
22   ];
24   buildInputs = [
25     ncurses
26     libvorbis
27   ] ++ lib.optional stdenv.hostPlatform.isDarwin SDL;
29   env.NIX_CFLAGS_COMPILE = toString ([
30     "-Wno-narrowing"
31   ] ++ lib.optionals stdenv.cc.isClang [
32     "-Wno-reserved-user-defined-literal"
33   ]);
35   meta = with lib; {
36     description = "Audio player for the text console";
37     homepage = "http://www.mp3blaster.org/";
38     license = licenses.gpl2;
39     maintainers = with maintainers; [ earldouglas ];
40     platforms = with platforms; linux ++ darwin;
41   };