Loading pkgs/by-name/pl/plezy/package.nix +114 −101 Original line number Diff line number Diff line { lib, stdenv, stdenvNoCC, flutter338, fetchFromGitHub, fetchurl, yq-go, pkg-config, libsecret, jsoncpp, Loading @@ -17,13 +18,22 @@ makeDesktopItem, copyDesktopItems, imagemagick, _experimental-update-script-combinators, nix-update-script, _7zz, makeBinaryWrapper, runCommand, dart, }: let pname = "plezy"; version = "1.30.0"; src = fetchFromGitHub { owner = "edde746"; repo = "plezy"; tag = version; hash = "sha256-9bB9L9f2s0i2xF4JIe4vlEpt/bmF1gf3gxcoHdCrYqc="; }; simdutf = fetchurl { url = "https://github.com/simdutf/simdutf/releases/download/v6.4.2/singleheader.zip"; hash = "sha256-n+TW9RVySlXI3oj+5EY+CJChq+ImfNoTxLXSRdWAOeY="; Loading @@ -34,18 +44,28 @@ let ln -s ${zlib.dev}/include $out/include ln -s ${zlib}/lib $out/lib ''; in flutter338.buildFlutterApplication rec { pname = "plezy"; version = "1.30.0"; src = fetchFromGitHub { owner = "edde746"; repo = "plezy"; tag = version; hash = "sha256-9bB9L9f2s0i2xF4JIe4vlEpt/bmF1gf3gxcoHdCrYqc="; meta = { description = "Modern cross-platform Plex client built with Flutter"; homepage = "https://github.com/edde746/plezy"; mainProgram = "plezy"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ mio miniharinn ]; platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ]; sourceProvenance = lib.optionals stdenv.hostPlatform.isDarwin ( with lib.sourceTypes; [ binaryNativeCode ] ); }; linux = flutter338.buildFlutterApplication rec { inherit pname version src; pubspecLock = lib.importJSON ./pubspec.lock.json; gitHashes = lib.importJSON ./git-hashes.json; Loading Loading @@ -85,7 +105,7 @@ flutter338.buildFlutterApplication rec { exec = "plezy"; icon = "plezy"; desktopName = "Plezy"; comment = "Modern cross-platform Plex client built with Flutter"; comment = meta.description; categories = [ "AudioVideo" "Video" Loading @@ -102,46 +122,39 @@ flutter338.buildFlutterApplication rec { done ''; passthru = { pubspecSource = runCommand "pubspec.lock.json" { inherit src; nativeBuildInputs = [ yq-go ]; } '' yq eval --output-format=json --prettyPrint $src/pubspec.lock > "$out" ''; updateScript = _experimental-update-script-combinators.sequence [ (nix-update-script { }) ( (_experimental-update-script-combinators.copyAttrOutputToFile "plezy.pubspecSource" ./pubspec.lock.json) // { supportedFeatures = [ ]; } ) { command = [ dart.fetchGitHashesScript "--input" ./pubspec.lock.json "--output" ./git-hashes.json ]; supportedFeatures = [ ]; } ]; passthru.updateScript = ./update.sh; inherit meta; }; meta = { description = "Modern cross-platform Plex client built with Flutter"; homepage = "https://github.com/edde746/plezy"; mainProgram = "plezy"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ mio miniharinn darwin = stdenvNoCC.mkDerivation { inherit pname version; passthru.updateScript = ./update.sh; src = fetchurl { url = "https://github.com/edde746/plezy/releases/download/${version}/plezy-macos.dmg"; hash = "sha256-a3LvwWZvLPD7yKKbC+oYXSgoHXUS+mOojzfDyW7/QOE="; }; nativeBuildInputs = [ _7zz makeBinaryWrapper ]; platforms = lib.platforms.linux; sourceRoot = "Plezy.app"; installPhase = '' runHook preInstall mkdir -p $out/Applications/Plezy.app cp -r . $out/Applications/Plezy.app makeBinaryWrapper $out/Applications/Plezy.app/Contents/MacOS/Plezy $out/bin/plezy runHook postInstall ''; inherit meta; }; } in if stdenv.hostPlatform.isDarwin then darwin else linux pkgs/by-name/pl/plezy/update.sh 0 → 100755 +34 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #! nix-shell -I nixpkgs=./. -i bash -p curl gnused jq nix nix-prefetch-git python3 yq-go set -eou pipefail ROOT="$(dirname "$(readlink -f "$0")")" latestVersion=$(curl --fail --silent https://api.github.com/repos/edde746/plezy/releases/latest | jq --raw-output .tag_name) currentVersion=$(nix-instantiate --eval -E "with import ./. {}; plezy.version" | tr -d '"') if [[ "$currentVersion" == "$latestVersion" ]]; then echo "plezy is up-to-date: $currentVersion" exit 0 fi echo "updating plezy: $currentVersion -> $latestVersion" sed -i "s/version = \".*\"/version = \"${latestVersion}\"/" "$ROOT/package.nix" GIT_SRC_URL="https://github.com/edde746/plezy/archive/refs/tags/${latestVersion}.tar.gz" GIT_SRC_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url --unpack "$GIT_SRC_URL")") sed -i "/fetchFromGitHub/,/hash/{s|hash = \".*\"|hash = \"${GIT_SRC_SHA}\"|}" "$ROOT/package.nix" DMG_URL="https://github.com/edde746/plezy/releases/download/${latestVersion}/plezy-macos.dmg" DMG_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url "$DMG_URL")") sed -i "/plezy-macos.dmg/,/hash/{s|hash = \".*\"|hash = \"${DMG_SHA}\"|}" "$ROOT/package.nix" curl --fail --silent "https://raw.githubusercontent.com/edde746/plezy/${latestVersion}/pubspec.lock" \ | yq eval --output-format=json --prettyPrint > "$ROOT/pubspec.lock.json" python3 "$(dirname "$(readlink -f "$0")")/../../../development/compilers/dart/fetch-git-hashes.py" \ --input "$ROOT/pubspec.lock.json" \ --output "$ROOT/git-hashes.json" Loading
pkgs/by-name/pl/plezy/package.nix +114 −101 Original line number Diff line number Diff line { lib, stdenv, stdenvNoCC, flutter338, fetchFromGitHub, fetchurl, yq-go, pkg-config, libsecret, jsoncpp, Loading @@ -17,13 +18,22 @@ makeDesktopItem, copyDesktopItems, imagemagick, _experimental-update-script-combinators, nix-update-script, _7zz, makeBinaryWrapper, runCommand, dart, }: let pname = "plezy"; version = "1.30.0"; src = fetchFromGitHub { owner = "edde746"; repo = "plezy"; tag = version; hash = "sha256-9bB9L9f2s0i2xF4JIe4vlEpt/bmF1gf3gxcoHdCrYqc="; }; simdutf = fetchurl { url = "https://github.com/simdutf/simdutf/releases/download/v6.4.2/singleheader.zip"; hash = "sha256-n+TW9RVySlXI3oj+5EY+CJChq+ImfNoTxLXSRdWAOeY="; Loading @@ -34,18 +44,28 @@ let ln -s ${zlib.dev}/include $out/include ln -s ${zlib}/lib $out/lib ''; in flutter338.buildFlutterApplication rec { pname = "plezy"; version = "1.30.0"; src = fetchFromGitHub { owner = "edde746"; repo = "plezy"; tag = version; hash = "sha256-9bB9L9f2s0i2xF4JIe4vlEpt/bmF1gf3gxcoHdCrYqc="; meta = { description = "Modern cross-platform Plex client built with Flutter"; homepage = "https://github.com/edde746/plezy"; mainProgram = "plezy"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ mio miniharinn ]; platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ]; sourceProvenance = lib.optionals stdenv.hostPlatform.isDarwin ( with lib.sourceTypes; [ binaryNativeCode ] ); }; linux = flutter338.buildFlutterApplication rec { inherit pname version src; pubspecLock = lib.importJSON ./pubspec.lock.json; gitHashes = lib.importJSON ./git-hashes.json; Loading Loading @@ -85,7 +105,7 @@ flutter338.buildFlutterApplication rec { exec = "plezy"; icon = "plezy"; desktopName = "Plezy"; comment = "Modern cross-platform Plex client built with Flutter"; comment = meta.description; categories = [ "AudioVideo" "Video" Loading @@ -102,46 +122,39 @@ flutter338.buildFlutterApplication rec { done ''; passthru = { pubspecSource = runCommand "pubspec.lock.json" { inherit src; nativeBuildInputs = [ yq-go ]; } '' yq eval --output-format=json --prettyPrint $src/pubspec.lock > "$out" ''; updateScript = _experimental-update-script-combinators.sequence [ (nix-update-script { }) ( (_experimental-update-script-combinators.copyAttrOutputToFile "plezy.pubspecSource" ./pubspec.lock.json) // { supportedFeatures = [ ]; } ) { command = [ dart.fetchGitHashesScript "--input" ./pubspec.lock.json "--output" ./git-hashes.json ]; supportedFeatures = [ ]; } ]; passthru.updateScript = ./update.sh; inherit meta; }; meta = { description = "Modern cross-platform Plex client built with Flutter"; homepage = "https://github.com/edde746/plezy"; mainProgram = "plezy"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ mio miniharinn darwin = stdenvNoCC.mkDerivation { inherit pname version; passthru.updateScript = ./update.sh; src = fetchurl { url = "https://github.com/edde746/plezy/releases/download/${version}/plezy-macos.dmg"; hash = "sha256-a3LvwWZvLPD7yKKbC+oYXSgoHXUS+mOojzfDyW7/QOE="; }; nativeBuildInputs = [ _7zz makeBinaryWrapper ]; platforms = lib.platforms.linux; sourceRoot = "Plezy.app"; installPhase = '' runHook preInstall mkdir -p $out/Applications/Plezy.app cp -r . $out/Applications/Plezy.app makeBinaryWrapper $out/Applications/Plezy.app/Contents/MacOS/Plezy $out/bin/plezy runHook postInstall ''; inherit meta; }; } in if stdenv.hostPlatform.isDarwin then darwin else linux
pkgs/by-name/pl/plezy/update.sh 0 → 100755 +34 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #! nix-shell -I nixpkgs=./. -i bash -p curl gnused jq nix nix-prefetch-git python3 yq-go set -eou pipefail ROOT="$(dirname "$(readlink -f "$0")")" latestVersion=$(curl --fail --silent https://api.github.com/repos/edde746/plezy/releases/latest | jq --raw-output .tag_name) currentVersion=$(nix-instantiate --eval -E "with import ./. {}; plezy.version" | tr -d '"') if [[ "$currentVersion" == "$latestVersion" ]]; then echo "plezy is up-to-date: $currentVersion" exit 0 fi echo "updating plezy: $currentVersion -> $latestVersion" sed -i "s/version = \".*\"/version = \"${latestVersion}\"/" "$ROOT/package.nix" GIT_SRC_URL="https://github.com/edde746/plezy/archive/refs/tags/${latestVersion}.tar.gz" GIT_SRC_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url --unpack "$GIT_SRC_URL")") sed -i "/fetchFromGitHub/,/hash/{s|hash = \".*\"|hash = \"${GIT_SRC_SHA}\"|}" "$ROOT/package.nix" DMG_URL="https://github.com/edde746/plezy/releases/download/${latestVersion}/plezy-macos.dmg" DMG_SHA=$(nix --extra-experimental-features nix-command hash to-sri --type sha256 "$(nix-prefetch-url "$DMG_URL")") sed -i "/plezy-macos.dmg/,/hash/{s|hash = \".*\"|hash = \"${DMG_SHA}\"|}" "$ROOT/package.nix" curl --fail --silent "https://raw.githubusercontent.com/edde746/plezy/${latestVersion}/pubspec.lock" \ | yq eval --output-format=json --prettyPrint > "$ROOT/pubspec.lock.json" python3 "$(dirname "$(readlink -f "$0")")/../../../development/compilers/dart/fetch-git-hashes.py" \ --input "$ROOT/pubspec.lock.json" \ --output "$ROOT/git-hashes.json"