2022-01-14 11:23:24 +00:00
|
|
|
{ lib
|
2022-05-09 11:28:02 +00:00
|
|
|
, stdenv
|
2022-01-14 11:23:24 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
|
|
|
, fetchpatch
|
|
|
|
, pkg-config
|
|
|
|
, openssl
|
2022-04-26 08:05:27 +00:00
|
|
|
, testers
|
2022-01-14 11:23:24 +00:00
|
|
|
, gbl
|
2022-05-09 11:28:02 +00:00
|
|
|
, Security
|
2022-01-14 11:23:24 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
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 ];
|
2022-05-09 11:28:02 +00:00
|
|
|
buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
|
2022-01-14 11:23:24 +00:00
|
|
|
|
|
|
|
passthru.tests.version =
|
2022-04-26 08:05:27 +00:00
|
|
|
testers.testVersion { package = gbl; };
|
2022-01-14 11:23:24 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|