From 4a605161b37c010175a441b6ac0829ff1738aed2 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 6 Sep 2016 13:44:46 -0500 Subject: [PATCH] iperf: Fix build with musl. --- pkgs/tools/networking/iperf/3.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/iperf/3.nix b/pkgs/tools/networking/iperf/3.nix index d69b52a50014..b9e47ecd7f90 100644 --- a/pkgs/tools/networking/iperf/3.nix +++ b/pkgs/tools/networking/iperf/3.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, openssl }: +{ stdenv, fetchurl, openssl, fetchpatch }: stdenv.mkDerivation rec { name = "iperf-3.3"; @@ -10,6 +10,23 @@ stdenv.mkDerivation rec { buildInputs = [ openssl ]; + preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isMusl '' + NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE" + ''; + + patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [ + (fetchpatch { + url = "http://git.alpinelinux.org/cgit/aports/plain/main/iperf3/build-fixes.patch"; + name = "fix-musl-build.patch"; + sha256 = "0zvfjnqdldh6rc6qggyb310swdnl9qk0m3z1kklnqzgjsh8dskvl"; + }) + (fetchpatch { + url = "http://git.alpinelinux.org/cgit/aports/plain/main/iperf3/remove-pg-flags.patch"; + name = "remove-pg-flags.patch"; + sha256 = "0lnczhass24kgq59drgdipnhjnw4l1cy6gqza7f2ah1qr4q104rm"; + }) +]; + postInstall = '' ln -s iperf3 $out/bin/iperf '';