mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 00:12:56 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
51 lines
1.2 KiB
Nix
51 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, buildGoModule
|
|
, fetchFromGitHub
|
|
, fetchpatch
|
|
, trezor-udev-rules
|
|
, nixosTests
|
|
, AppKit
|
|
}:
|
|
|
|
buildGoModule rec {
|
|
pname = "trezord-go";
|
|
version = "2.0.33";
|
|
commit = "2680d5e";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "trezor";
|
|
repo = "trezord-go";
|
|
rev = "v${version}";
|
|
fetchSubmodules = true;
|
|
hash = "sha256-3I6NOzDMhzRyVSOURl7TjJ1Z0P0RcKrSs5rNaZ0Ho9M=";
|
|
};
|
|
|
|
vendorHash = "sha256-wXgAmZEXdM4FcMCQbAs+ydXshCAMu7nl/yVv/3sqaXE=";
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
url = "https://github.com/trezor/trezord-go/commit/616473d53a8ae49f1099e36ab05a2981a08fa606.patch";
|
|
hash = "sha256-yKTwgqWr4L6XEPV85A6D1wpRdpef8hkIbl4LrRmOyuo=";
|
|
})
|
|
];
|
|
|
|
propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ trezor-udev-rules ]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ AppKit ];
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X main.githash=${commit}"
|
|
];
|
|
|
|
passthru.tests = { inherit (nixosTests) trezord; };
|
|
|
|
meta = with lib; {
|
|
description = "Trezor Communication Daemon aka Trezor Bridge";
|
|
homepage = "https://trezor.io";
|
|
license = licenses.lgpl3Only;
|
|
maintainers = with maintainers; [ canndrew jb55 prusnak mmahut _1000101 ];
|
|
mainProgram = "trezord-go";
|
|
};
|
|
}
|