miru: darwin support, add maintainer

This commit is contained in:
Matteo Pacini 2024-06-21 01:06:20 +01:00
parent e0ba5d6aaf
commit 45cfa86fd3
3 changed files with 79 additions and 28 deletions

View File

@ -0,0 +1,33 @@
{
stdenvNoCC,
fetchurl,
unzip,
makeWrapper,
pname,
version,
meta,
}:
stdenvNoCC.mkDerivation rec {
inherit pname version meta;
src = fetchurl {
url = "https://github.com/ThaUnknown/miru/releases/download/v${version}/mac-Miru-${version}-mac.zip";
hash = "sha256-OakGB5Fz1Tlxa/Uu7xHlKoEF9VRfWFQ9CjsR0eCRyQw=";
};
sourceRoot = ".";
nativeBuildInputs = [
unzip
makeWrapper
];
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,Applications}
cp -r Miru.app $out/Applications/
makeWrapper $out/Applications/Miru.app/Contents/MacOS/Miru $out/bin/miru
runHook postInstall
'';
}

View File

@ -0,0 +1,31 @@
{
fetchurl,
appimageTools,
pname,
version,
meta,
}:
appimageTools.wrapType2 rec {
inherit pname version meta;
src = fetchurl {
url = "https://github.com/ThaUnknown/miru/releases/download/v${version}/linux-Miru-${version}.AppImage";
name = "${pname}-${version}.AppImage";
sha256 = "sha256-aPutbJthUhZtBYkYuUB5v88OdhOrcnqw4AhnepfO1B4=";
};
extraInstallCommands =
let
contents = appimageTools.extractType2 { inherit pname version src; };
in
''
mkdir -p "$out/share/applications"
mkdir -p "$out/share/lib/miru"
cp -r ${contents}/{locales,resources} "$out/share/lib/miru"
cp -r ${contents}/usr/* "$out"
cp "${contents}/${pname}.desktop" "$out/share/applications/"
substituteInPlace $out/share/applications/${pname}.desktop --replace 'Exec=AppRun' 'Exec=${pname}'
'';
}

View File

@ -1,39 +1,22 @@
{ lib
, fetchurl
, appimageTools
{
stdenv,
lib,
callPackage,
}:
appimageTools.wrapType2 rec {
let
pname = "miru";
version = "5.1.4";
src = fetchurl {
url = "https://github.com/ThaUnknown/miru/releases/download/v${version}/linux-Miru-${version}.AppImage";
name = "${pname}-${version}.AppImage";
sha256 = "sha256-aPutbJthUhZtBYkYuUB5v88OdhOrcnqw4AhnepfO1B4=";
};
extraInstallCommands =
let
contents = appimageTools.extractType2 { inherit pname version src; };
in
''
mkdir -p "$out/share/applications"
mkdir -p "$out/share/lib/miru"
cp -r ${contents}/{locales,resources} "$out/share/lib/miru"
cp -r ${contents}/usr/* "$out"
cp "${contents}/${pname}.desktop" "$out/share/applications/"
substituteInPlace $out/share/applications/${pname}.desktop --replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "Stream anime torrents, real-time with no waiting for downloads";
homepage = "https://miru.watch";
license = licenses.gpl3Plus;
maintainers = [ maintainers.d4ilyrun ];
maintainers = with maintainers; [
d4ilyrun
matteopacini
];
mainProgram = "miru";
platforms = [ "x86_64-linux" ];
platforms = [ "x86_64-linux" ] ++ platforms.darwin;
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
longDescription = ''
@ -49,4 +32,8 @@ appimageTools.wrapType2 rec {
instead of flat out closing MPV.
'';
};
}
in
if stdenv.isDarwin then
callPackage ./darwin.nix { inherit pname version meta; }
else
callPackage ./linux.nix { inherit pname version meta; }