about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2021-01-19 16:32:24 +0100
committerGitHub <noreply@github.com>2021-01-19 16:32:24 +0100
commitdbb780407345155529a9ad0169d73f73e8c71bbc (patch)
tree5443bab2f3f0871d39da8e6820f6c960fcf43f34 /pkgs/tools
parenta141de9f3a0d3c22f4dd6c8f1b8e7b90c245ea7a (diff)
parent956f1a8e711d1991c87202961e9e2ec568523877 (diff)
Merge pull request #109736 from ymarkus/rpi-imager
rpi-imager: init at 1.5
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/misc/rpi-imager/default.nix55
-rw-r--r--pkgs/tools/misc/rpi-imager/lsblkCheckFix.patch16
2 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/tools/misc/rpi-imager/default.nix b/pkgs/tools/misc/rpi-imager/default.nix
new file mode 100644
index 0000000000000..a18a8d6d38d0e
--- /dev/null
+++ b/pkgs/tools/misc/rpi-imager/default.nix
@@ -0,0 +1,55 @@
+{ mkDerivation,
+  stdenv,
+  lib,
+  fetchFromGitHub,
+  cmake,
+  curl,
+  libarchive,
+  util-linux,
+  qtbase,
+  qtdeclarative,
+  qtsvg,
+  qttools,
+  qtquickcontrols2,
+  qtgraphicaleffects
+}:
+
+mkDerivation rec {
+  pname = "rpi-imager";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0596c7rpkykmjr3gsz9yczqsj7fzq04kc97s0rqkygjnwiqh2rwz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    curl
+    libarchive
+    util-linux
+    qtbase
+    qtdeclarative
+    qtsvg
+    qttools
+    qtquickcontrols2
+    qtgraphicaleffects
+  ];
+
+  /* By default, the builder checks for JSON support in lsblk by running "lsblk --json",
+    but that throws an error, as /sys/dev doesn't exist in the sandbox.
+    This patch removes the check. */
+  patches = [ ./lsblkCheckFix.patch ];
+
+  meta = with lib; {
+    description = "Raspberry Pi Imaging Utility";
+    homepage = "https://www.raspberrypi.org/software/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ ymarkus ];
+    platforms = platforms.all;
+    # does not build on darwin
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/pkgs/tools/misc/rpi-imager/lsblkCheckFix.patch b/pkgs/tools/misc/rpi-imager/lsblkCheckFix.patch
new file mode 100644
index 0000000000000..98fd2a659dc8f
--- /dev/null
+++ b/pkgs/tools/misc/rpi-imager/lsblkCheckFix.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 3d7fc79..8ce72b9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -229,11 +229,6 @@ else()
+         if (NOT LSBLK)
+             message(FATAL_ERROR "Unable to locate lsblk (used for disk enumeration)")
+         endif()
+-
+-        execute_process(COMMAND "${LSBLK}" "--json" RESULT_VARIABLE ret)
+-        if (ret EQUAL "1")
+-            message(FATAL_ERROR "util-linux package too old. lsblk does not support --json (used for disk enumeration)")
+-        endif()
+     endif()
+ 
+     configure_file(