nixpkgs/pkgs/tools/networking/gmrender-resurrect/default.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

46 lines
1.6 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkgconfig, makeWrapper, gstreamer
, gst-plugins-base, gst-plugins-good, gst-plugins-bad, gst-plugins-ugly, gst-libav, libupnp }:
let
version = "0.0.8";
makePluginPath = plugins: builtins.concatStringsSep ":" (map (p: p + "/lib/gstreamer-1.0") plugins);
pluginPath = makePluginPath [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav ];
in
stdenv.mkDerivation {
pname = "gmrender-resurrect";
inherit version;
src = fetchFromGitHub {
owner = "hzeller";
repo = "gmrender-resurrect";
rev = "v${version}";
sha256 = "14i5jrry6qiap5l2x2jqj7arymllajl3wgnk29ccvr8d45zp4jn1";
};
patches = [
(fetchpatch {
url = "https://github.com/hzeller/gmrender-resurrect/commit/dc8c4d4dc234311b3099e7f1efadf5d9733c81e9.patch";
sha256 = "0fqi58viaq9jg5h5j1725qrach4c3wmfmh0q43q4r8az2pn7dszw";
name = "libupnp.patch";
})
];
buildInputs = [ gstreamer libupnp ];
nativeBuildInputs = [ autoreconfHook pkgconfig makeWrapper ];
postInstall = ''
for prog in "$out/bin/"*; do
wrapProgram "$prog" --suffix GST_PLUGIN_SYSTEM_PATH_1_0 : "${pluginPath}"
done
'';
meta = with lib; {
description = "Resource efficient UPnP/DLNA renderer, optimal for Raspberry Pi, CuBox or a general MediaServer";
homepage = "https://github.com/hzeller/gmrender-resurrect";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ koral ashkitten ];
};
}