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