nixpkgs/pkgs/applications/video/bilibili/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

49 lines
1.1 KiB
Nix
Raw Normal View History

2023-04-05 13:13:50 +00:00
{ lib
, stdenv
, fetchurl
, electron
, makeWrapper
}:
stdenv.mkDerivation rec {
pname = "bilibili";
2023-06-06 02:11:43 +00:00
version = "1.10.1-4";
2023-04-05 13:13:50 +00:00
src = fetchurl {
url = "https://github.com/msojocs/bilibili-linux/releases/download/v${version}/io.github.msojocs.bilibili_${version}_amd64.deb";
2023-06-06 02:11:43 +00:00
hash = "sha256-/jvgCEqd0kSAs3U7eJQ7fFyHdGcyV/7nMnNgQpDVgm0=";
2023-04-05 13:13:50 +00:00
};
unpackPhase = ''
runHook preUnpack
ar x $src
tar xf data.tar.xz
runHook postUnpack
'';
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r usr/share $out/share
sed -i "s|Exec=.*|Exec=$out/bin/bilibili|" $out/share/applications/*.desktop
cp -r opt/apps/io.github.msojocs.bilibili/files/bin/app $out/opt
makeWrapper ${electron}/bin/electron $out/bin/bilibili \
--argv0 "bilibili" \
--add-flags "$out/opt/app.asar"
runHook postInstall
'';
meta = with lib; {
description = "Electron-based bilibili desktop client";
homepage = "https://github.com/msojocs/bilibili-linux";
license = licenses.mit;
maintainers = with maintainers; [ jedsek ];
platforms = platforms.unix;
};
}