usbutils: add darwin support
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
stdenv,
|
||||
fetchurl,
|
||||
substituteAll,
|
||||
fetchpatch,
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
@@ -20,12 +21,19 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-g/aLWbWFR1icACZugmcYZGJ1k6tDYtjIB/UO6pI8rZM=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
inherit hwdata;
|
||||
})
|
||||
];
|
||||
patches =
|
||||
[
|
||||
(substituteAll {
|
||||
src = ./fix-paths.patch;
|
||||
inherit hwdata;
|
||||
})
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
(fetchpatch {
|
||||
url = "https://raw.githubusercontent.com/Homebrew/formula-patches/24a6945778381a62ecdcc1d78bcc16b9f86778c1/usbutils/portable.patch";
|
||||
hash = "sha256-spTkWURij4sPLoWtDaWVMIk81AS5W+qUUOQL1pAZEvs=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
@@ -37,13 +45,16 @@ stdenv.mkDerivation rec {
|
||||
python3
|
||||
];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"man"
|
||||
"python"
|
||||
];
|
||||
outputs =
|
||||
[
|
||||
"out"
|
||||
"man"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isLinux [
|
||||
"python" # uses sysfs
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
|
||||
moveToOutput "bin/lsusb.py" "$python"
|
||||
install -Dm555 usbreset -t $out/bin
|
||||
'';
|
||||
@@ -51,12 +62,15 @@ stdenv.mkDerivation rec {
|
||||
meta = {
|
||||
homepage = "http://www.linux-usb.org/";
|
||||
description = "Tools for working with USB devices, such as lsusb";
|
||||
maintainers = with lib.maintainers; [ cafkafk ];
|
||||
maintainers = with lib.maintainers; [
|
||||
cafkafk
|
||||
chuangzhu
|
||||
];
|
||||
license = with lib.licenses; [
|
||||
gpl2Only # manpages, usbreset
|
||||
gpl2Plus # most of the code
|
||||
];
|
||||
platforms = lib.platforms.linux;
|
||||
platforms = with lib.platforms; linux ++ darwin;
|
||||
mainProgram = "lsusb";
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user