about summary refs log tree commit diff
path: root/pkgs/tools/archivers/gbl/default.nix
blob: 4c057469f0370f164ed3fd254e1fcc6b0ec7bec0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ lib
, fetchFromGitHub
, rustPlatform
, fetchpatch
, pkg-config
, openssl
, testVersion
, gbl
}:

rustPlatform.buildRustPackage rec {
  pname = "gbl";
  version = "0.3.1";

  src = fetchFromGitHub {
    owner = "dac-gmbh";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-Xzx14fvYWTZYM9Pnowf1M3D0PTPRLwsXHUj/PJskRWw=";
  };

  cargoPatches = [
    # Upstream does not include Cargo.lock, even though this is recommended for applications.
    # This patch adds it. https://github.com/dac-gmbh/gbl/pull/62
    (fetchpatch {
      url = "https://github.com/raboof/gbl/commit/99078da334c6e1ffd8189c691bbc711281fae5cc.patch";
      sha256 = "sha256-sAKkn4//8P87ZJ6NTHm2NUJH1sAFFwfrybv2QtQ3nnM=";
    })
  ];

  cargoSha256 = "sha256-RUZ6wswRtV8chq3+bY9LTRf6IYMbZ9/GPl2X5UcF7d8=";

  nativeBuildInputs = [ pkg-config ];
  buildInputs = [ openssl ];

  passthru.tests.version =
    testVersion { package = gbl; };

  meta = with lib; {
    description = "GBL Firmware file manipulation";
    longDescription = ''
      Utility to read, create and manipulate `.gbl` firmware update
      files targeting the Silicon Labs Gecko Bootloader.
    '';
    homepage = "https://github.com/dac-gmbh/gbl";
    license = licenses.mit;
    maintainers = [ maintainers.raboof ];
  };
}