2023-08-23 13:03:17 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, wrapQtAppsHook
|
|
|
|
, cmake
|
2023-10-20 11:35:00 +00:00
|
|
|
, pkg-config
|
2023-08-23 13:03:17 +00:00
|
|
|
, util-linux
|
|
|
|
, curl
|
|
|
|
, libarchive
|
|
|
|
, qtbase
|
|
|
|
, qtdeclarative
|
|
|
|
, qtsvg
|
|
|
|
, qttools
|
|
|
|
, qtquickcontrols2
|
|
|
|
, qtgraphicaleffects
|
2023-10-20 11:35:00 +00:00
|
|
|
, xz
|
2023-10-20 11:42:01 +00:00
|
|
|
, testers
|
2023-08-23 13:04:18 +00:00
|
|
|
, nix-update-script
|
2023-08-23 18:24:23 +00:00
|
|
|
, 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
|
|
|
};
|
|
|
|
|
2023-08-23 13:03:17 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-10-20 11:35:00 +00:00
|
|
|
pkg-config
|
2023-08-23 13:03:17 +00:00
|
|
|
util-linux
|
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
2021-05-26 21:21:53 +00:00
|
|
|
|
2023-08-23 18:24:23 +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
|
2023-10-20 11:35:00 +00:00
|
|
|
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";
|
2023-08-23 13:03:17 +00:00
|
|
|
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";
|
2023-08-23 13:03:48 +00:00
|
|
|
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
|
|
|
})
|