mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 13:10:33 +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
47 lines
1.4 KiB
Nix
47 lines
1.4 KiB
Nix
{ stdenv, lib, fetchFromGitHub, pythonPackages, makeWrapper, ffmpeg_3 }:
|
|
|
|
pythonPackages.buildPythonApplication {
|
|
|
|
pname = "togglesg-download-git";
|
|
version = "2017-12-07";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "0x776b7364";
|
|
repo = "toggle.sg-download";
|
|
rev = "e64959f99ac48920249987a644eefceee923282f";
|
|
sha256 = "0j317wmyzpwfcixjkybbq2vkg52vij21bs40zg3n1bs61rgmzrn8";
|
|
};
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
doCheck = false;
|
|
dontBuild = true;
|
|
dontStrip = true;
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/{bin,share/doc/togglesg-download}
|
|
substitute $src/download_toggle_video2.py $out/bin/download_toggle_video2.py \
|
|
--replace "ffmpeg_download_cmd = 'ffmpeg" "ffmpeg_download_cmd = '${lib.getBin ffmpeg_3}/bin/ffmpeg"
|
|
chmod 0755 $out/bin/download_toggle_video2.py
|
|
|
|
cp LICENSE README.md $out/share/doc/togglesg-download
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/0x776b7364/toggle.sg-download";
|
|
description = "Command-line tool to download videos from toggle.sg written in Python";
|
|
longDescription = ''
|
|
toggle.sg requires SilverLight in order to view videos. This tool will
|
|
allow you to download the video files for viewing in your media player and
|
|
on your OS of choice.
|
|
'';
|
|
license = licenses.mit;
|
|
maintainers = with maintainers; [ peterhoeg ];
|
|
platforms = platforms.all;
|
|
};
|
|
}
|