forked from mirrors/nixpkgs
lidarr: 0.8.1.2135 -> 1.0.2.2592
This commit is contained in:
parent
a7a5b8d513
commit
aa5e70ecc7
|
@ -1,35 +1,52 @@
|
|||
{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, chromaprint, makeWrapper }:
|
||||
{ lib, stdenv, fetchurl, mono, libmediainfo, sqlite, curl, chromaprint, makeWrapper, icu, dotnet-runtime, openssl, nixosTests }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
let
|
||||
os = if stdenv.isDarwin then "osx" else "linux";
|
||||
arch = {
|
||||
x86_64-linux = "x64";
|
||||
aarch64-linux = "arm64";
|
||||
x86_64-darwin = "x64";
|
||||
}."${stdenv.hostPlatform.system}" or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
|
||||
hash = {
|
||||
x64-linux_hash = "sha256-iuI24gT7/RFZ9xc4csd+zWEzPSPsxqYY5F+78IWRjxQ=";
|
||||
arm64-linux_hash = "sha256-yHAoZxLeKF6mlR/Av0EH0Lh2XquM9Vx6huNDTEs4wyU=";
|
||||
x64-osx_hash = "sha256-ES6njZTSfd/36+RvibE1hlQlCT+hEEcOem8epBSsnXc=";
|
||||
}."${arch}-${os}_hash";
|
||||
in stdenv.mkDerivation rec {
|
||||
pname = "lidarr";
|
||||
version = "0.8.1.2135";
|
||||
version = "1.0.2.2592";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/lidarr/Lidarr/releases/download/v${version}/Lidarr.master.${version}.linux.tar.gz";
|
||||
sha256 = "sha256-eJX6t19D2slX68fXSMd/Vix3XSgCVylK+Wd8VH9jsuI=";
|
||||
url = "https://github.com/lidarr/Lidarr/releases/download/v${version}/Lidarr.master.${version}.${os}-core-${arch}.tar.gz";
|
||||
sha256 = hash;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cp -r * $out/bin/
|
||||
runHook preInstall
|
||||
|
||||
# Mark main executable as executable
|
||||
chmod +x $out/bin/Lidarr.exe
|
||||
|
||||
makeWrapper "${mono}/bin/mono" $out/bin/Lidarr \
|
||||
--add-flags "$out/bin/Lidarr.exe" \
|
||||
--prefix PATH : ${lib.makeBinPath [ chromaprint ]} \
|
||||
mkdir -p $out/{bin,share/${pname}-${version}}
|
||||
cp -r * $out/share/${pname}-${version}/.
|
||||
makeWrapper "${dotnet-runtime}/bin/dotnet" $out/bin/Lidarr \
|
||||
--add-flags "$out/share/${pname}-${version}/Lidarr.dll" \
|
||||
--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
|
||||
curl sqlite libmediainfo ]}
|
||||
curl sqlite libmediainfo icu openssl ]}
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
|
||||
passthru = {
|
||||
updateScript = ./update.sh;
|
||||
tests.smoke-test = nixosTests.lidarr;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A Usenet/BitTorrent music downloader";
|
||||
homepage = "https://lidarr.audio/";
|
||||
license = licenses.gpl3;
|
||||
maintainers = [ maintainers.etu ];
|
||||
platforms = platforms.all;
|
||||
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
|
||||
};
|
||||
}
|
||||
|
|
42
pkgs/servers/lidarr/update.sh
Executable file
42
pkgs/servers/lidarr/update.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env nix-shell
|
||||
#!nix-shell -i bash -p curl gnused nix-prefetch jq
|
||||
|
||||
set -e
|
||||
|
||||
dirname="$(dirname "$0")"
|
||||
|
||||
updateHash()
|
||||
{
|
||||
version=$1
|
||||
arch=$2
|
||||
os=$3
|
||||
|
||||
hashKey="${arch}-${os}_hash"
|
||||
|
||||
url="https://github.com/Lidarr/Lidarr/releases/download/v$version/Lidarr.master.$version.$os-core-$arch.tar.gz"
|
||||
hash=$(nix-prefetch-url --type sha256 $url)
|
||||
sriHash="$(nix hash to-sri --type sha256 $hash)"
|
||||
|
||||
sed -i "s|$hashKey = \"[a-zA-Z0-9\/+-=]*\";|$hashKey = \"$sriHash\";|g" "$dirname/default.nix"
|
||||
}
|
||||
|
||||
updateVersion()
|
||||
{
|
||||
sed -i "s/version = \"[0-9.]*\";/version = \"$1\";/g" "$dirname/default.nix"
|
||||
}
|
||||
|
||||
currentVersion=$(cd $dirname && nix eval --raw -f ../../.. radarr.version)
|
||||
|
||||
latestTag=$(curl https://api.github.com/repos/Lidarr/Lidarr/releases/latest | jq -r ".tag_name")
|
||||
latestVersion="$(expr $latestTag : 'v\(.*\)')"
|
||||
|
||||
if [[ "$currentVersion" == "$latestVersion" ]]; then
|
||||
echo "Lidarr is up-to-date: ${currentVersion}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
updateVersion $latestVersion
|
||||
|
||||
updateHash $latestVersion x64 linux
|
||||
updateHash $latestVersion arm64 linux
|
||||
updateHash $latestVersion x64 osx
|
Loading…
Reference in a new issue