From 4a40987ba5cfac078a364923289a53e2a8589902 Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Wed, 23 Feb 2022 15:53:05 +1000 Subject: [PATCH 1/2] vgmstream: r1050-3448-g77cc431b -> unstable-2022-02-21 * Enable Speex support * Disable the new FSB CELT support - It always attempts to download it, there's no option to use the system version. --- pkgs/applications/audio/vgmstream/default.nix | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/audio/vgmstream/default.nix b/pkgs/applications/audio/vgmstream/default.nix index a3518f23984b..221b5b3d4b8c 100644 --- a/pkgs/applications/audio/vgmstream/default.nix +++ b/pkgs/applications/audio/vgmstream/default.nix @@ -1,26 +1,33 @@ { stdenv, lib, fetchFromGitHub, cmake, pkg-config -, mpg123, ffmpeg, libvorbis, libao, jansson +, mpg123, ffmpeg, libvorbis, libao, jansson, speex }: +let + vgmstreamVersion = "r1702-5596-00bdb165b"; +in stdenv.mkDerivation rec { - pname = "vgmstream"; - version = "r1050-3448-g77cc431b"; + pname = "vgmstream"; + version = "unstable-2022-02-21"; src = fetchFromGitHub { - owner = "vgmstream"; - repo = "vgmstream"; - rev = version; - sha256 = "030q02c9li14by7vm00gn6v3m4dxxmfwiy9iyz3xsgzq1i7pqc1d"; + owner = "vgmstream"; + repo = "vgmstream"; + rev = "00bdb165ba6b55420bbd5b21f54c4f7a825d15a0"; + sha256 = "18g1yqlnf48hi2xn2z2wajnjljpdbfdqmcmi7y8hi1r964ypmfcr"; }; nativeBuildInputs = [ cmake pkg-config ]; - buildInputs = [ mpg123 ffmpeg libvorbis libao jansson ]; + buildInputs = [ mpg123 ffmpeg libvorbis libao jansson speex ]; - # There's no nice way to build the audacious plugin without a circular dependency - cmakeFlags = [ "-DBUILD_AUDACIOUS=OFF" ]; + cmakeFlags = [ + # There's no nice way to build the audacious plugin without a circular dependency + "-DBUILD_AUDACIOUS=OFF" + # It always tries to download it, no option to use the system one + "-DUSE_CELT=OFF" + ]; - preConfigure = '' - echo "#define VERSION \"${version}\"" > cli/version.h + postConfigure = '' + echo "#define VGMSTREAM_VERSION \"${vgmstreamVersion}\"" > ../version.h ''; meta = with lib; { From 6432e8c08a7b50e1a568d65482fd17b82a9fc57e Mon Sep 17 00:00:00 2001 From: Zane van Iperen Date: Wed, 23 Feb 2022 15:53:35 +1000 Subject: [PATCH 2/2] vgmstream: add update script --- pkgs/applications/audio/vgmstream/default.nix | 2 + pkgs/applications/audio/vgmstream/update.sh | 77 +++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100755 pkgs/applications/audio/vgmstream/update.sh diff --git a/pkgs/applications/audio/vgmstream/default.nix b/pkgs/applications/audio/vgmstream/default.nix index 221b5b3d4b8c..f696c5061864 100644 --- a/pkgs/applications/audio/vgmstream/default.nix +++ b/pkgs/applications/audio/vgmstream/default.nix @@ -15,6 +15,8 @@ stdenv.mkDerivation rec { sha256 = "18g1yqlnf48hi2xn2z2wajnjljpdbfdqmcmi7y8hi1r964ypmfcr"; }; + passthru.updateScript = ./update.sh; + nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ mpg123 ffmpeg libvorbis libao jansson speex ]; diff --git a/pkgs/applications/audio/vgmstream/update.sh b/pkgs/applications/audio/vgmstream/update.sh new file mode 100755 index 000000000000..5353480dd335 --- /dev/null +++ b/pkgs/applications/audio/vgmstream/update.sh @@ -0,0 +1,77 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash --pure --keep GITHUB_TOKEN -p gnused jq nix-prefetch-git curl cacert + +set -euo pipefail + +ROOT="$(dirname "$(readlink -f "$0")")" +if [[ ! "$(basename $ROOT)" == "vgmstream" || ! -f "$ROOT/default.nix" ]]; then + echo "ERROR: Not in the vgmstream folder" + exit 1 +fi + +if [[ ! -v GITHUB_TOKEN ]]; then + echo "ERROR: \$GITHUB_TOKEN not set" + exit 1 +fi + + +payload=$(jq -cn --rawfile query /dev/stdin '{"query": $query}' <