mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 21:50:55 +00:00
4a7f99d55d
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
52 lines
1.1 KiB
Nix
52 lines
1.1 KiB
Nix
{ lib, stdenv
|
|
, fetchFromGitHub
|
|
, python3
|
|
, par2cmdline
|
|
, unzip
|
|
, unrar
|
|
, p7zip
|
|
, makeWrapper
|
|
}:
|
|
|
|
let
|
|
pythonEnv = python3.withPackages(ps: with ps; [
|
|
chardet
|
|
cheetah3
|
|
cherrypy
|
|
cryptography
|
|
configobj
|
|
feedparser
|
|
sabyenc3
|
|
]);
|
|
path = stdenv.lib.makeBinPath [ par2cmdline unrar unzip p7zip ];
|
|
in stdenv.mkDerivation rec {
|
|
version = "3.1.1";
|
|
pname = "sabnzbd";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = pname;
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "0m39r2il7d014kf2p6v28lw2hzshm6bhhdchqa8wzyvvmygqmwf2";
|
|
};
|
|
|
|
buildInputs = [ pythonEnv makeWrapper ];
|
|
|
|
installPhase = ''
|
|
mkdir -p $out
|
|
cp -R * $out/
|
|
mkdir $out/bin
|
|
echo "${pythonEnv}/bin/python $out/SABnzbd.py \$*" > $out/bin/sabnzbd
|
|
chmod +x $out/bin/sabnzbd
|
|
wrapProgram $out/bin/sabnzbd --set PATH ${path}
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Usenet NZB downloader, par2 repairer and auto extracting server";
|
|
homepage = "https://sabnzbd.org";
|
|
license = licenses.gpl2Plus;
|
|
platforms = platforms.linux;
|
|
maintainers = with stdenv.lib.maintainers; [ fridh ];
|
|
};
|
|
}
|