File tree Expand file tree Collapse file tree 2 files changed +22
-9
lines changed
pkgs/by-name/ya/yazi-unwrapped Expand file tree Collapse file tree 2 files changed +22
-9
lines changed Original file line number Diff line number Diff line change 2626 hash = "sha256-kEVXejDg4ChFoMNBvKlwdFEyUuTcY2VuK9j0PdafKus=" ;
2727 } ;
2828in
29- rustPlatform . buildRustPackage rec {
29+ rustPlatform . buildRustPackage {
3030 pname = "yazi" ;
3131 inherit version ;
3232
3333 srcs = [
3434 code_src
3535 man_src
3636 ] ;
37+
3738 sourceRoot = code_src . name ;
3839
3940 useFetchCargoVendor = true ;
@@ -59,6 +60,7 @@ rustPlatform.buildRustPackage rec {
5960 '' ;
6061
6162 passthru . updateScript . command = [ ./update.sh ] ;
63+ passthru . srcs = { inherit code_src man_src ; } ; # for updating sources
6264
6365 meta = {
6466 description = "Blazing fast terminal file manager written in Rust, based on async I/O" ;
Original file line number Diff line number Diff line change 11#! /usr/bin/env nix-shell
2- #! nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts nix-prefetch
2+ #! nix-shell -i bash -p bash nix-update curl coreutils jq common-updater-scripts gawk
33
44set -eux
55
@@ -26,16 +26,27 @@ if [[ "$oldVersion" == "$latestVersion" ]]; then
2626 exit 0
2727fi
2828
29- echo " Updating Yazi "
29+ echo " Updating code sources "
3030
31- # Version
32- update-source-version yazi-unwrapped " ${latestVersion} "
31+ update-source-version yazi-unwrapped " ${latestVersion} " --source-key=passthru.srcs.code_src
3332
3433pushd " $SCRIPT_DIR "
35- # Build date
34+ echo " Updating build date"
35+
3636sed -i ' s#env.VERGEN_BUILD_DATE = "[^"]*"#env.VERGEN_BUILD_DATE = "' " ${latestBuildDate} " ' "#' package.nix
3737
38- # Hashes
39- cargoHash=$( nix-prefetch " { sha256 }: (import $NIXPKGS_DIR {}).yazi-unwrapped.cargoDeps.overrideAttrs (_: { outputHash = sha256; })" )
40- sed -i -E ' s#\bcargoHash = ".*?"#cargoHash = "' " $cargoHash " ' "#' package.nix
38+ echo " Updating cargoHash"
39+
40+ # Set cargoHash to an empty string
41+ sed -i -E ' s/cargoHash = ".*?"/cargoHash = ""/' package.nix
42+
43+ # Build and get new hash
44+ cargoHash=$( (nix-build " $NIXPKGS_DIR " -A yazi-unwrapped 2>&1 || true) | awk ' /got/{print $2}' )
45+
46+ if [ " $cargoHash " == " " ]; then
47+ echo " Failed to get cargoHash, please update it manually"
48+ exit 0
49+ fi
50+
51+ sed -i -E ' s/cargoHash = ".*?"/cargoHash = "' " $cargoHash " ' "/' package.nix
4152popd
You can’t perform that action at this time.
0 commit comments