nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 gettext,
6 libao,
7 libmpcdec,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "mpc123";
12 version = "0.2.4";
13
14 src = fetchFromGitLab {
15 domain = "salsa.debian.org";
16 owner = "debian";
17 repo = "mpc123";
18 rev = "upstream/${finalAttrs.version}";
19 hash = "sha256-+/yxb19CJzyjQmT3O21pEmPR5YudmyCxWwo+W3uOB9Q=";
20 };
21
22 strictDeps = true;
23
24 nativeBuildInputs = [
25 gettext
26 ];
27
28 buildInputs = [
29 gettext
30 libao
31 libmpcdec
32 ];
33
34 makeFlags = [
35 "CC=${stdenv.cc.targetPrefix}cc"
36 ];
37
38 # Workaround build failure on -fno-common toolchains like upstream
39 # gcc-10. Otherwise build fails as:
40 # ld: /build/cc566Cj9.o:(.bss+0x0): multiple definition of `mpc123_file_reader'; ao.o:(.bss+0x40): first defined here
41 env.NIX_CFLAGS_COMPILE = "-fcommon";
42
43 # XXX: Should install locales too (though there's only 1 available).
44 installPhase = ''
45 runHook preInstall
46
47 mkdir -p "$out/bin"
48 cp -v mpc123 "$out/bin"
49
50 runHook postInstall
51 '';
52
53 meta = {
54 description = "Musepack (.mpc) audio player";
55 homepage = "https://github.com/bucciarati/mpc123";
56 license = lib.licenses.gpl2Plus;
57 mainProgram = "mpc123";
58 maintainers = [ ];
59 platforms = lib.platforms.unix;
60 };
61})