mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 05:50:00 +00:00
generated using https://git.kybe.xyz/2kybe3/nixpkgs-github-redirect continuation of: #539298
67 lines
1.7 KiB
Nix
67 lines
1.7 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
buildPackages,
|
|
docbook_xsl,
|
|
fetchFromGitHub,
|
|
glib,
|
|
gobject-introspection,
|
|
gtk-doc,
|
|
meson,
|
|
mesonEmulatorHook,
|
|
ninja,
|
|
pkg-config,
|
|
withDocs ? stdenv.hostPlatform.emulatorAvailable buildPackages,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "playerctl";
|
|
version = "2.4.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "altdesktop";
|
|
repo = "playerctl";
|
|
rev = "v${finalAttrs.version}";
|
|
sha256 = "sha256-OiGKUnsKX0ihDRceZoNkcZcEAnz17h2j2QUOSVcxQEY=";
|
|
};
|
|
|
|
# macOS's ld64 has no --version-script, so translate the data/playerctl.syms
|
|
# filter to an -exported_symbols_list to keep the same symbols exported on darwin
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
printf '%s\n' '_Playerctl*' '_PLAYERCTL*' '_playerctl_*' '_pctl_*' > data/playerctl.syms
|
|
substituteInPlace playerctl/meson.build \
|
|
--replace-fail '--version-script' '-exported_symbols_list'
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
docbook_xsl
|
|
gobject-introspection
|
|
gtk-doc
|
|
meson
|
|
ninja
|
|
pkg-config
|
|
]
|
|
++ lib.optionals (withDocs && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
mesonEmulatorHook
|
|
];
|
|
buildInputs = [ glib ];
|
|
|
|
mesonFlags = [
|
|
(lib.mesonBool "bash-completions" true)
|
|
(lib.mesonBool "zsh-completions" true)
|
|
(lib.mesonBool "gtk-doc" withDocs)
|
|
];
|
|
|
|
meta = {
|
|
description = "Command-line utility and library for controlling media players that implement MPRIS";
|
|
homepage = "https://github.com/altdesktop/playerctl";
|
|
license = lib.licenses.lgpl3;
|
|
platforms = lib.platforms.unix;
|
|
maintainers = with lib.maintainers; [
|
|
puffnfresh
|
|
anish
|
|
];
|
|
mainProgram = "playerctl";
|
|
};
|
|
})
|