nixpkgs/pkgs/tools/misc/rpi-imager/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

86 lines
1.9 KiB
Nix
Raw Normal View History

{ lib
, stdenv
, fetchFromGitHub
, wrapQtAppsHook
, cmake
, pkg-config
, util-linux
, curl
, libarchive
, qtbase
, qtdeclarative
, qtsvg
, qttools
, qtquickcontrols2
, qtgraphicaleffects
, xz
2023-10-20 11:42:01 +00:00
, testers
2023-08-23 13:04:18 +00:00
, nix-update-script
, enableTelemetry ? false
2021-01-18 11:00:17 +00:00
}:
2023-10-20 11:42:01 +00:00
stdenv.mkDerivation (finalAttrs: {
2021-01-18 11:00:17 +00:00
pname = "rpi-imager";
2023-12-23 05:50:24 +00:00
version = "1.8.4";
2021-01-18 11:00:17 +00:00
src = fetchFromGitHub {
owner = "raspberrypi";
2023-10-20 11:42:01 +00:00
repo = finalAttrs.pname;
rev = "refs/tags/v${finalAttrs.version}";
2023-12-23 05:50:24 +00:00
sha256 = "sha256-ZuS/fhPpVlLSdaD+t+qIw6fdEbi7c82X+BxcgWlPntg=";
2021-01-18 11:00:17 +00:00
};
nativeBuildInputs = [
cmake
pkg-config
util-linux
wrapQtAppsHook
];
2021-05-26 21:21:53 +00:00
# Disable telemetry and update check.
cmakeFlags = lib.optionals (!enableTelemetry) [
"-DENABLE_CHECK_VERSION=OFF"
"-DENABLE_TELEMETRY=OFF"
];
2021-01-18 11:00:17 +00:00
buildInputs = [
curl
libarchive
qtbase
qtdeclarative
qtsvg
qttools
qtquickcontrols2
qtgraphicaleffects
xz
2021-01-18 11:00:17 +00:00
];
2023-10-20 11:42:01 +00:00
sourceRoot = "${finalAttrs.src.name}/src";
2022-03-30 15:26:31 +00:00
2021-01-18 11:00:17 +00:00
/* 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 ];
2023-08-23 13:04:18 +00:00
passthru = {
2023-10-20 11:42:01 +00:00
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "QT_QPA_PLATFORM=offscreen rpi-imager --version";
};
2023-08-23 13:04:18 +00:00
updateScript = nix-update-script { };
};
2021-01-18 11:00:17 +00:00
meta = with lib; {
description = "Raspberry Pi Imaging Utility";
homepage = "https://www.raspberrypi.com/software/";
2023-10-20 11:42:01 +00:00
changelog = "https://github.com/raspberrypi/rpi-imager/releases/tag/v${finalAttrs.version}";
2021-05-26 21:21:53 +00:00
downloadPage = "https://github.com/raspberrypi/rpi-imager/";
2021-01-18 11:00:17 +00:00
license = licenses.asl20;
2023-10-20 11:42:11 +00:00
mainProgram = "rpi-imager";
maintainers = with maintainers; [ ymarkus anthonyroussel ];
2021-01-18 11:00:17 +00:00
platforms = platforms.all;
# does not build on darwin
broken = stdenv.isDarwin;
};
2023-10-20 11:42:01 +00:00
})