about summary refs log tree commit diff
path: root/pkgs/tools/archivers
diff options
context:
space:
mode:
authorArnout Engelen <arnout@bzzt.net>2022-01-14 12:23:24 +0100
committerArnout Engelen <arnout@bzzt.net>2022-04-25 10:35:30 +0200
commit48bf204a58938376d6f6e2136d89878b9afcda7d (patch)
treeed35d8fbf9afd344d95c26dda2e4732138f0472a /pkgs/tools/archivers
parentb2737d4980a17cc2b7d600d7d0b32fd7333aca88 (diff)
gbl: init at 0.3.1
Diffstat (limited to 'pkgs/tools/archivers')
-rw-r--r--pkgs/tools/archivers/gbl/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/tools/archivers/gbl/default.nix b/pkgs/tools/archivers/gbl/default.nix
new file mode 100644
index 0000000000000..4c057469f0370
--- /dev/null
+++ b/pkgs/tools/archivers/gbl/default.nix
@@ -0,0 +1,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 ];
+  };
+}