mesos: fix on darwin by disabling java interface

This commit is contained in:
Dmitry Kalinkin 2018-04-05 10:16:20 -04:00
parent 9049f8a418
commit e120915248
No known key found for this signature in database
GPG key ID: 5157B3EC8B2CA333

View file

@ -4,6 +4,7 @@
, leveldb, glog, perf, utillinux, libnl, iproute, openssl, libevent
, ethtool, coreutils, which, iptables, maven
, bash, autoreconfHook
, withJava ? !stdenv.isDarwin
}:
let
@ -46,11 +47,13 @@ in stdenv.mkDerivation rec {
autoreconfHook
];
buildInputs = [
makeWrapper curl sasl jdk
makeWrapper curl sasl
python wrapPython boto setuptools leveldb
subversion apr glog openssl libevent maven
subversion apr glog openssl libevent
] ++ lib.optionals stdenv.isLinux [
libnl
] ++ lib.optionals withJava [
jdk maven
];
propagatedBuildInputs = [
@ -181,6 +184,7 @@ in stdenv.mkDerivation rec {
"--with-libevent=${libevent.dev}"
"--with-protobuf=${pythonProtobuf.protobuf}"
"PROTOBUF_JAR=${mavenRepo}/com/google/protobuf/protobuf-java/3.3.0/protobuf-java-3.3.0.jar"
(if withJava then "--enable-java" else "--disable-java")
] ++ lib.optionals stdenv.isLinux [
"--with-network-isolator"
"--with-nl=${libnl.dev}"
@ -190,16 +194,6 @@ in stdenv.mkDerivation rec {
rm -rf $out/var
rm $out/bin/*.sh
mkdir -p $out/share/java
cp src/java/target/mesos-*.jar $out/share/java
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos${stdenv.hostPlatform.extensions.sharedLibrary}
mkdir -p $out/nix-support
touch $out/nix-support/setup-hook
echo "export MESOS_NATIVE_JAVA_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
echo "export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
# Inspired by: pkgs/development/python-modules/generic/default.nix
pushd src/python
mkdir -p $out/lib/${python.libPrefix}/site-packages
@ -218,6 +212,16 @@ in stdenv.mkDerivation rec {
--old-and-unmanageable \
--prefix="$out"
popd
'' + stdenv.lib.optionalString withJava ''
mkdir -p $out/share/java
cp src/java/target/mesos-*.jar $out/share/java
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos${stdenv.hostPlatform.extensions.sharedLibrary}
mkdir -p $out/nix-support
touch $out/nix-support/setup-hook
echo "export MESOS_NATIVE_JAVA_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
echo "export MESOS_NATIVE_LIBRARY=$MESOS_NATIVE_JAVA_LIBRARY" >> $out/nix-support/setup-hook
'';
postFixup = ''
@ -248,6 +252,6 @@ in stdenv.mkDerivation rec {
license = licenses.asl20;
description = "A cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks";
maintainers = with maintainers; [ cstrahan kevincox offline ];
platforms = platforms.linux;
platforms = platforms.unix;
};
}