2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchurl, zip, unzip
|
2020-08-20 17:08:02 +00:00
|
|
|
, jdk, python
|
|
|
|
, confFile ? ""
|
|
|
|
, extraLibraryPaths ? []
|
|
|
|
, extraJars ? []
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "apache-storm";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "2.3.0";
|
2020-08-20 17:08:02 +00:00
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2020-08-20 17:08:02 +00:00
|
|
|
url = "mirror://apache/storm/${name}/${name}.tar.gz";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-ScIlWyZjPG/ZY5nFIDOeRZ/NopoOfm0Mh3XO/P9sNjY=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
nativeBuildInputs = [ zip unzip ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/share/${name}
|
|
|
|
mv public $out/docs
|
|
|
|
mv examples $out/share/${name}/.
|
|
|
|
|
|
|
|
mv external extlib* lib $out/.
|
|
|
|
mv conf bin $out/.
|
|
|
|
mv log4j2 $out/conf/.
|
|
|
|
'';
|
|
|
|
|
|
|
|
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
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Default jdk location
|
|
|
|
sed -i -e 's|#.*export JAVA_HOME=.*|export JAVA_HOME="${jdk.home}"|' \
|
|
|
|
$out/conf/storm-env.sh
|
2020-08-20 17:08:02 +00:00
|
|
|
ls -lh $out/lib
|
|
|
|
unzip $out/lib/storm-client-${version}.jar defaults.yaml;
|
|
|
|
zip -d $out/lib/storm-client-${version}.jar defaults.yaml;
|
2020-04-24 23:36:52 +00:00
|
|
|
sed -i \
|
2020-08-20 17:08:02 +00:00
|
|
|
-e 's|java.library.path: .*|java.library.path: "${lib.concatStringsSep ":" extraLibraryPaths}"|' \
|
2020-04-24 23:36:52 +00:00
|
|
|
-e 's|storm.log4j2.conf.dir: .*|storm.log4j2.conf.dir: "conf/log4j2"|' \
|
|
|
|
defaults.yaml
|
2021-02-05 17:12:51 +00:00
|
|
|
${if confFile != "" then "cat ${confFile} >> defaults.yaml" else ""}
|
2020-04-24 23:36:52 +00:00
|
|
|
mv defaults.yaml $out/conf;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# Link to extra jars
|
2020-04-24 23:36:52 +00:00
|
|
|
cd $out/lib;
|
|
|
|
${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars}
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://storm.apache.org";
|
|
|
|
description = "Distributed realtime computation system";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ edwtjo vizanto ];
|
|
|
|
platforms = with platforms; unix;
|
|
|
|
};
|
|
|
|
}
|