nixpkgs/pkgs/applications/video/mpv/scripts/mpris.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

40 lines
1.2 KiB
Nix

{ lib, stdenv, fetchpatch, fetchFromGitHub, pkgconfig, glib, mpv-unwrapped }:
stdenv.mkDerivation rec {
pname = "mpv-mpris";
version = "0.5";
src = fetchFromGitHub {
owner = "hoyon";
repo = "mpv-mpris";
rev = version;
sha256 = "07p6li5z38pkfd40029ag2jqx917vyl3ng5p2i4v5a0af14slcnk";
};
patches = [
# Enables to "make SCRIPTS_DIR=... install" https://github.com/hoyon/mpv-mpris/pull/38
(fetchpatch {
url = "https://github.com/hoyon/mpv-mpris/commit/f1482350868bf20e4575f923943ec998469b255e.patch";
sha256 = "1lqy867wpmj6hv3zgi6g679a7x3dv5skpw24hwd05b28galnyd4l";
})
];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ glib mpv-unwrapped ];
installFlags = [ "SCRIPTS_DIR=$(out)/share/mpv/scripts" ];
# Otherwise, the shared object isn't `strip`ped. See:
# https://discourse.nixos.org/t/debug-why-a-derivation-has-a-reference-to-gcc/7009
stripDebugList = [ "share/mpv/scripts" ];
passthru.scriptName = "mpris.so";
meta = with lib; {
description = "MPRIS plugin for mpv";
homepage = "https://github.com/hoyon/mpv-mpris";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ jfrankenau ];
};
}