2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2020-07-18 16:06:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, bzip2
|
2021-12-06 16:07:01 +00:00
|
|
|
, installShellFiles
|
2020-07-18 16:06:22 +00:00
|
|
|
, libusb1
|
|
|
|
, libzip
|
|
|
|
, openssl
|
2022-10-06 18:32:54 +00:00
|
|
|
, zstd
|
2020-07-18 16:06:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "nxpmicro-mfgtools";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.5.11";
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "NXPmicro";
|
|
|
|
repo = "mfgtools";
|
|
|
|
rev = "uuu_${version}";
|
2023-02-02 18:25:31 +00:00
|
|
|
hash = "sha256-RD0haw0C89uvTlLHtvlv1VwU4Jw2U19Caiq+BSfB4hU=";
|
2020-07-18 16:06:22 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config installShellFiles ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
2022-10-06 18:32:54 +00:00
|
|
|
buildInputs = [ bzip2 libusb1 libzip openssl zstd ];
|
2020-07-18 16:06:22 +00:00
|
|
|
|
|
|
|
preConfigure = "echo ${version} > .tarball-version";
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
# rules printed by the following invocation are static,
|
|
|
|
# they come from hardcoded configs in libuuu/config.cpp:48
|
|
|
|
$out/bin/uuu -udev > udev-rules 2>stderr.txt
|
|
|
|
rules_file="$(cat stderr.txt|grep '1: put above udev run into'|sed 's|^.*/||')"
|
|
|
|
install -D udev-rules "$out/lib/udev/rules.d/$rules_file"
|
2021-12-06 16:07:01 +00:00
|
|
|
installShellCompletion --cmd uuu \
|
|
|
|
--bash ../snap/local/bash-completion/universal-update-utility
|
2021-03-09 03:18:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-07-18 16:06:22 +00:00
|
|
|
description = "Freescale/NXP I.MX chip image deploy tools";
|
|
|
|
longDescription = ''
|
|
|
|
UUU (Universal Update Utility) is a command line tool, evolved out of
|
|
|
|
MFGTools (aka MFGTools v3).
|
|
|
|
|
|
|
|
One of the main purposes is to upload images to I.MX SoC's using at least
|
|
|
|
their boot ROM.
|
|
|
|
|
|
|
|
With time, the need for an update utility portable to Linux and Windows
|
|
|
|
increased. UUU has the same usage on both Windows and Linux. It means the same
|
|
|
|
script works on both OS.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/NXPmicro/mfgtools";
|
|
|
|
license = licenses.bsd3;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ bmilanov jraygauthier ];
|
2022-04-27 09:35:20 +00:00
|
|
|
mainProgram = "uuu";
|
2020-07-18 16:06:22 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|