stdenv: fix documentation for stripAllFlags and stripDebugFlags (#352127)
[NixPkgs.git] / pkgs / tools / archivers / gbl / default.nix
blob889c6b5ad1a7c5d4c00a713260c543154e1a0293
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   rustPlatform,
6   fetchpatch,
7   pkg-config,
8   openssl,
9   testers,
10   gbl,
11   Security,
14 rustPlatform.buildRustPackage rec {
15   pname = "gbl";
16   version = "0.3.1";
18   src = fetchFromGitHub {
19     owner = "dac-gmbh";
20     repo = pname;
21     rev = "v${version}";
22     sha256 = "sha256-Xzx14fvYWTZYM9Pnowf1M3D0PTPRLwsXHUj/PJskRWw=";
23   };
25   cargoPatches = [
26     # update ring to fix building on Mac M1
27     # https://github.com/dac-gmbh/gbl/pull/64
28     (fetchpatch {
29       url = "https://github.com/raboof/gbl/commit/17e154d66932af59abe8677309792606b7f64c7d.patch";
30       sha256 = "sha256-5Itoi86Q+9FzSTtnggODKPwwYPp5BpIVgR2vYMLHBts=";
31     })
32     # Upstream does not include Cargo.lock, even though this is recommended for applications.
33     (fetchpatch {
34       url = "https://github.com/raboof/gbl/commit/9423d36ee3168bca8db7a7cb65611dc7ddc2daf0.patch";
35       sha256 = "sha256-zwHXgUVkAYiQs/AT/pINnZoECoXzh+9astWMYENGTL8=";
36     })
37   ];
39   cargoHash = "sha256-CeGLSseKUe2XudRqZm5Y7o7ZLDtDBg/MFunOGqxFZGM=";
41   nativeBuildInputs = [ pkg-config ];
42   buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
44   passthru.tests.version = testers.testVersion { package = gbl; };
46   meta = with lib; {
47     description = "GBL Firmware file manipulation";
48     longDescription = ''
49       Utility to read, create and manipulate `.gbl` firmware update
50       files targeting the Silicon Labs Gecko Bootloader.
51     '';
52     homepage = "https://github.com/jonas-schievink/gbl";
53     license = licenses.mit;
54     maintainers = [ maintainers.raboof ];
55     mainProgram = "gbl";
56   };