2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, lib, fetchurl, zip, unzip
|
2016-07-13 05:45:33 +01:00
|
|
|
, jzmq, jdk, python
|
2018-07-21 01:44:44 +01:00
|
|
|
, confFile ? "", extraLibraryPaths ? [], extraJars ? [] }:
|
2013-02-07 14:32:10 +00:00
|
|
|
|
2016-07-13 05:45:33 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "apache-storm-" + version;
|
2018-04-12 22:35:24 +01:00
|
|
|
version = "1.2.1";
|
2013-02-07 14:32:10 +00:00
|
|
|
src = fetchurl {
|
2016-07-13 05:45:33 +01:00
|
|
|
url =
|
|
|
|
"mirror://apache/storm/${name}/${name}.tar.gz";
|
2018-04-12 22:35:24 +01:00
|
|
|
sha256 = "177dqgbviagrpvalg8h67mwiwwgmiqsg0hh97hcqqcjg71ypnjkv";
|
2013-02-07 14:32:10 +00:00
|
|
|
};
|
|
|
|
|
2013-02-14 08:58:49 +00:00
|
|
|
buildInputs = [ zip unzip jzmq ];
|
2013-02-07 14:32:10 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2016-07-13 05:45:33 +01:00
|
|
|
mkdir -p $out/share/${name}
|
|
|
|
mv public $out/docs
|
|
|
|
mv examples $out/share/${name}/.
|
2013-02-07 14:32:10 +00:00
|
|
|
|
2016-07-13 05:45:33 +01:00
|
|
|
rm -f lib/jzmq* || exit 1
|
2018-04-12 22:35:24 +01:00
|
|
|
mv external extlib* lib $out/.
|
2016-07-13 05:45:33 +01:00
|
|
|
mv conf bin $out/.
|
|
|
|
mv log4j2 $out/conf/.
|
|
|
|
'';
|
2013-09-10 15:05:47 +01:00
|
|
|
|
2016-07-13 05:45:33 +01:00
|
|
|
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
|
2013-02-14 08:58:49 +00:00
|
|
|
${if confFile != "" then ''cat ${confFile} >> defaults.yaml'' else ""}
|
2016-07-13 05:45:33 +01:00
|
|
|
mv defaults.yaml $out/conf;
|
2013-02-14 08:58:49 +00:00
|
|
|
|
|
|
|
# Link to jzmq jar and extra jars
|
2016-07-13 05:45:33 +01:00
|
|
|
cd $out/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;
|
|
|
|
|
2016-07-13 05:45:33 +01:00
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://storm.apache.org";
|
2013-10-06 10:49:53 +01:00
|
|
|
description = "Distributed realtime computation system";
|
2016-07-13 05:45:33 +01:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ edwtjo vizanto ];
|
2016-08-02 18:50:55 +01:00
|
|
|
platforms = with platforms; unix;
|
2013-02-07 14:32:10 +00:00
|
|
|
};
|
|
|
|
}
|