about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/mesos/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/cluster/mesos/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/mesos/default.nix84
1 files changed, 43 insertions, 41 deletions
diff --git a/pkgs/applications/networking/cluster/mesos/default.nix b/pkgs/applications/networking/cluster/mesos/default.nix
index ac7d94d5c9a8..8857e6ba4e35 100644
--- a/pkgs/applications/networking/cluster/mesos/default.nix
+++ b/pkgs/applications/networking/cluster/mesos/default.nix
@@ -2,6 +2,7 @@
 , automake115x, libtool, unzip, gnutar, jdk, maven, python, wrapPython
 , setuptools, boto, pythonProtobuf, apr, subversion, gzip, systemd
 , leveldb, glog, perf, utillinux, libnl, iproute, openssl, libevent
+, ethtool, coreutils
 , bash
 }:
 
@@ -10,7 +11,7 @@ let
   soext = if stdenv.system == "x86_64-darwin" then "dylib" else "so";
 
 in stdenv.mkDerivation rec {
-  version = "0.28.2";
+  version = "1.0.1";
   name = "mesos-${version}";
 
   enableParallelBuilding = true;
@@ -18,7 +19,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://apache/mesos/${version}/${name}.tar.gz";
-    sha256 = "0wh4h11w5qvqa66fiz0qbm9q48d3jz48mw6mm22bcy9q9wmzrxcn";
+    sha256 = "1hdh2wh11ck98ycfrxfzgivgk2pjl3638vkyw14xj7faj9qxjlz0";
   };
 
   patches = [
@@ -29,7 +30,8 @@ in stdenv.mkDerivation rec {
     ./rb51324.patch
     ./rb51325.patch
 
-    ./maven_repo.patch
+    # see https://github.com/cstrahan/mesos/tree/nixos-${version}
+    ./nixos.patch
   ];
 
   buildInputs = [
@@ -45,59 +47,59 @@ in stdenv.mkDerivation rec {
   ];
 
   preConfigure = ''
-    substituteInPlace src/Makefile.am --subst-var-by mavenRepo ${mavenRepo}
+    substituteInPlace 3rdparty/stout/include/stout/os/posix/fork.hpp \
+      --subst-var-by sh ${bash}/bin/bash
 
-    substituteInPlace 3rdparty/libprocess/include/process/subprocess.hpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
+    substituteInPlace 3rdparty/stout/include/stout/os/posix/shell.hpp \
+      --subst-var-by sh ${bash}/bin/bash
 
-    substituteInPlace 3rdparty/libprocess/3rdparty/stout/include/stout/posix/os.hpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
+    substituteInPlace src/Makefile.am \
+      --subst-var-by mavenRepo ${mavenRepo}
 
-    substituteInPlace 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/shell.hpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
-
-    substituteInPlace 3rdparty/libprocess/3rdparty/stout/include/stout/os/posix/fork.hpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
-
-    substituteInPlace src/cli/mesos-scp        \
-      --replace "'scp " "'${openssh}/bin/scp "
-
-    substituteInPlace src/launcher/executor.cpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
+    substituteInPlace src/cli/mesos-scp \
+      --subst-var-by scp ${openssh}/bin/scp
 
     substituteInPlace src/launcher/fetcher.cpp \
-      --replace '"gzip' '"${gzip}/bin/gzip'    \
-      --replace '"tar' '"${gnutar}/bin/tar'    \
-      --replace '"unzip' '"${unzip}/bin/unzip'
+      --subst-var-by gzip  ${gzip}/bin/gzip \
+      --subst-var-by tar   ${gnutar}/bin/tar \
+      --subst-var-by unzip ${unzip}/bin/unzip
 
     substituteInPlace src/python/cli/src/mesos/cli.py \
-     --replace "['mesos-resolve'" "['$out/bin/mesos-resolve'"
+      --subst-var-by mesos-resolve $out/bin/mesos-resolve
 
-    substituteInPlace src/slave/containerizer/mesos/launch.cpp \
-      --replace '"sh"' '"${bash}/bin/bash"'
+    substituteInPlace src/slave/containerizer/mesos/isolators/posix/disk.cpp \
+      --subst-var-by du ${coreutils}/bin/du \
+      --subst-var-by cp ${coreutils}/bin/cp
 
-  '' + lib.optionalString stdenv.isLinux ''
+    substituteInPlace src/slave/containerizer/mesos/provisioner/backends/copy.cpp \
+      --subst-var-by cp ${coreutils}/bin/cp
 
-    substituteInPlace configure.ac             \
-      --replace /usr/include/libnl3 ${libnl.dev}/include/libnl3
+    substituteInPlace src/uri/fetchers/copy.cpp \
+      --subst-var-by cp ${coreutils}/bin/cp
 
-    substituteInPlace src/linux/perf.cpp       \
-      --replace '"perf ' '"${perf}/bin/perf '
+    substituteInPlace src/uri/fetchers/curl.cpp \
+      --subst-var-by curl ${curl}/bin/curl
+
+    substituteInPlace src/uri/fetchers/docker.cpp \
+      --subst-var-by curl ${curl}/bin/curl
+
+  '' + lib.optionalString stdenv.isLinux ''
 
-    substituteInPlace src/linux/systemd.cpp \
-      --replace 'os::realpath("/sbin/init")' '"${systemd}/lib/systemd/systemd"'
+    substituteInPlace src/linux/perf.cpp \
+      --subst-var-by perf ${perf}/bin/perf
 
     substituteInPlace src/slave/containerizer/mesos/isolators/filesystem/shared.cpp \
-      --replace '"mount ' '"${utillinux}/bin/mount ' \
+      --subst-var-by mount ${utillinux}/bin/mount
 
     substituteInPlace src/slave/containerizer/mesos/isolators/namespaces/pid.cpp \
-      --replace '"mount ' '"${utillinux}/bin/mount ' \
+      --subst-var-by mount ${utillinux}/bin/mount
 
     substituteInPlace src/slave/containerizer/mesos/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}"
+      --subst-var-by tc      ${iproute}/bin/tc \
+      --subst-var-by ip      ${iproute}/bin/ip \
+      --subst-var-by mount   ${utillinux}/bin/mount \
+      --subst-var-by sh      ${stdenv.shell} \
+      --subst-var-by ethtool ${ethtool}/sbin/ethtool
   '';
 
   configureFlags = [
@@ -113,8 +115,11 @@ in stdenv.mkDerivation rec {
     "--with-ssl=${openssl.dev}"
     "--enable-libevent"
     "--with-libevent=${libevent.dev}"
+    "--with-protobuf=${pythonProtobuf.protobuf}"
+    "PROTOBUF_JAR=${mavenRepo}/com/google/protobuf/protobuf-java/2.6.1/protobuf-java-2.6.1.jar"
   ] ++ lib.optionals stdenv.isLinux [
     "--with-network-isolator"
+    "--with-nl=${libnl.dev}"
   ];
 
   postInstall = ''
@@ -180,8 +185,5 @@ in stdenv.mkDerivation rec {
     description = "A cluster manager that provides efficient resource isolation and sharing across distributed applications, or frameworks";
     maintainers = with maintainers; [ cstrahan kevincox offline rushmorem ];
     platforms   = platforms.linux;
-    # Marked as broken due to needing an update for security issues.
-    # See: https://github.com/NixOS/nixpkgs/issues/18856
-    broken = true;
   };
 }