summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeon Schuermann <leon.git@is.currently.online>2018-10-14 23:18:17 +0200
committerLeon Schuermann <leon@is.currently.online>2020-03-08 20:15:03 +0100
commitaa63d51a34d0b171516227f945209f0c5b559d62 (patch)
treec3d7dbf71e14a9b6f13740b395f9619ed0e1d689
parent54bab3faafa809f09b420d51469cdea742a7eb5a (diff)
downloadnixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar.gz
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar.bz2
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar.lz
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar.xz
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.tar.zst
nixpkgs-aa63d51a34d0b171516227f945209f0c5b559d62.zip
libusb: build from source instead of release tarball
-rw-r--r--pkgs/development/libraries/libusb/default.nix12
-rw-r--r--pkgs/development/libraries/libusb1/default.nix23
2 files changed, 19 insertions, 16 deletions
diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix
index 4d62eadda91..681b2eef456 100644
--- a/pkgs/development/libraries/libusb/default.nix
+++ b/pkgs/development/libraries/libusb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, libusb1}:
+{stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libusb1}:
 
 stdenv.mkDerivation rec {
   name = "libusb-compat-${version}";
@@ -7,12 +7,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
   outputBin = "dev";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
   propagatedBuildInputs = [ libusb1 ];
 
-  src = fetchurl {
-    url = "https://github.com/libusb/libusb-compat-0.1/releases/download/v${version}/${name}.tar.gz";
-    sha256 = "1y2wjba4w9r53sfaacj6awyqhmi31n53j4wwx8g8qj82m8wcwy86";
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "libusb-compat-0.1";
+    rev = "v${version}";
+    sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
   };
 
   patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index 9d90304042c..65023814171 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -1,5 +1,6 @@
 { stdenv
-, fetchurl
+, fetchFromGitHub
+, autoreconfHook
 , pkgconfig
 , enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
 , systemd ? null
@@ -10,22 +11,26 @@
 
 assert enableSystemd -> systemd != null;
 
-stdenv.mkDerivation (rec {
+stdenv.mkDerivation rec {
   pname = "libusb";
   version = "1.0.23";
 
-  src = fetchurl {
-    url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
-    sha256 = "13dd2a9x290d1q8nb1lqiaf36grcvns5ripk5k2xm0lajmpc04fv";
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "libusb";
+    rev = "v${version}";
+    sha256 = "0mxbpg01kgbk5nh6524b0m4xk7ywkyzmc3yhi5asqcsd3rbhjj98";
   };
 
   outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
   propagatedBuildInputs =
     stdenv.lib.optional enableSystemd systemd ++
     stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
 
+  dontDisableStatic = withStatic;
+
   NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isLinux "-lgcc_s";
 
   preFixup = stdenv.lib.optionalString stdenv.isLinux ''
@@ -43,8 +48,4 @@ stdenv.mkDerivation (rec {
     license = licenses.lgpl21Plus;
     maintainers = [ ];
   };
-} // stdenv.lib.optionalAttrs withStatic {
-  # Carefully added here to avoid a mass rebuild.
-  # Inline this the next time this package changes.
-  dontDisableStatic = withStatic;
-})
+}