From be1280ceea8d4b3cd699d7b65007c3aa0898a329 Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 15 Mar 2023 03:20:53 +0000 Subject: [PATCH] browserpass: support cross compilation by only conditionally running tests tests were previously run during the buildPhase via the default `make` target: this patch moves that testing into the check phase and sets `doCheck` appropriately. Co-authored by: Nick Cao --- pkgs/tools/security/browserpass/default.nix | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/browserpass/default.nix b/pkgs/tools/security/browserpass/default.nix index 31a0bd63db03..83f34e2f066f 100644 --- a/pkgs/tools/security/browserpass/default.nix +++ b/pkgs/tools/security/browserpass/default.nix @@ -1,4 +1,11 @@ -{ lib, buildGoModule, fetchFromGitHub, makeWrapper, gnupg }: +{ lib +, stdenv +, buildGoModule +, fetchFromGitHub +, gnupg +, makeWrapper +}: + buildGoModule rec { pname = "browserpass"; version = "3.1.0"; @@ -14,7 +21,7 @@ buildGoModule rec { vendorHash = "sha256-CjuH4ANP2bJDeA+o+1j+obbtk5/NVLet/OFS3Rms4r0="; - doCheck = false; + doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; postPatch = '' # Because this Makefile will be installed to be used by the user, patch @@ -32,9 +39,11 @@ buildGoModule rec { ''; buildPhase = '' - make + make browserpass ''; + checkTarget = "test"; + installPhase = '' make install