nixpkgs/pkgs/by-name/mp/mpc123/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

61 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchFromGitLab
, gettext
, libao
, libmpcdec
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mpc123";
version = "0.2.4";
src = fetchFromGitLab {
domain = "salsa.debian.org";
owner = "debian";
repo = "mpc123";
rev = "upstream/${finalAttrs.version}";
hash = "sha256-+/yxb19CJzyjQmT3O21pEmPR5YudmyCxWwo+W3uOB9Q=";
};
strictDeps = true;
nativeBuildInputs = [
gettext
];
buildInputs = [
gettext
libao
libmpcdec
];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
];
# Workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: /build/cc566Cj9.o:(.bss+0x0): multiple definition of `mpc123_file_reader'; ao.o:(.bss+0x40): first defined here
env.NIX_CFLAGS_COMPILE = "-fcommon";
# XXX: Should install locales too (though there's only 1 available).
installPhase = ''
runHook preInstall
mkdir -p "$out/bin"
cp -v mpc123 "$out/bin"
runHook postInstall
'';
meta = {
description = "Musepack (.mpc) audio player";
homepage = "https://github.com/bucciarati/mpc123";
license = lib.licenses.gpl2Plus;
mainProgram = "mpc123";
maintainers = [ ];
platforms = lib.platforms.unix;
};
})