strace: Fix cross-compilation

This commit is contained in:
Shea Levy 2018-02-27 20:31:15 -05:00
parent 5815c7dfa6
commit d61a22fb0e
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
2 changed files with 6 additions and 3 deletions

View File

@ -33,4 +33,6 @@ stdenv.mkDerivation rec {
platforms = platforms.linux; platforms = platforms.linux;
license = licenses.mit; license = licenses.mit;
}; };
passthru.supportsHost = !stdenv.hostPlatform.isRiscV;
} }

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, perl, libunwind }: { stdenv, fetchurl, perl, libunwind, buildPackages }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "strace-${version}"; name = "strace-${version}";
@ -9,11 +9,12 @@ stdenv.mkDerivation rec {
sha256 = "0dsw6xcfrmygidp1dj2ch8cl8icrar7789snkb2r8gh78kdqhxjw"; sha256 = "0dsw6xcfrmygidp1dj2ch8cl8icrar7789snkb2r8gh78kdqhxjw";
}; };
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ perl ]; nativeBuildInputs = [ perl ];
buildInputs = [ libunwind ]; # support -k buildInputs = stdenv.lib.optional libunwind.supportsHost [ libunwind ]; # support -k
configureFlags = stdenv.lib.optional stdenv.hostPlatform.isAarch64 "--enable-mpers=check"; configureFlags = stdenv.lib.optional (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isRiscV) "--enable-mpers=check";
meta = with stdenv.lib; { meta = with stdenv.lib; {
homepage = http://strace.io/; homepage = http://strace.io/;