about summary refs log tree commit diff
path: root/pkgs/applications/misc
diff options
context:
space:
mode:
authorMartin Weinelt <mweinelt@users.noreply.github.com>2023-02-07 22:20:33 +0000
committerGitHub <noreply@github.com>2023-02-07 22:20:33 +0000
commit58656bb3a0889235b8f93be5f53b454d423fd5b3 (patch)
tree35f40313dbeee2d7c0967df80feb2ed00da2e622 /pkgs/applications/misc
parentad4a70b4b60537c71d13d1981a27e5415892e2c8 (diff)
parenta5b2cf49b93a4c5edb190fd216355dfde6d84280 (diff)
Merge pull request #215149 from fleaz/init_gcfflasher
gcfflasher: init at 4.0.3-beta
Diffstat (limited to 'pkgs/applications/misc')
-rw-r--r--pkgs/applications/misc/gcfflasher/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/pkgs/applications/misc/gcfflasher/default.nix b/pkgs/applications/misc/gcfflasher/default.nix
new file mode 100644
index 0000000000000..14bc6ad012e06
--- /dev/null
+++ b/pkgs/applications/misc/gcfflasher/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, libgpiod
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcfflasher";
+  version = "4.0.3-beta";
+
+  src = fetchFromGitHub {
+    owner = "dresden-elektronik";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-m+iDBfsHo+PLYd3K8JaKwhIXcnj+Q8w7gIgmHp+0plk=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+  ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'main_windows.c' 'main_posix.c'
+    '';
+
+  buildInputs = lib.optionals stdenv.isLinux [
+    libgpiod
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm0755 GCFFlasher $out/bin/GCFFlasher
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "CFFlasher is the tool to program the firmware of dresden elektronik's Zigbee products";
+    license = licenses.bsd3;
+    homepage = "https://github.com/dresden-elektronik/gcfflasher";
+    maintainers = with maintainers; [ fleaz ];
+  };
+}