forked from mirrors/nixpkgs
mesos: 0.21.0 -> 0.22.0
This also enables the network isolation feature that was introduced in Mesos 0.20.0.
This commit is contained in:
parent
029db1fdf4
commit
9d9e21c7fd
|
@ -1,35 +1,38 @@
|
|||
{ stdenv, lib, makeWrapper, fetchurl, curl, sasl, openssh, autoconf
|
||||
, automake, libtool, unzip, gnutar, jdk, maven, python, wrapPython
|
||||
, setuptools, distutils-cfg, boto, pythonProtobuf, apr, subversion
|
||||
, leveldb, glog
|
||||
, leveldb, glog, perf, utillinux, libnl, iproute
|
||||
}:
|
||||
|
||||
let version = "0.21.0";
|
||||
in stdenv.mkDerivation {
|
||||
dontDisableStatic = true;
|
||||
let
|
||||
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
|
||||
soext = if stdenv.system == "x86_64-darwin" then "dylib" else "so";
|
||||
|
||||
in stdenv.mkDerivation rec {
|
||||
version = "0.22.0";
|
||||
name = "mesos-${version}";
|
||||
|
||||
dontDisableStatic = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "http://www.apache.org/dist/mesos/${version}/mesos-${version}.tar.gz";
|
||||
sha256 = "01ap8blrb046w26zf3i4r7vvnnhjsbfi20vz5yinmncqbzjjyx6i";
|
||||
sha256 = "0z8c1vr7b06l3nqgbxq8ydcz79ayw75y2szipfqkw17c7gv6d7v8";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
makeWrapper autoconf automake libtool curl sasl jdk maven
|
||||
python wrapPython boto distutils-cfg setuptools leveldb
|
||||
subversion apr glog
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
libnl
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
pythonProtobuf
|
||||
];
|
||||
|
||||
mavenRepo = import ./mesos-deps.nix { inherit stdenv curl; };
|
||||
|
||||
preConfigure = ''
|
||||
export MAVEN_OPTS="-Dmaven.repo.local=$(pwd)/.m2"
|
||||
ln -s $mavenRepo .m2
|
||||
export MAVEN_OPTS="-Dmaven.repo.local=${mavenRepo}"
|
||||
|
||||
substituteInPlace src/launcher/fetcher.cpp \
|
||||
--replace '"tar' '"${gnutar}/bin/tar' \
|
||||
|
@ -37,6 +40,29 @@ in stdenv.mkDerivation {
|
|||
|
||||
substituteInPlace src/cli/mesos-scp \
|
||||
--replace "'scp " "'${openssh}/bin/scp "
|
||||
|
||||
substituteInPlace src/cli/python/mesos/cli.py \
|
||||
--replace "['mesos-resolve'" "['$out/bin/mesos-resolve'"
|
||||
|
||||
'' + lib.optionalString (stdenv.isLinux) ''
|
||||
|
||||
substituteInPlace configure.ac \
|
||||
--replace /usr/include/libnl3 ${libnl}/include/libnl3
|
||||
|
||||
substituteInPlace src/linux/perf.cpp \
|
||||
--replace '"perf ' '"${perf}/bin/perf '
|
||||
|
||||
substituteInPlace src/slave/containerizer/isolators/filesystem/shared.cpp \
|
||||
--replace '"mount ' '"${utillinux}/bin/mount ' \
|
||||
|
||||
substituteInPlace src/slave/containerizer/isolators/namespaces/pid.cpp \
|
||||
--replace '"mount ' '"${utillinux}/bin/mount ' \
|
||||
|
||||
substituteInPlace src/slave/containerizer/isolators/network/port_mapping.cpp \
|
||||
--replace '"tc ' '"${iproute}/bin/tc ' \
|
||||
--replace '"ip ' '"${iproute}/bin/ip ' \
|
||||
--replace '"mount ' '"${utillinux}/bin/mount ' \
|
||||
--replace '/bin/sh' "${stdenv.shell}"
|
||||
'';
|
||||
|
||||
configureFlags = [
|
||||
|
@ -45,27 +71,29 @@ in stdenv.mkDerivation {
|
|||
"--with-svn=${subversion}"
|
||||
"--with-leveldb=${leveldb}"
|
||||
"--with-glog=${glog}"
|
||||
"--with-glog=${glog}"
|
||||
"--enable-optimize"
|
||||
"--disable-python-dependency-install"
|
||||
] ++ lib.optionals stdenv.isLinux [
|
||||
"--with-network-isolator"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
rm -rf $out/var
|
||||
rm $out/bin/*.sh
|
||||
|
||||
ensureDir $out/share/java
|
||||
mkdir -p $out/share/java
|
||||
cp src/java/target/mesos-*.jar $out/share/java
|
||||
|
||||
shopt -s extglob
|
||||
MESOS_NATIVE_JAVA_LIBRARY=$(echo $out/lib/libmesos.*(so|dylib))
|
||||
shopt -u extglob
|
||||
MESOS_NATIVE_JAVA_LIBRARY=$out/lib/libmesos.${soext}
|
||||
|
||||
ensureDir $out/nix-support
|
||||
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
|
||||
ensureDir "$out/lib/${python.libPrefix}"/site-packages
|
||||
mkdir -p $out/lib/${python.libPrefix}/site-packages
|
||||
export PYTHONPATH="$out/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
||||
${python}/bin/${python.executable} src/python/setup.py install \
|
||||
--install-lib=$out/lib/${python.libPrefix}/site-packages \
|
||||
|
@ -85,14 +113,14 @@ in stdenv.mkDerivation {
|
|||
fi
|
||||
done
|
||||
|
||||
for f in $out/libexec/mesos/python/mesos/*.py; do
|
||||
${python}/bin/${python.executable} -c "import py_compile; py_compile.compile('$f')"
|
||||
done
|
||||
|
||||
# wrap the python programs
|
||||
declare -A pythonPathsSeen=()
|
||||
program_PYTHONPATH="$out/libexec/mesos/python"
|
||||
program_PATH=""
|
||||
_addToPythonPath "$out"
|
||||
for prog in mesos-cat mesos-ps mesos-scp mesos-tail; do
|
||||
wrapProgram "$out/bin/$prog" \
|
||||
--prefix PYTHONPATH ":" $program_PYTHONPATH
|
||||
--prefix PYTHONPATH ":" "$out/libexec/mesos/python"
|
||||
true
|
||||
done
|
||||
'';
|
||||
|
|
|
@ -4640,6 +4640,7 @@ let
|
|||
sasl = cyrus_sasl;
|
||||
inherit (pythonPackages) python boto setuptools distutils-cfg wrapPython;
|
||||
pythonProtobuf = pythonPackages.protobuf2_5;
|
||||
perf = linuxPackages.perf;
|
||||
};
|
||||
|
||||
mesos-dns = callPackage ../servers/dns/mesos-dns { };
|
||||
|
|
Loading…
Reference in a new issue