libusb1: add option to build with examples
This commit is contained in:
parent
8f421eef7d
commit
fff47fb039
@ -1,4 +1,5 @@
|
||||
{ lib, stdenv
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, autoreconfHook
|
||||
@ -8,6 +9,7 @@
|
||||
, libobjc
|
||||
, IOKit
|
||||
, Security
|
||||
, withExamples ? false
|
||||
, withStatic ? false
|
||||
}:
|
||||
|
||||
@ -31,12 +33,20 @@ stdenv.mkDerivation rec {
|
||||
|
||||
dontDisableStatic = withStatic;
|
||||
|
||||
configureFlags = lib.optional (!enableUdev) "--disable-udev";
|
||||
configureFlags =
|
||||
lib.optional (!enableUdev) "--disable-udev"
|
||||
++ lib.optional (withExamples) "--enable-examples-build";
|
||||
|
||||
preFixup = lib.optionalString enableUdev ''
|
||||
sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
|
||||
'';
|
||||
|
||||
postInstall = lib.optionalString withExamples ''
|
||||
mkdir -p $out/{bin,sbin,examples/bin}
|
||||
cp -r examples/.libs/* $out/examples/bin
|
||||
ln -s $out/examples/bin/fxload $out/sbin/fxload
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://libusb.info/";
|
||||
description = "cross-platform user-mode USB device library";
|
||||
@ -45,6 +55,6 @@ stdenv.mkDerivation rec {
|
||||
'';
|
||||
platforms = platforms.all;
|
||||
license = licenses.lgpl21Plus;
|
||||
maintainers = with maintainers; [ prusnak ];
|
||||
maintainers = with maintainers; [ prusnak realsnick ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user