Merge pull request #48434 from lschuermann/libusb-mirror

libusb-compat: 0.1.5 -> 0.1.7 && change libusb source to GitHub
This commit is contained in:
Jörg Thalheim 2020-03-09 10:30:33 +00:00 committed by GitHub
commit 9f55c5e37c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 18 deletions

View File

@ -1,17 +1,20 @@
{stdenv, fetchurl, pkgconfig, libusb1}: {stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libusb1}:
stdenv.mkDerivation { stdenv.mkDerivation rec {
name = "libusb-compat-0.1.5"; name = "libusb-compat-${version}";
version = "0.1.7";
outputs = [ "out" "dev" ]; # get rid of propagating systemd closure outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
outputBin = "dev"; outputBin = "dev";
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig autoreconfHook ];
propagatedBuildInputs = [ libusb1 ]; propagatedBuildInputs = [ libusb1 ];
src = fetchurl { src = fetchFromGitHub {
url = mirror://sourceforge/libusb/libusb-compat-0.1.5.tar.bz2; owner = "libusb";
sha256 = "0nn5icrfm9lkhzw1xjvaks9bq3w6mjg86ggv3fn7kgi4nfvg8kj0"; repo = "libusb-compat-0.1";
rev = "v${version}";
sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
}; };
patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch; patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;

View File

@ -1,5 +1,6 @@
{ stdenv { stdenv
, fetchurl , fetchFromGitHub
, autoreconfHook
, pkgconfig , pkgconfig
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl , enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
, systemd ? null , systemd ? null
@ -10,22 +11,26 @@
assert enableSystemd -> systemd != null; assert enableSystemd -> systemd != null;
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
pname = "libusb"; pname = "libusb";
version = "1.0.23"; version = "1.0.23";
src = fetchurl { src = fetchFromGitHub {
url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2"; owner = "libusb";
sha256 = "13dd2a9x290d1q8nb1lqiaf36grcvns5ripk5k2xm0lajmpc04fv"; repo = "libusb";
rev = "v${version}";
sha256 = "0mxbpg01kgbk5nh6524b0m4xk7ywkyzmc3yhi5asqcsd3rbhjj98";
}; };
outputs = [ "out" "dev" ]; # get rid of propagating systemd closure outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
nativeBuildInputs = [ pkgconfig ]; nativeBuildInputs = [ pkgconfig autoreconfHook ];
propagatedBuildInputs = propagatedBuildInputs =
stdenv.lib.optional enableSystemd systemd ++ stdenv.lib.optional enableSystemd systemd ++
stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ]; stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
dontDisableStatic = withStatic;
NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s"; NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
preFixup = stdenv.lib.optionalString stdenv.isLinux '' preFixup = stdenv.lib.optionalString stdenv.isLinux ''
@ -43,8 +48,4 @@ stdenv.mkDerivation (rec {
license = licenses.lgpl21Plus; license = licenses.lgpl21Plus;
maintainers = [ ]; maintainers = [ ];
}; };
} // stdenv.lib.optionalAttrs withStatic { }
# Carefully added here to avoid a mass rebuild.
# Inline this the next time this package changes.
dontDisableStatic = withStatic;
})