From bfa50470122bb9c31ed1f73eb6f80b6c6bc44118 Mon Sep 17 00:00:00 2001 From: Tomas Susanka Date: Tue, 22 Oct 2019 10:54:18 +0200 Subject: [PATCH] tests/upgrade tests: patch emulators on NixOS --- tests/download_emulators.sh | 6 +++++- tests/emulators/.gitignore | 1 + tests/emulators/shell.nix | 10 ++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/emulators/shell.nix diff --git a/tests/download_emulators.sh b/tests/download_emulators.sh index 19af99d90..4d4311051 100755 --- a/tests/download_emulators.sh +++ b/tests/download_emulators.sh @@ -3,6 +3,10 @@ SITE="https://firmware.corp.sldev.cz/upgrade_tests/" cd "$(dirname "$0")" # download all emulators without index files, without directories and only if not present -wget --no-verbose --no-clobber --no-parent --cut-dirs=2 --no-host-directories --recursive --reject "index.html*" -P emulators/ $SITE +wget -e robots=off --no-verbose --no-clobber --no-parent --cut-dirs=2 --no-host-directories --recursive --reject "index.html*" -P emulators/ $SITE chmod u+x emulators/trezor-emu-* + +if [ -f /etc/NIXOS ]; then + cd emulators && nix-shell --run "autoPatchelf trezor-emu*" +fi diff --git a/tests/emulators/.gitignore b/tests/emulators/.gitignore index d6b7ef32c..30472374a 100644 --- a/tests/emulators/.gitignore +++ b/tests/emulators/.gitignore @@ -1,2 +1,3 @@ * +!shell.nix !.gitignore diff --git a/tests/emulators/shell.nix b/tests/emulators/shell.nix new file mode 100644 index 000000000..b63d15d15 --- /dev/null +++ b/tests/emulators/shell.nix @@ -0,0 +1,10 @@ +with import {}; + +stdenv.mkDerivation { + name = "trezor-patch-emulators"; + buildInputs = [ + autoPatchelfHook + SDL2 + SDL2_image + ]; +}