about summary refs log tree commit diff
path: root/pkgs/servers/computing
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2013-09-10 16:05:47 +0200
committerVladimír Čunát <vcunat@gmail.com>2013-09-10 16:18:31 +0200
commitbb6b42385d3e138d9632410404d9ab167100ac57 (patch)
treed7104842ad86d2f43c6610111a2dc745c5401e01 /pkgs/servers/computing
parent70fee5da112b8a0093d59ac16cdead4d0a72f357 (diff)
parent3f3a7e9e435b735804cb5bf0a6842ce28f440fe5 (diff)
downloadnixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar.gz
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar.bz2
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar.lz
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar.xz
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.tar.zst
nixlib-bb6b42385d3e138d9632410404d9ab167100ac57.zip
Merge PR #901: adding Storm
vcunat edit: use symlink instead of hardlink (failed for me with a
cross-device error), minor whitespace cleanup
Diffstat (limited to 'pkgs/servers/computing')
-rw-r--r--pkgs/servers/computing/storm/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/servers/computing/storm/default.nix b/pkgs/servers/computing/storm/default.nix
new file mode 100644
index 000000000000..ca3f5333b30e
--- /dev/null
+++ b/pkgs/servers/computing/storm/default.nix
@@ -0,0 +1,49 @@
+{ stdenv, fetchurl, zip, unzip, jzmq, jdk, lib, python, logsDir ? "", confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
+
+stdenv.mkDerivation {
+  name = "storm-0.8.2";
+  src = fetchurl {
+    url = https://dl.dropbox.com/u/133901206/storm-0.8.2.zip;
+    sha256 = "8761aea0b54e5bab4a68b259bbe6b5b2f8226204488b5559eba57a0c458b2bbc";
+  };
+
+  buildInputs = [ zip unzip jzmq ];
+
+  installPhase = ''
+    # Remove junk
+    rm -f lib/jzmq*
+    mkdir -p $out/bin
+    mv bin/storm $out/bin/
+    rm -R bin conf logs
+
+    # Fix shebang header for python scripts
+    sed -i -e "s|#!/usr/bin/.*python|#!${python}/bin/python|" $out/bin/storm;
+
+    mkdir -p $out/conf
+    cp -av * $out
+
+    cd $out;
+    ${if logsDir  != "" then ''ln -s ${logsDir} logs'' else ""}
+
+    # Extract, delete from zip; and optionally append to defaults.yaml
+    unzip  storm-*.jar defaults.yaml;
+    zip -d storm-*.jar defaults.yaml;
+    echo 'java.library.path: "${jzmq}/lib:${lib.concatStringsSep ":" extraLibraryPaths}"' >> defaults.yaml;
+    ${if confFile != "" then ''cat ${confFile} >> defaults.yaml'' else ""}
+    mv defaults.yaml conf;
+
+    # Link to jzmq jar and extra jars
+    cd lib;
+    ln -s ${jzmq}/share/java/*.jar;
+    ${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars}
+  '';
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "http://storm-project.net";
+    description = "Storm, free and open source distributed realtime computation system.";
+    license = "Eclipse Public License 1.0";
+    maintainers = [ lib.maintainers.vizanto ];
+  };
+}