nixpkgs/pkgs/by-name/li/libusbsio/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

59 lines
1.5 KiB
Nix

{ lib
, stdenv
, fetchzip
, pkg-config
, fixDarwinDylibNames
, libusb1
, systemdMinimal
, darwin
}:
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/*
'';
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"BINDIR="
];
nativeBuildInputs = [
pkg-config
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
];
buildInputs = [
libusb1
] ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
AppKit
CoreFoundation
IOKit
]) ++ lib.optionals stdenv.hostPlatform.isLinux [
systemdMinimal # libudev
];
installPhase = ''
runHook preInstall
install -D bin/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 ];
};
}