about summary refs log tree commit diff
path: root/pkgs/development/libraries/libusbsio
diff options
context:
space:
mode:
authorSimon Bruder <simon@sbruder.de>2022-07-26 12:41:11 +0200
committerSimon Bruder <simon@sbruder.de>2022-08-17 13:00:53 +0200
commit1a941b4b5f4940d3082d3042c3c5b3add8333369 (patch)
tree100bb7497acfa46611d60f320adcea7b13ff89c5 /pkgs/development/libraries/libusbsio
parentaf149e56ef63d127c9beeb76f5fa2a01d7bf9cbb (diff)
libusbsio: init at 2.1.11
Many thanks to David Runge (dvzrv), who made an effort to get this
available under a free license earlier this year:
https://github.com/NXPmicro/spsdk/issues/36
Diffstat (limited to 'pkgs/development/libraries/libusbsio')
-rw-r--r--pkgs/development/libraries/libusbsio/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/pkgs/development/libraries/libusbsio/default.nix b/pkgs/development/libraries/libusbsio/default.nix
new file mode 100644
index 0000000000000..1982311919ba6
--- /dev/null
+++ b/pkgs/development/libraries/libusbsio/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchzip, pkg-config, libusb1, systemdMinimal }:
+let
+  binDirPrefix = if stdenv.isDarwin then "osx_" else "linux_";
+in
+stdenv.mkDerivation rec {
+  pname = "libusbsio";
+  version = "2.1.11";
+
+  src = fetchzip {
+    url = "https://www.nxp.com/downloads/en/libraries/libusbsio-${version}-src.zip";
+    sha256 = "sha256-qgoeaGWTWdTk5XpJwoauckEQlqB9lp5x2+TN09vQttI=";
+  };
+
+  postPatch = ''
+    rm -r bin/*
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    libusb1
+    systemdMinimal # libudev
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    install -D bin/${binDirPrefix}${stdenv.hostPlatform.parsed.cpu.name}/libusbsio${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libusbsio${stdenv.hostPlatform.extensions.sharedLibrary}
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.nxp.com/design/software/development-software/library-for-windows-macos-and-ubuntu-linux:LIBUSBSIO";
+    description = "Library for communicating with devices connected via the USB bridge on LPC-Link2 and MCU-Link debug probes on supported NXP microcontroller evaluation boards";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ frogamic sbruder ];
+  };
+}