Unverified Commit c365c90e authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

hifile: 0.9.9.13 -> 0.9.9.15, add update script; maintainers/ymstnt: update name (#348540)

parents be3bfd19 99dba147
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -24175,7 +24175,7 @@
    githubId = 47071325;
  };
  ymstnt = {
    name = "YMSTNT";
    name = "ymstnt";
    github = "ymstnt";
    githubId = 21342713;
  };
+11 −4
Original line number Diff line number Diff line
{ lib, appimageTools, fetchurl }:
{
  lib,
  appimageTools,
  fetchurl,
}:

let
  version = "0.9.9.13";
  version = "0.9.9.15";
  pname = "hifile";

  src = fetchurl {
    url = "https://www.hifile.app/files/HiFile-${version}.AppImage";
    hash = "sha256-nZlPdl7D0UWtm8mFz4IDqmvGeBVc7mbeUpzyHrdDQtk=";
    hash = "sha256-Q0clcmBLWt8qDzHYjRRbwyZBSWW//yBTbRcnRjrSlzM=";
  };

  appimageContents = appimageTools.extractType2 {
    inherit pname version src;
  };

in appimageTools.wrapType2 rec {
in
appimageTools.wrapType2 rec {
  inherit pname version src;

  extraInstallCommands = ''
@@ -23,6 +28,8 @@ in appimageTools.wrapType2 rec {
      --replace-fail 'Exec=HiFile' 'Exec=${pname}'
  '';

  passthru.updateScript = ./update.sh;

  meta = with lib; {
    description = "Dual-pane graphical file manager for Windows, macOS and Linux";
    longDescription = ''
+22 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -I nixpkgs=./. -i bash -p curl common-updater-scripts

latestVersion=$(curl -s "https://www.hifile.app/otherdownloads" | grep -A 10 '<h1>All downloads</h1>' | grep -m 1 '<li>.*AppImage.*' | sed -n 's/.*HiFile-\([0-9.]*\)\.AppImage.*/\1/p')
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; hifile.version" | tr -d '"')

echo "latest  version: $latestVersion"
echo "current version: $currentVersion"

if [[ "$latestVersion" == "$currentVersion" ]]; then
    echo "package is up-to-date"
    exit 0
fi


prefetch=$(nix-prefetch-url "https://www.hifile.app/files/HiFile-$latestVersion.AppImage")
hash=$(nix-hash --type sha256 --to-sri "$prefetch")

update-source-version hifile 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system="x86_64-linux"
update-source-version hifile "$latestVersion" "$hash" --system="x86_64-linux"