nym: 0.11.0 -> 1.1.21

This commit is contained in:
happysalada 2023-06-19 07:14:56 -04:00 committed by Yt
parent bf2e7265e3
commit 605c86ad63
4 changed files with 5538 additions and 1403 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,43 +5,72 @@
, pkg-config
, openssl
, Security
, libiconv
, CoreServices
, nix-update-script
, rustc
}:
rustPlatform.buildRustPackage rec {
let
version = "1.1.21";
hash = "sha256-VM0Pc5qyrsn9wV3mfvrAlCfm/rIf3cednZzFtJCT+no=";
in
rustPlatform.buildRustPackage {
pname = "nym";
version = "0.11.0";
inherit version;
src = fetchFromGitHub {
owner = "nymtech";
repo = "nym";
rev = "v${version}";
sha256 = "sha256-bZXbteryXkOxft63zUMWdpBgbDSvrBHQY3f70/+mBtI=";
rev = "nym-binaries-v${version}";
inherit hash;
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"sphinx-0.1.0" = "sha256-/NW6jHZIi2Pe/m6o86FR0pLsSuRVuLYNTTPU7JEf/Us=";
"bls12_381-0.6.0" = "sha256-sIZy+CTASP+uiY10nP/N4WfCLjeqkjiNl/FzO0p5WdI=";
"cosmos-sdk-proto-0.12.3" = "sha256-ekQ9JA6WaTkvHkBKJbYPzfmx6I7LZnhIPiHsZFAP90w=";
"rocket_cors-0.5.2" = "sha256-hfk5gKtc94g+VZmm+S6HKvg+E71QVKQTK2E3K2MCvz0=";
"wasm-timer-0.2.5" = "sha256-od+r3ttFpFhcIh8rPQJQARaQLsbLeEZpCY1h9c4gow8=";
};
};
postPatch = ''
substituteInPlace contracts/vesting/build.rs \
--replace 'vergen(config).expect("failed to extract build metadata")' '()'
substituteInPlace common/bin-common/build.rs \
--replace 'vergen(config).expect("failed to extract build metadata")' '()'
'';
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv ];
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security CoreServices ];
checkType = "debug";
passthru.updateScript = ./update.sh;
passthru.updateScript = nix-update-script { };
checkFlags = [
"--skip commands::upgrade::upgrade_tests"
"--skip allowed_hosts::tests::creating_a_new_host_store"
"--skip allowed_hosts::tests::getting_the_domain_root"
"--skip allowed_hosts::tests::requests_to_allowed_hosts"
"--skip allowed_hosts::tests::requests_to_unknown_hosts"
"--skip=commands::upgrade::upgrade_tests"
"--skip=allowed_hosts::filter::tests::creating_a_new_host_store"
"--skip=allowed_hosts::filter::tests::getting_the_domain_root"
"--skip=allowed_hosts::filter::tests::requests_to_allowed_hosts"
"--skip=allowed_hosts::filter::tests::requests_to_unknown_hosts"
"--skip=ping::http::tests::resolve_host_with_valid_hostname_returns_some"
];
env = {
VERGEN_BUILD_TIMESTAMP = "0";
VERGEN_BUILD_SEMVER = version;
VERGEN_GIT_SHA = hash;
VERGEN_GIT_COMMIT_TIMESTAMP = "0";
VERGEN_GIT_BRANCH = "master";
VERGEN_RUSTC_SEMVER = rustc.version;
VERGEN_RUSTC_CHANNEL = "stable";
VERGEN_CARGO_PROFILE = "release";
};
meta = with lib; {
description = "A mixnet providing IP-level privacy";
longDescription = ''

View File

@ -1,37 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq nix-prefetch
# adapted from rust-analyzer
set -euo pipefail
cd "$(dirname "$0")"
nixpkgs=../../../..
owner=$(sed -nE 's/.*\bowner = "(.*)".*/\1/p' ./default.nix)
repo=$(sed -nE 's/.*\brepo = "(.*)".*/\1/p' ./default.nix)
rev=$(
curl -s "https://api.github.com/repos/$owner/$repo/releases" |
jq 'map(select(.prerelease | not)) | .[0].tag_name' --raw-output
)
version=${rev:1}
old_version=$(sed -nE 's/.*\bversion = "(.*)".*/\1/p' ./default.nix)
if grep -q 'cargoSha256 = ""' ./default.nix; then
old_version='broken'
fi
if [[ "$version" == "$old_version" ]]; then
echo "Up to date: $version"
exit
fi
echo "$old_version -> $version"
sha256=$(nix-prefetch -f "$nixpkgs" nym.src --rev "$rev")
# Clear cargoSha256 to avoid inconsistency.
sed -e "s/version = \".*\"/version = \"$version\"/" \
-e "s/sha256 = \".*\"/sha256 = \"$sha256\"/" \
-e "s/cargoSha256 = \".*\"/cargoSha256 = \"\"/" \
--in-place ./default.nix
echo "Prebuilding for cargoSha256"
cargo_sha256=$(nix-prefetch "{ sha256 }: (import $nixpkgs {}).nym.cargoDeps.overrideAttrs (_: { outputHash = sha256; })")
sed "s/cargoSha256 = \".*\"/cargoSha256 = \"$cargo_sha256\"/" \
--in-place ./default.nix

View File

@ -10782,7 +10782,7 @@ with pkgs;
nylon = callPackage ../tools/networking/nylon { };
nym = callPackage ../applications/networking/nym {
inherit (darwin.apple_sdk.frameworks) Security;
inherit (darwin.apple_sdk.frameworks) Security CoreServices;
};
nzbget = callPackage ../tools/networking/nzbget { };