mihomo-party: 1.4.5 -> 1.5.12 (#359912)

* mihomo-party: 1.4.5 -> 1.5.12

* mihomo-party: add update script
This commit is contained in:
Aleksana
2024-12-08 14:46:08 +08:00
committed by GitHub
2 changed files with 50 additions and 9 deletions
+27 -9
View File
@@ -15,15 +15,31 @@
libGL,
}:
let
pname = "mihomo-party";
version = "1.4.5";
src = fetchurl {
url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}/mihomo-party-linux-${version}-amd64.deb";
hash = "sha256-O332nt2kgpDGY84S78Tx2PGUw1Pyj80ab2ZE3woYm4Y=";
};
version = "1.5.12";
src =
let
inherit (stdenv.hostPlatform) system;
selectSystem = attrs: attrs.${system};
suffix = selectSystem {
x86_64-linux = "amd64";
aarch64-linux = "arm64";
};
hash = selectSystem {
x86_64-linux = "sha256-1vJ2FcJOcpNyfSm5HyLkexsULBBPlI0AW2jXuhK8khA=";
aarch64-linux = "sha256-P+zCO6HxcQJAGIVxOSRga+1Bqtn31mw2v+/EyEDpgF8=";
};
in
fetchurl {
url = "https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}/mihomo-party-linux-${version}-${suffix}.deb";
inherit hash;
};
in
stdenv.mkDerivation {
inherit pname version src;
inherit version src;
pname = "mihomo-party";
passthru.updateScript = ./update.sh;
nativeBuildInputs = [
dpkg
@@ -70,8 +86,10 @@ stdenv.mkDerivation {
description = "Another Mihomo GUI";
homepage = "https://github.com/mihomo-party-org/mihomo-party";
mainProgram = "mihomo-party";
platforms = with lib.platforms; linux ++ darwin;
broken = !(stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isx86_64);
platforms = [
"aarch64-linux"
"x86_64-linux"
];
license = lib.licenses.gpl3Plus;
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
maintainers = with lib.maintainers; [ aucub ];
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nixVersions.latest curl coreutils jq common-updater-scripts
latestTag=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/mihomo-party-org/mihomo-party/releases/latest | jq -r ".tag_name")
latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; mihomo-party.version" | tr -d '"')
echo "latest version: $latestVersion"
echo "current version: $currentVersion"
if [[ "$latestVersion" == "$currentVersion" ]]; then
echo "package is up-to-date"
exit 0
fi
for i in \
"x86_64-linux amd64" \
"aarch64-linux arm64"; do
set -- $i
prefetch=$(nix-prefetch-url "https://github.com/mihomo-party-org/mihomo-party/releases/download/v$latestVersion/mihomo-party-linux-$latestVersion-$2.deb")
hash=$(nix hash convert --hash-algo sha256 --to sri $prefetch)
update-source-version mihomo-party $latestVersion $hash --system=$1 --ignore-same-version
done