Commit c8acbfcc authored by Marie Ramlow's avatar Marie Ramlow Committed by Bjørn Forsman
Browse files

gsoap: fix cross compilation

gsoap requires a soapcpp2 for the build platform when cross compiling.
parent bf193629
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
{ lib, stdenv, fetchurl, autoreconfHook, unzip, m4, bison, flex, openssl, zlib }:
{ lib, stdenv, fetchurl, autoreconfHook, unzip, m4, bison, flex, openssl, zlib, buildPackages }:

let
  majorVersion = "2.8";
  isCross = stdenv.hostPlatform != stdenv.buildPlatform;

in stdenv.mkDerivation rec {
  pname = "gsoap";
@@ -22,6 +23,10 @@ in stdenv.mkDerivation rec {
  prePatch = ''
    substituteInPlace configure.ac \
      --replace 'AM_INIT_AUTOMAKE([foreign])' 'AM_INIT_AUTOMAKE([foreign subdir-objects])'
    ${lib.optionalString isCross ''
      substituteInPlace gsoap/wsdl/Makefile.am \
        --replace-fail 'SOAP=$(top_builddir)/gsoap/src/soapcpp2$(EXEEXT)' 'SOAP=${lib.getExe' buildPackages.gsoap "soapcpp2"}'
    ''}
  '';

  meta = with lib; {