mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-11 18:32:23 +08:00
radicle-tui: use fetchFromRadicle
(cherry picked from commit 914c4f2346)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
lib,
|
||||
rustPlatform,
|
||||
fetchgit,
|
||||
fetchFromRadicle,
|
||||
stdenv,
|
||||
libiconv,
|
||||
zlib,
|
||||
@@ -13,9 +13,11 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
pname = "radicle-tui";
|
||||
version = "0.6.0";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://seed.radicle.xyz/z39mP9rQAaGmERfUMPULfPUi473tY.git";
|
||||
rev = "refs/namespaces/z6MkswQE8gwZw924amKatxnNCXA55BMupMmRg7LvJuim2C1V/refs/tags/${finalAttrs.version}";
|
||||
src = fetchFromRadicle {
|
||||
seed = "seed.radicle.xyz";
|
||||
repo = "z39mP9rQAaGmERfUMPULfPUi473tY";
|
||||
node = "z6MkswQE8gwZw924amKatxnNCXA55BMupMmRg7LvJuim2C1V";
|
||||
tag = finalAttrs.version;
|
||||
hash = "sha256-rz9l9GtycqZoROUI6Hn0Fv5Br0YCIrcHlEWLMP4hasQ=";
|
||||
leaveDotGit = true;
|
||||
postFetch = ''
|
||||
|
||||
@@ -6,13 +6,10 @@ set -euo pipefail
|
||||
dirname="$(dirname "${BASH_SOURCE[0]}")"
|
||||
|
||||
url=$(nix-instantiate --eval --raw -A radicle-tui.src.url)
|
||||
old_ref=$(nix-instantiate --eval --raw -A radicle-tui.src.rev)
|
||||
new_ref=$(git ls-remote "$url" 'refs/namespaces/*/refs/tags/*' | cut -f2 | tail -1)
|
||||
old_node=$(nix-instantiate --eval --raw -A radicle-tui.src.node)
|
||||
|
||||
[[ "$old_ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
|
||||
old_node="${BASH_REMATCH[1]}"
|
||||
|
||||
[[ "$new_ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
|
||||
ref=$(git ls-remote "$url" 'refs/namespaces/*/refs/tags/*' | cut -f2 | tail -1)
|
||||
[[ "$ref" =~ ^refs/namespaces/([^/]+)/refs/tags/([^/]+)$ ]]
|
||||
new_node="${BASH_REMATCH[1]}"
|
||||
version="${BASH_REMATCH[2]}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user