mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #48450 from ryan4729/proto3-cross
protobuf3: support cross compilation
This commit is contained in:
commit
dc6abb3db8
1 changed files with 10 additions and 4 deletions
|
@ -1,11 +1,12 @@
|
||||||
{ stdenv
|
{ stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, autoreconfHook, zlib, gmock
|
, autoreconfHook, zlib, gmock, which, buildPackages
|
||||||
, version, sha256
|
, version, sha256
|
||||||
, ...
|
, ...
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
let
|
||||||
|
mkProtobufDerivation = buildProtobuf: stdenv: stdenv.mkDerivation rec {
|
||||||
name = "protobuf-${version}";
|
name = "protobuf-${version}";
|
||||||
|
|
||||||
# make sure you test also -A pythonPackages.protobuf
|
# make sure you test also -A pythonPackages.protobuf
|
||||||
|
@ -28,8 +29,10 @@ stdenv.mkDerivation rec {
|
||||||
--replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
|
--replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ autoreconfHook ];
|
nativeBuildInputs = [ autoreconfHook buildPackages.which buildPackages.stdenv.cc buildProtobuf ];
|
||||||
|
|
||||||
buildInputs = [ zlib ];
|
buildInputs = [ zlib ];
|
||||||
|
configureFlags = if buildProtobuf == null then [] else [ "--with-protoc=${buildProtobuf}/bin/protoc" ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
|
@ -54,4 +57,7 @@ stdenv.mkDerivation rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
passthru.version = version;
|
passthru.version = version;
|
||||||
}
|
};
|
||||||
|
in mkProtobufDerivation(if (stdenv.buildPlatform != stdenv.hostPlatform)
|
||||||
|
then (mkProtobufDerivation null buildPackages.stdenv)
|
||||||
|
else null) stdenv
|
||||||
|
|
Loading…
Reference in a new issue