summary refs log tree commit diff
path: root/pkgs/by-name/uu/uuu/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/uu/uuu/package.nix')
-rwxr-xr-xpkgs/by-name/uu/uuu/package.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/by-name/uu/uuu/package.nix b/pkgs/by-name/uu/uuu/package.nix
new file mode 100755
index 00000000000..6441c53c5f8
--- /dev/null
+++ b/pkgs/by-name/uu/uuu/package.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, nix-update-script
+
+, cmake
+, installShellFiles
+, pkg-config
+
+, bzip2
+, libusb1
+, openssl
+, zlib
+, zstd
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "uuu";
+  version = "1.5.141";
+
+  src = fetchFromGitHub {
+    owner = "nxp-imx";
+    repo = "mfgtools";
+    rev = "uuu_${finalAttrs.version}";
+    hash = "sha256-N5L6k2oVXfnER7JRoX0JtzgEhb/vFMexu7hUKQhmcoE=";
+  };
+
+  passthru.updateScript = nix-update-script { };
+
+  nativeBuildInputs = [
+    cmake
+    installShellFiles
+    pkg-config
+  ];
+
+  buildInputs = [
+    bzip2
+    libusb1
+    openssl
+    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;
+  };
+})