wine: replace sha256 fetcher arguments with hash

+23 -23
+20 -20
pkgs/applications/emulators/wine/sources.nix
··· 1 1 { pkgs ? import <nixpkgs> {} }: 2 2 ## we default to importing <nixpkgs> here, so that you can use 3 - ## a simple shell command to insert new sha256's into this file 3 + ## a simple shell command to insert new hashes into this file 4 4 ## e.g. with emacs C-u M-x shell-command 5 5 ## 6 6 ## nix-prefetch-url sources.nix -A {stable{,.mono,.gecko64,.gecko32}, unstable, staging, winetricks} 7 7 8 8 # here we wrap fetchurl and fetchFromGitHub, in order to be able to pass additional args around it 9 - let fetchurl = args@{url, sha256, ...}: 10 - pkgs.fetchurl { inherit url sha256; } // args; 11 - fetchFromGitHub = args@{owner, repo, rev, sha256, ...}: 12 - pkgs.fetchFromGitHub { inherit owner repo rev sha256; } // args; 13 - fetchFromGitLab = args@{domain, owner, repo, rev, sha256, ...}: 14 - pkgs.fetchFromGitLab { inherit domain owner repo rev sha256; } // args; 9 + let fetchurl = args@{url, hash, ...}: 10 + pkgs.fetchurl { inherit url hash; } // args; 11 + fetchFromGitHub = args@{owner, repo, rev, hash, ...}: 12 + pkgs.fetchFromGitHub { inherit owner repo rev hash; } // args; 13 + fetchFromGitLab = args@{domain, owner, repo, rev, hash, ...}: 14 + pkgs.fetchFromGitLab { inherit domain owner repo rev hash; } // args; 15 15 16 16 updateScriptPreamble = '' 17 17 set -eou pipefail ··· 26 26 stable = fetchurl rec { 27 27 version = "8.0"; 28 28 url = "https://dl.winehq.org/wine/source/8.0/wine-${version}.tar.xz"; 29 - sha256 = "sha256-AnLCCTj4chrkUQr6qLNgN0V91XZh5NZkIxB5uekceS4="; 29 + hash = "sha256-AnLCCTj4chrkUQr6qLNgN0V91XZh5NZkIxB5uekceS4="; 30 30 31 31 ## see http://wiki.winehq.org/Gecko 32 32 gecko32 = fetchurl rec { 33 33 version = "2.47.3"; 34 34 url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86.msi"; 35 - sha256 = "sha256-5bmwbTzjVWRqjS5y4ETjfh4MjRhGTrGYWtzRh6f0jgE="; 35 + hash = "sha256-5bmwbTzjVWRqjS5y4ETjfh4MjRhGTrGYWtzRh6f0jgE="; 36 36 }; 37 37 gecko64 = fetchurl rec { 38 38 version = "2.47.3"; 39 39 url = "https://dl.winehq.org/wine/wine-gecko/${version}/wine-gecko-${version}-x86_64.msi"; 40 - sha256 = "sha256-pT7pVDkrbR/j1oVF9uTiqXr7yNyLA6i0QzSVRc4TlnU="; 40 + hash = "sha256-pT7pVDkrbR/j1oVF9uTiqXr7yNyLA6i0QzSVRc4TlnU="; 41 41 }; 42 42 43 43 ## see http://wiki.winehq.org/Mono 44 44 mono = fetchurl rec { 45 45 version = "7.4.0"; 46 46 url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi"; 47 - sha256 = "sha256-ZBP/Mo679+x2icZI/rNUbYEC3thlB50fvwMxsUs6sOw="; 47 + hash = "sha256-ZBP/Mo679+x2icZI/rNUbYEC3thlB50fvwMxsUs6sOw="; 48 48 }; 49 49 50 50 patches = [ ··· 61 61 # Can't use autobump on stable because we don't want the path 62 62 # <source/7.0/wine-7.0.tar.xz> to become <source/7.0.1/wine-7.0.1.tar.xz>. 63 63 if [[ "$UPDATE_NIX_OLD_VERSION" != "$latest_stable" ]]; then 64 - set_version_and_sha256 stable "$latest_stable" "$(nix-prefetch-url "$wine_url_base/source/$major.0/wine-$latest_stable.tar.xz")" 64 + set_version_and_hash stable "$latest_stable" "$(nix-prefetch-url "$wine_url_base/source/$major.0/wine-$latest_stable.tar.xz")" 65 65 fi 66 66 67 67 autobump stable.gecko32 "$latest_gecko" ··· 72 72 }; 73 73 74 74 unstable = fetchurl rec { 75 - # NOTE: Don't forget to change the SHA256 for staging as well. 75 + # NOTE: Don't forget to change the hash for staging as well. 76 76 version = "8.0"; 77 77 url = "https://dl.winehq.org/wine/source/8.0/wine-${version}.tar.xz"; 78 - sha256 = "sha256-AnLCCTj4chrkUQr6qLNgN0V91XZh5NZkIxB5uekceS4="; 78 + hash = "sha256-AnLCCTj4chrkUQr6qLNgN0V91XZh5NZkIxB5uekceS4="; 79 79 inherit (stable) gecko32 gecko64 patches; 80 80 81 81 mono = fetchurl rec { 82 82 version = "7.4.0"; 83 83 url = "https://dl.winehq.org/wine/wine-mono/${version}/wine-mono-${version}-x86.msi"; 84 - sha256 = "sha256-ZBP/Mo679+x2icZI/rNUbYEC3thlB50fvwMxsUs6sOw="; 84 + hash = "sha256-ZBP/Mo679+x2icZI/rNUbYEC3thlB50fvwMxsUs6sOw="; 85 85 }; 86 86 87 87 updateScript = writeShellScript "update-wine-unstable" '' ··· 92 92 93 93 update_staging() { 94 94 staging_url=$(get_source_attr staging.url) 95 - set_source_attr staging sha256 "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\"" 95 + set_source_attr staging hash "\"$(to_sri "$(nix-prefetch-url --unpack "''${staging_url//$1/$2}")")\"" 96 96 } 97 97 98 98 autobump unstable "$latest_unstable" "" update_staging ··· 105 105 staging = fetchFromGitHub rec { 106 106 # https://github.com/wine-staging/wine-staging/releases 107 107 inherit (unstable) version; 108 - sha256 = "sha256-AZVDcwgnF8m+h/jyWSMCLOAWN34sqnhTu2HnJoNyCYc="; 108 + hash = "sha256-AZVDcwgnF8m+h/jyWSMCLOAWN34sqnhTu2HnJoNyCYc="; 109 109 owner = "wine-staging"; 110 110 repo = "wine-staging"; 111 111 rev = "v${version}"; ··· 116 116 wayland = fetchFromGitLab rec { 117 117 # https://gitlab.collabora.com/alf/wine/-/tree/wayland 118 118 version = "8.0"; 119 - sha256 = "sha256-whRnm21UyKZ4AQufNmctzivISVobnCeidmpYz65vlyk="; 119 + hash = "sha256-whRnm21UyKZ4AQufNmctzivISVobnCeidmpYz65vlyk="; 120 120 domain = "gitlab.collabora.com"; 121 121 owner = "alf"; 122 122 repo = "wine"; ··· 135 135 if [[ "$wayland_rev" != "$latest_wayland_rev" ]]; then 136 136 latest_wayland=$(curl -s 'https://gitlab.collabora.com/alf/wine/-/raw/wayland/VERSION' | cut -f3 -d' ') 137 137 wayland_url=$(get_source_attr wayland.url) 138 - set_version_and_sha256 wayland "$latest_wayland" "$(nix-prefetch-url --unpack "''${wayland_url/$wayland_rev/$latest_wayland_rev}")" 138 + set_version_and_hash wayland "$latest_wayland" "$(nix-prefetch-url --unpack "''${wayland_url/$wayland_rev/$latest_wayland_rev}")" 139 139 set_source_attr wayland rev "\"$latest_wayland_rev\"" 140 140 fi 141 141 ··· 146 146 winetricks = fetchFromGitHub rec { 147 147 # https://github.com/Winetricks/winetricks/releases 148 148 version = "20220411"; 149 - sha256 = "sha256-FjH10nZDYbqXI6/vKpZJKfv2maXSVkahNDf5UTU3eyU="; 149 + hash = "sha256-FjH10nZDYbqXI6/vKpZJKfv2maXSVkahNDf5UTU3eyU="; 150 150 owner = "Winetricks"; 151 151 repo = "winetricks"; 152 152 rev = version;
+3 -3
pkgs/applications/emulators/wine/update-lib.sh
··· 14 14 sed_exprs+=(-e "${line}s@[^ ].*\$@$name = $value;@") 15 15 } 16 16 17 - set_version_and_sha256() { 17 + set_version_and_hash() { 18 18 set_source_attr "$1" version "\"$2\"" 19 - set_source_attr "$1" sha256 "\"$(to_sri "$3")\"" 19 + set_source_attr "$1" hash "\"$(to_sri "$3")\"" 20 20 } 21 21 22 22 get_latest_wine_version() { ··· 39 39 version=$(get_source_attr "$attr.version") 40 40 if [[ "$version" != "$latest" ]]; then 41 41 url=$(get_source_attr "$attr.url") 42 - set_version_and_sha256 "$attr" "$latest" "$($fetcher "${url//$version/$latest}")" 42 + set_version_and_hash "$attr" "$latest" "$($fetcher "${url//$version/$latest}")" 43 43 [[ -z "$more" ]] || $more "$version" "$latest" 44 44 fi 45 45 }