diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:36 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-01-07 02:18:47 +0000 |
commit | 36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch) | |
tree | b3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/servers/computing/storm/default.nix | |
parent | 4e31070265257dc67d120c27e0f75c2344fdfa9a (diff) | |
parent | abf060725d7614bd3b9f96764262dfbc2f9c2199 (diff) | |
download | nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2 nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip |
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/servers/computing/storm/default.nix')
-rw-r--r-- | nixpkgs/pkgs/servers/computing/storm/default.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/computing/storm/default.nix b/nixpkgs/pkgs/servers/computing/storm/default.nix new file mode 100644 index 000000000000..8335e40de98f --- /dev/null +++ b/nixpkgs/pkgs/servers/computing/storm/default.nix @@ -0,0 +1,65 @@ +{ stdenv, lib, fetchurl, zip, unzip +, jzmq, jdk, python +, confFile ? "", extraLibraryPaths ? [], extraJars ? [] }: + +stdenv.mkDerivation rec { + name = "apache-storm-" + version; + version = "1.2.1"; + src = fetchurl { + url = + "mirror://apache/storm/${name}/${name}.tar.gz"; + sha256 = "177dqgbviagrpvalg8h67mwiwwgmiqsg0hh97hcqqcjg71ypnjkv"; + }; + + buildInputs = [ zip unzip jzmq ]; + + installPhase = '' + mkdir -p $out/share/${name} + mv public $out/docs + mv examples $out/share/${name}/. + + rm -f lib/jzmq* || exit 1 + 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 + # 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 $out/conf; + + # Link to jzmq jar and extra jars + cd $out/lib; + ln -s ${jzmq}/share/java/*.jar; + ${lib.concatMapStrings (jar: "ln -s ${jar};\n") extraJars} + ''; + + dontStrip = true; + + meta = with stdenv.lib; { + homepage = http://storm.apache.org; + description = "Distributed realtime computation system"; + license = licenses.asl20; + maintainers = with maintainers; [ edwtjo vizanto ]; + platforms = with platforms; unix; + }; +} |