2013-02-14 08:58:49 +00:00
|
|
|
{ stdenv, fetchurl, zip, unzip, jzmq, jdk, lib, python, logsDir ? "", confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
|
2013-02-07 14:32:10 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "storm-0.8.2";
|
|
|
|
src = fetchurl {
|
|
|
|
url = https://dl.dropbox.com/u/133901206/storm-0.8.2.zip;
|
|
|
|
sha256 = "8761aea0b54e5bab4a68b259bbe6b5b2f8226204488b5559eba57a0c458b2bbc";
|
|
|
|
};
|
|
|
|
|
2013-02-14 08:58:49 +00:00
|
|
|
buildInputs = [ zip unzip jzmq ];
|
2013-02-07 14:32:10 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# Remove junk
|
|
|
|
rm -f lib/jzmq*
|
2013-02-08 14:19:33 +00:00
|
|
|
mkdir -p $out/bin
|
2013-02-07 14:32:10 +00:00
|
|
|
mv bin/storm $out/bin/
|
2013-02-08 14:19:33 +00:00
|
|
|
rm -R bin conf logs
|
2013-02-07 14:32:10 +00:00
|
|
|
|
|
|
|
# Fix shebang header for python scripts
|
2013-02-08 14:19:33 +00:00
|
|
|
sed -i -e "s|#!/usr/bin/.*python|#!${python}/bin/python|" $out/bin/storm;
|
2013-02-07 14:32:10 +00:00
|
|
|
|
2013-02-14 08:58:49 +00:00
|
|
|
mkdir -p $out/conf
|
2013-02-07 14:32:10 +00:00
|
|
|
cp -av * $out
|
2013-09-10 15:05:47 +01:00
|
|
|
|
2013-02-08 14:19:33 +00:00
|
|
|
cd $out;
|
2013-02-14 08:58:49 +00:00
|
|
|
${if logsDir != "" then ''ln -s ${logsDir} logs'' else ""}
|
2013-09-10 15:05:47 +01:00
|
|
|
|
2013-02-14 08:58:49 +00:00
|
|
|
# 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;
|
2013-09-10 15:05:47 +01:00
|
|
|
ln -s ${jzmq}/share/java/*.jar;
|
2013-02-14 08:58:49 +00:00
|
|
|
${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars}
|
2013-02-07 14:32:10 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://storm-project.net";
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Distributed realtime computation system";
|
2014-11-06 00:44:33 +00:00
|
|
|
license = stdenv.lib.licenses.epl10;
|
2013-09-02 17:48:29 +01:00
|
|
|
maintainers = [ lib.maintainers.vizanto ];
|
2013-02-07 14:32:10 +00:00
|
|
|
};
|
|
|
|
}
|