Unverified Commit 37ec5d11 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

Merge pull request #217611 from figsoda/netease

netease-music-tui: replace patch with Cargo.lock 
parents 81b990f9 73b03b8c
Loading
Loading
Loading
Loading
+2778 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −2784

File deleted.

Preview size limit exceeded, changes collapsed.

+7 −1
Original line number Diff line number Diff line
@@ -11,7 +11,13 @@ rustPlatform.buildRustPackage rec {
    sha256 = "sha256-+zRXihWg65DtyX3yD04CsW8aXIvNph36PW2veeg36lg=";
  };

  cargoPatches = [ ./cargo-lock.patch ];
  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  postPatch = ''
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ alsa-lib openssl ];
+7 −10
Original line number Diff line number Diff line
#!nix-shell
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p coreutils gnugrep git cargo

# This updates cargo-lock.patch for the netease-music-tui version listed in
# default.nix.

set -eu -o verbose
set -euo pipefail

here=$PWD
version=$(cat default.nix | grep '^  version = "' | cut -d '"' -f 2)
here=$(dirname "$0")
version=$(grep '^  version = "' "$here/default.nix" | cut -d '"' -f 2)
checkout=$(mktemp -d)
git clone -b "$version" --depth=1 https://github.com/betta-cyber/netease-music-tui "$checkout"
cd "$checkout"
git clone -b "v$version" --depth=1 https://github.com/betta-cyber/netease-music-tui "$checkout"

cargo generate-lockfile
git add -f Cargo.lock
git diff HEAD -- Cargo.lock > "$here"/cargo-lock.patch
cargo generate-lockfile --manifest-path "$checkout/Cargo.toml"
cp "$checkout/Cargo.lock" "$here"

cd "$here"
rm -rf "$checkout"