summary refs log tree commit diff
path: root/pkgs/servers/computing/storm/default.nix
diff options
context:
space:
mode:
authorEdward Tjörnhammar <ed@cflags.cc>2016-07-13 06:45:33 +0200
committerEdward Tjörnhammar <ed@cflags.cc>2016-07-13 06:45:33 +0200
commit60e5b599d5298b4af92944a3f6260765cde6619e (patch)
treee71068c0958cb39f59414f1c0586649285b6f7de /pkgs/servers/computing/storm/default.nix
parent6423ded1bccc39298e8f4e60a89895f64a4def65 (diff)
downloadnixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar.gz
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar.bz2
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar.lz
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar.xz
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.tar.zst
nixpkgs-60e5b599d5298b4af92944a3f6260765cde6619e.zip
storm: 0.8.2 -> 1.0.1
For this package to be useful you need to wrap it in a fhs-user-env and/or
create a nixos module. Previous version had become completely broken/useless
though.
Diffstat (limited to 'pkgs/servers/computing/storm/default.nix')
-rw-r--r--pkgs/servers/computing/storm/default.nix72
1 files changed, 44 insertions, 28 deletions
diff --git a/pkgs/servers/computing/storm/default.nix b/pkgs/servers/computing/storm/default.nix
index cab91409654..cf57e653c49 100644
--- a/pkgs/servers/computing/storm/default.nix
+++ b/pkgs/servers/computing/storm/default.nix
@@ -1,49 +1,65 @@
-{ stdenv, fetchurl, zip, unzip, jzmq, jdk, lib, python, logsDir ? "", confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
+{ stdenv, lib, fetchurl, zip, unzip, makeWrapper
+, jzmq, jdk, python
+, logsDir ? "", confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
 
-stdenv.mkDerivation {
-  name = "storm-0.8.2";
+stdenv.mkDerivation rec {
+  name = "apache-storm-" + version;
+  version = "1.0.1";
   src = fetchurl {
-    url = https://dl.dropbox.com/u/133901206/storm-0.8.2.zip;
-    sha256 = "8761aea0b54e5bab4a68b259bbe6b5b2f8226204488b5559eba57a0c458b2bbc";
+    url =
+    "mirror://apache/storm/${name}/${name}.tar.gz";
+    sha256 = "1gr00s0fhf8ci0faf3x5dinkiw9mlnc1x1vqki8cfszvij6w0x0m";
   };
 
   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
+    mkdir -p $out/share/${name}
+    mv public $out/docs
+    mv examples $out/share/${name}/.
 
-    # 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 ""}
+    rm -f lib/jzmq* || exit 1
+    mv lib $out/.
+    mv external extlib* $out/lib/.
+    mv conf bin $out/.
+    mv log4j2 $out/conf/.
+  '';
 
-    # 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;
+  fixupPhase = ''
+    # Fix python reference
+    sed -i \
+      -e '19iPYTHON=${python}/bin/python' \
+      -e 's|#!/usr/bin/.*python|#!${python}/bin/python|' \
+      $out/bin/storm
+    sed -i \
+      -e 's|#!/usr/bin/.*python|#!${python}/bin/python|' \
+      -e "s|STORM_CONF_DIR = .*|STORM_CONF_DIR = os.getenv('STORM_CONF_DIR','$out/conf')|" \
+      -e 's|STORM_LOG4J2_CONF_DIR =.*|STORM_LOG4J2_CONF_DIR = os.path.join(STORM_CONF_DIR, "log4j2")|' \
+        $out/bin/storm.py
+    # Default jdk location
+    sed -i -e 's|#.*export JAVA_HOME=.*|export JAVA_HOME="${jdk.home}"|' \
+           $out/conf/storm-env.sh
+    unzip  $out/lib/storm-core-${version}.jar defaults.yaml;
+    zip -d $out/lib/storm-core-${version}.jar defaults.yaml;
+    sed -i \
+       -e 's|java.library.path: .*|java.library.path: "${jzmq}/lib:${lib.concatStringsSep ":" extraLibraryPaths}"|' \
+       -e 's|storm.log4j2.conf.dir: .*|storm.log4j2.conf.dir: "conf/log4j2"|' \
+      defaults.yaml
     ${if confFile != "" then ''cat ${confFile} >> defaults.yaml'' else ""}
-    mv defaults.yaml conf;
+    mv defaults.yaml $out/conf;
 
     # Link to jzmq jar and extra jars
-    cd lib;
+    cd $out/lib;
     ln -s ${jzmq}/share/java/*.jar;
     ${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars}
   '';
 
   dontStrip = true;
 
-  meta = {
-    homepage = "http://storm-project.net";
+  meta = with stdenv.lib; {
+    homepage = "http://storm.apache.org";
     description = "Distributed realtime computation system";
-    license = stdenv.lib.licenses.epl10;
-    maintainers = [ lib.maintainers.vizanto ];
+    license = licenses.asl20;
+    maintainers = with maintainers; [ edwtjo vizanto ];
   };
 }