nixpkgs/pkgs/by-name/bi/bililiverecorder/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

53 lines
1.2 KiB
Nix

{ lib
, stdenv
, fetchzip
, makeWrapper
, dotnetCorePackages
}:
let
pname = "bililiverecorder";
dotnet = with dotnetCorePackages; combinePackages [
runtime_6_0
aspnetcore_6_0
];
version = "2.12.0";
hash = "sha256-2usiJTGA2FcJ9HBs3RDiARfC2yv/UqBgmT+z5F5Y7w0=";
in
stdenv.mkDerivation {
inherit pname version;
src = fetchzip {
url = "https://github.com/BililiveRecorder/BililiveRecorder/releases/download/v${version}/BililiveRecorder-CLI-any.zip";
stripRoot = false;
inherit hash;
};
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,share/${pname}-${version}}
cp -r * $out/share/${pname}-${version}/.
makeWrapper "${dotnet}/bin/dotnet" $out/bin/BililiveRecorder \
--add-flags "$out/share/${pname}-${version}/BililiveRecorder.Cli.dll"
runHook postInstall
'';
meta = with lib; {
description = "Convenient free open source bilibili live recording tool";
homepage = "https://rec.danmuji.org/";
changelog = "https://github.com/BililiveRecorder/BililiveRecorder/releases/tag/${version}";
mainProgram = "BililiveRecorder";
license = licenses.gpl3Only;
maintainers = with maintainers; [ zaldnoay ];
platforms = platforms.unix;
};
}