Loading pkgs/by-name/du/duckstation-bin/package.nix 0 → 100644 +45 −0 Original line number Diff line number Diff line { lib, stdenvNoCC, fetchurl, unzip, }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "duckstation-bin"; version = "0.1-7294"; src = fetchurl { url = "https://github.com/stenzek/duckstation/releases/download/v${finalAttrs.version}/duckstation-mac-release.zip"; hash = "sha256-33aipZjYJOquQBbe8Ve9KRfLGW29v9xoztUsaY8LAjw="; }; nativeBuildInputs = [ unzip ]; dontPatch = true; dontConfigure = true; dontBuild = true; sourceRoot = "."; installPhase = '' runHook preInstall mkdir -p $out/Applications cp -r DuckStation.app $out/Applications/DuckStation.app runHook postInstall ''; passthru = { updateScript = ./update.sh; }; meta = { homepage = "https://github.com/stenzek/duckstation"; description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64"; changelog = "https://github.com/stenzek/duckstation/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ matteopacini ]; platforms = lib.platforms.darwin; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; }) pkgs/by-name/du/duckstation-bin/update.sh 0 → 100755 +20 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -i bash -p curl jq gnused set -euo pipefail cd "$(dirname "$0")" || exit 1 # Grab latest version, ignoring "latest" and "preview" tags LATEST_VER="$(curl --fail -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/stenzek/duckstation/releases" | jq -r '.[].tag_name' | grep '^v' | head -n 1 | sed 's/^v//')" CURRENT_VER="$(grep -oP 'version = "\K[^"]+' package.nix)" if [[ "$LATEST_VER" == "$CURRENT_VER" ]]; then echo "duckstation-bin is up-to-date" exit 0 fi HASH="$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "https://github.com/stenzek/duckstation/releases/download/v${LATEST_VER}/duckstation-mac-release.zip")")" sed -i "s#hash = \".*\"#hash = \"$HASH\"#g" package.nix sed -i "s#version = \".*\";#version = \"$LATEST_VER\";#g" package.nix Loading
pkgs/by-name/du/duckstation-bin/package.nix 0 → 100644 +45 −0 Original line number Diff line number Diff line { lib, stdenvNoCC, fetchurl, unzip, }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "duckstation-bin"; version = "0.1-7294"; src = fetchurl { url = "https://github.com/stenzek/duckstation/releases/download/v${finalAttrs.version}/duckstation-mac-release.zip"; hash = "sha256-33aipZjYJOquQBbe8Ve9KRfLGW29v9xoztUsaY8LAjw="; }; nativeBuildInputs = [ unzip ]; dontPatch = true; dontConfigure = true; dontBuild = true; sourceRoot = "."; installPhase = '' runHook preInstall mkdir -p $out/Applications cp -r DuckStation.app $out/Applications/DuckStation.app runHook postInstall ''; passthru = { updateScript = ./update.sh; }; meta = { homepage = "https://github.com/stenzek/duckstation"; description = "Fast PlayStation 1 emulator for x86-64/AArch32/AArch64"; changelog = "https://github.com/stenzek/duckstation/releases/tag/v${finalAttrs.version}"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ matteopacini ]; platforms = lib.platforms.darwin; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; })
pkgs/by-name/du/duckstation-bin/update.sh 0 → 100755 +20 −0 Original line number Diff line number Diff line #!/usr/bin/env nix-shell #!nix-shell -i bash -p curl jq gnused set -euo pipefail cd "$(dirname "$0")" || exit 1 # Grab latest version, ignoring "latest" and "preview" tags LATEST_VER="$(curl --fail -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/stenzek/duckstation/releases" | jq -r '.[].tag_name' | grep '^v' | head -n 1 | sed 's/^v//')" CURRENT_VER="$(grep -oP 'version = "\K[^"]+' package.nix)" if [[ "$LATEST_VER" == "$CURRENT_VER" ]]; then echo "duckstation-bin is up-to-date" exit 0 fi HASH="$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "https://github.com/stenzek/duckstation/releases/download/v${LATEST_VER}/duckstation-mac-release.zip")")" sed -i "s#hash = \".*\"#hash = \"$HASH\"#g" package.nix sed -i "s#version = \".*\";#version = \"$LATEST_VER\";#g" package.nix