depot/third_party/nixpkgs/pkgs/by-name/uu/uuu/package.nix
Default email 5c370c0b2a Project import generated by Copybara.
GitOrigin-RevId: 33d1e753c82ffc557b4a585c77de43d4c922ebb5
2024-05-15 17:35:15 +02:00

68 lines
1.3 KiB
Nix
Executable file

{ lib
, stdenv
, fetchFromGitHub
, nix-update-script
, cmake
, installShellFiles
, pkg-config
, bzip2
, libusb1
, openssl
, tinyxml-2
, zlib
, zstd
}:
stdenv.mkDerivation (finalAttrs: {
pname = "uuu";
version = "1.5.181";
src = fetchFromGitHub {
owner = "nxp-imx";
repo = "mfgtools";
rev = "uuu_${finalAttrs.version}";
hash = "sha256-HMpirdXpcBFTkO7anGDIjsBJKjQ+kIN4kDhPlcqIDqY=";
};
passthru.updateScript = nix-update-script {
extraArgs = [ "--version-regex" "uuu_\([0-9.]+\)" ];
};
nativeBuildInputs = [
cmake
installShellFiles
pkg-config
];
buildInputs = [
bzip2
libusb1
openssl
tinyxml-2
zlib
zstd
];
postPatch = ''
# Avoid the need of calling Git during the build.
echo "uuu_${finalAttrs.version}" > .tarball-version
'';
postInstall = ''
installShellCompletion --bash --name uuu.bash ${./completion.bash}
mkdir -p $out/lib/udev/rules.d
cat <($out/bin/uuu -udev) > $out/lib/udev/rules.d/70-uuu.rules
'';
meta = with lib; {
description = "Freescale/NXP I.MX Chip image deploy tools";
homepage = "https://github.com/nxp-imx/mfgtools";
license = licenses.bsd3;
maintainers = with maintainers; [ otavio ];
mainProgram = "uuu";
platforms = platforms.all;
};
})