Unverified Commit f37b3cdb authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

fladder: 0.9.0 -> 0.10.1; add desktop entries (#482229)

parents 58a890fb bf418ed8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -23866,6 +23866,12 @@
    githubId = 24507823;
    name = "Schahin Rouhanizadeh";
  };
  schembriaiden = {
    email = "aidsch@proton.me";
    github = "schembriaiden";
    githubId = 81376423;
    name = "Aiden Schembri";
  };
  schinmai-akamai = {
    email = "schinmai@akamai.com";
    github = "tchinmai7";
+45 −12
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@
  lib,
  fetchFromGitHub,
  flutter335,
  copyDesktopItems,
  makeDesktopItem,

  alsa-lib,
  libdisplay-info,
@@ -10,7 +12,7 @@
  libepoxy,
  mpv-unwrapped,

  targetFlutterPlatform ? "web",
  targetFlutterPlatform ? "linux",
  baseUrl ? null,
}:

@@ -22,13 +24,13 @@ in

flutter.buildFlutterApplication rec {
  pname = "fladder";
  version = "0.9.0";
  version = "0.10.1";

  src = fetchFromGitHub {
    owner = "DonutWare";
    repo = "Fladder";
    tag = "v${version}";
    hash = "sha256-IX3qbIgfi9d8rP24yIGlBzi5l28YQWnvLD+dD+7uIZc=";
    hash = "sha256-lmtEgBxCmEYcckhSAXhMPDzNQBluTyW0yjkt6Rr9byA=";
  };

  inherit targetFlutterPlatform;
@@ -46,6 +48,10 @@ flutter.buildFlutterApplication rec {
    media_kit_libs_windows_video = media_kit_hash;
  };

  nativeBuildInputs = lib.optionals (targetFlutterPlatform == "linux") [
    copyDesktopItems
  ];

  buildInputs = [
    alsa-lib
    libdisplay-info
@@ -57,21 +63,48 @@ flutter.buildFlutterApplication rec {
    libepoxy
  ];

  postInstall = lib.optionalString (targetFlutterPlatform == "web") (
  postInstall =
    lib.optionalString (targetFlutterPlatform == "web") (
      ''
        sed -i 's;base href="/";base href="$out";' $out/index.html
      ''
      + lib.optionalString (baseUrl != null) ''
        echo '{"baseUrl": "${baseUrl}"}' > $out/assets/config/config.json
      ''
  );
    )
    + lib.optionalString (targetFlutterPlatform == "linux") ''
      # Install SVG icon
      install -Dm644 icons/fladder_icon.svg \
        $out/share/icons/hicolor/scalable/apps/fladder.svg
    '';

  desktopItems = lib.optionals (targetFlutterPlatform == "linux") [
    (makeDesktopItem {
      name = "fladder";
      desktopName = "Fladder";
      genericName = "Jellyfin Client";
      exec = "Fladder";
      icon = "fladder";
      comment = "Simple Jellyfin Frontend built on top of Flutter";
      categories = [
        "AudioVideo"
        "Video"
        "Player"
      ];
    })
  ];

  passthru.updateScript = ./update.sh;

  meta = {
    description = "Simple Jellyfin Frontend built on top of Flutter";
    homepage = "https://github.com/DonutWare/Fladder";
    downloadPage = "https://github.com/DonutWare/Fladder/releases";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ ratcornu ];
    maintainers = with lib.maintainers; [
      ratcornu
      schembriaiden
    ];
    mainProgram = "Fladder";
  };
}
+262 −102

File changed.

Preview size limit exceeded, changes collapsed.

+34 −0
Original line number Diff line number Diff line
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p yq nix bash coreutils nix-update common-updater-scripts ripgrep flutter

set -eou pipefail

PACKAGE_DIR="$(realpath "$(dirname "$0")")"
cd "$PACKAGE_DIR"/..
while ! test -f flake.nix; do cd ..; done
NIXPKGS_DIR="$PWD"

latestVersion=$(
    list-git-tags --url=https://github.com/DonutWare/Fladder |
    rg '^v(.*)' -r '$1' |
    sort --version-sort |
    tail -n1
)

currentVersion=$(nix-instantiate --eval -E "with import ./. {}; fladder.version or (lib.getVersion fladder)" | tr -d '"')

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

nix-update --version=$latestVersion fladder

export HOME="$(mktemp -d)"
src="$(nix-build --no-link "$NIXPKGS_DIR" -A fladder.src)"
TMPDIR="$(mktemp -d)"
cp --recursive --no-preserve=mode "$src"/* $TMPDIR
cd "$TMPDIR"
flutter pub get
yq . pubspec.lock >"$PACKAGE_DIR"/pubspec.lock.json
rm -rf $TMPDIR