Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at release-18.03 30 lines 889 B view raw
1{ stdenv, fetchurl, pkgconfig, systemd ? null, libobjc, IOKit }: 2 3stdenv.mkDerivation rec { 4 name = "libusb-1.0.21"; 5 6 src = fetchurl { 7 url = "mirror://sourceforge/libusb/${name}.tar.bz2"; 8 sha256 = "0jw2n5kdnrqvp7zh792fd6mypzzfap6jp4gfcmq4n6c1kb79rkkx"; 9 }; 10 11 outputs = [ "out" "dev" ]; # get rid of propagating systemd closure 12 13 nativeBuildInputs = [ pkgconfig ]; 14 propagatedBuildInputs = 15 stdenv.lib.optional stdenv.isLinux systemd ++ 16 stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ]; 17 18 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; 19 20 preFixup = stdenv.lib.optionalString stdenv.isLinux '' 21 sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la 22 ''; 23 24 meta = { 25 homepage = http://www.libusb.info; 26 description = "User-space USB library"; 27 platforms = stdenv.lib.platforms.unix; 28 maintainers = [ ]; 29 }; 30}