forked from mirrors/nixpkgs
Improved Storm package.
- Add config to defaults.yaml, to allow topologies to include their own storm.yaml. - Symlink extra jars in lib/ since it's nearly impossible to add a classpath to Storm's config. - Include native jzmq library in java.library.path - Use package default args.
This commit is contained in:
parent
d6a812332c
commit
c4b1bbc1c8
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, fetchurl, unzip, jzmq, jdk, lib, python, logsDir, confDir }:
|
||||
{ stdenv, fetchurl, zip, unzip, jzmq, jdk, lib, python, logsDir ? "", confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "storm-0.8.2";
|
||||
|
@ -7,7 +7,7 @@ stdenv.mkDerivation {
|
|||
sha256 = "8761aea0b54e5bab4a68b259bbe6b5b2f8226204488b5559eba57a0c458b2bbc";
|
||||
};
|
||||
|
||||
buildInputs = [ unzip jzmq ];
|
||||
buildInputs = [ zip unzip jzmq ];
|
||||
|
||||
installPhase = ''
|
||||
# Remove junk
|
||||
|
@ -19,11 +19,23 @@ stdenv.mkDerivation {
|
|||
# Fix shebang header for python scripts
|
||||
sed -i -e "s|#!/usr/bin/.*python|#!${python}/bin/python|" $out/bin/storm;
|
||||
|
||||
mkdir -p $out
|
||||
mkdir -p $out/conf
|
||||
cp -av * $out
|
||||
|
||||
cd $out;
|
||||
${if logsDir != "" then ''ln -s ${logsDir} logs'' else ""}
|
||||
${if confDir != "" then ''ln -s ${confDir} conf'' else ""}
|
||||
${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 ${jzmq}/share/java/*.jar;
|
||||
${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars}
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
|
|
|
@ -6170,7 +6170,7 @@ let
|
|||
|
||||
thttpd = callPackage ../servers/http/thttpd { };
|
||||
|
||||
storm = callPackage ../servers/computing/storm { confDir = "/etc/storm"; logsDir = "/var/log"; };
|
||||
storm = callPackage ../servers/computing/storm { };
|
||||
|
||||
tomcat5 = callPackage ../servers/http/tomcat/5.0.nix { };
|
||||
|
||||
|
|
Loading…
Reference in a new issue