polaris: 0.13.5 -> 0.14.0

I also swapped the updateScript, as the old one didn't touch the cargo hash.
This commit is contained in:
Peder Bergebakken Sundt 2022-11-27 00:08:06 +01:00 committed by Yt
parent 96d403ee24
commit 97588fcdb2
3 changed files with 2521 additions and 24 deletions

2497
pkgs/servers/polaris/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,18 +1,21 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, nix-update-script
, polaris-web
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "polaris";
version = "0.13.5";
version = "0.14.0";
src = fetchFromGitHub {
owner = "agersant";
repo = "polaris";
rev = version;
sha256 = "sp1KDTzKvcGtuqL37fFnVgcnkIsmj5ZQji72BeyiFQE=";
hash = "sha256-mLugPi3Xp46Lh48JQVeyOEGiovSF26gUt25MGBPFfkM=";
# The polaris version upstream in Cargo.lock is "0.0.0".
# We're unable to simply patch it in the patch phase due to
@ -26,11 +29,22 @@ rustPlatform.buildRustPackage rec {
'';
};
cargoSha256 = "sha256-0VHrlUoyYu+UTUQUioftBDlQJfLd/axz6bGJs+YXSmE=";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"id3-1.4.0" = "sha256-0j2iOd/GkMqLu18Eu8nttmqez0G6fu2m19gsHWMmLds=";
};
};
buildInputs = lib.optionals stdenv.isDarwin [
darwin.Security
];
# Compile-time environment variables for where to find assets needed at runtime
POLARIS_WEB_DIR = "${polaris-web}/share/polaris-web";
POLARIS_SWAGGER_DIR = "${placeholder "out"}/share/polaris-swagger";
env = {
POLARIS_WEB_DIR = "${polaris-web}/share/polaris-web";
POLARIS_SWAGGER_DIR = "${placeholder "out"}/share/polaris-swagger";
};
postInstall = ''
mkdir -p $out/share
@ -42,7 +56,11 @@ rustPlatform.buildRustPackage rec {
ulimit -n 4096
'';
passthru.updateScript = ./update.sh;
__darwinAllowLocalNetworking = true;
passthru.updateScript = nix-update-script {
attrPath = pname;
};
meta = with lib; {
description = "Self-host your music collection, and access it from any computer and mobile device";

View File

@ -1,18 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl jq nix coreutils
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"/../../..
# update github tag and hash
latestVersion="$(curl -s "https://api.github.com/repos/agersant/polaris/releases?per_page=1" | jq -r ".[0].tag_name")"
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; polaris.version or (lib.getVersion polaris)" | tr -d '"')
if [[ "$currentVersion" == "$latestVersion" ]]; then
echo "polaris is up-to-date: $currentVersion"
exit 0
fi
update-source-version polaris "$latestVersion"