nixpkgs/pkgs/development/tools/neoload/default.nix

94 lines
3.3 KiB
Nix
Raw Normal View History

2012-11-26 14:44:13 +01:00
{ stdenv, fetchurl, writeTextFile, jre, makeWrapper, licenseAccepted ? false }:
2012-11-18 12:37:10 +01:00
2012-11-18 18:27:07 +01:00
# If you happen to use this software on the XMonad window manager, you will have issues with
# grey windows, no resizing, menus not showing and other glitches.
# This can be fixed by setting a different WM name:
# http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#Using_SetWMName
if !licenseAccepted then throw ''
You have to accept the neoload EULA at
https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
by setting nixpkgs config option 'neoload.accept_license = true';
''
else assert licenseAccepted;
2012-11-18 12:37:10 +01:00
2012-11-26 14:44:13 +01:00
# the installer is very picky and demands 1.7.0.07
2012-11-18 12:37:10 +01:00
let dotInstall4j = writeTextFile { name = "dot-install4j"; text = ''
2012-11-26 14:44:13 +01:00
JRE_VERSION ${jre} 1 7 0 7
JRE_INFO ${jre} 94
2012-11-18 12:37:10 +01:00
''; };
2012-11-18 18:27:07 +01:00
responseVarfile = writeTextFile { name = "response.varfile"; text = ''
2012-11-18 12:37:10 +01:00
sys.programGroupDisabled$Boolean=false
sys.component.Monitor\ Agent$Boolean=true
sys.component.Common$Boolean=true
sys.component.Controller$Boolean=true
sys.languageId=en
sys.component.Load\ Generator$Boolean=true
sys.installationTypeId=Controller
sys.installationDir=INSTALLDIR/lib/neoload
sys.symlinkDir=INSTALLDIR/bin
2012-11-18 18:27:07 +01:00
''; };
2012-11-18 12:37:10 +01:00
in stdenv.mkDerivation rec {
2013-05-12 13:56:53 +02:00
name = "neoload-4.1.2";
2012-11-18 12:37:10 +01:00
src = fetchurl (
if stdenv.system == "x86_64-linux" then
2013-05-12 13:56:53 +02:00
{ url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_2_linux_x64.sh;
sha256 = "10r1dg2a37lhimy9r9sax01ljp09cas9irfygc7qa0g15hll1s84"; }
2012-11-18 12:37:10 +01:00
else
2013-05-12 13:56:53 +02:00
{ url = http://www.neotys.com/documents/download/neoload/v4.1/neoload_4_1_2_linux_x86.sh;
sha256 = "00b2qf5jx9na4n6c7fv7v7r59w1iwm8sfmz1gb5ljqa1s7sa777a"; } );
2012-11-18 12:37:10 +01:00
buildInputs = [ makeWrapper ];
phases = [ "installPhase" ];
# TODO: load generator / monitoring agent only builds
installPhase = ''
2012-11-26 14:44:13 +01:00
mkdir -p $out/lib/neoload
ln -s ${jre} $out/lib/neoload/jre
2012-11-18 12:37:10 +01:00
# the installer wants to use its internal JRE
# disable this. The extra spaces are needed because the installer carries
# a binary payload, so should not change in size
sed -e 's/^if \[ -f jre.tar.gz/if false /' $src > installer
chmod a+x installer
cp ${dotInstall4j} .install4j
chmod u+w .install4j
sed -e "s|INSTALLDIR|$out|" ${responseVarfile} > response.varfile
export HOME=`pwd`
2012-11-26 14:44:13 +01:00
export INSTALL4J_JAVA_HOME=${jre}
bash -ic './installer -q -varfile response.varfile'
2012-11-18 12:37:10 +01:00
for i in $out/bin/*; do
wrapProgram $i --run 'cp ${dotInstall4j} ~/.install4j' \
--run 'chmod u+w ~/.install4j'
done
mkdir -p $out/share/applications
for i in $out/lib/neoload/*.desktop; do
name=$(basename "$i")
sed -e 's|/lib/neoload/bin|/bin|' "$i" > "$out/share/applications/$name"
done
rm $out/lib/neoload/*.desktop $out/lib/neoload/uninstall
2012-11-18 12:37:10 +01:00
'';
meta = {
description = "load testing software for Web applications to realistically simulate user activity and analyze server behavior";
2012-11-18 12:37:10 +01:00
homepage = https://www.neotys.com/product/overview-neoload.html;
# https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
license = stdenv.lib.licenses.unfree;
2012-11-18 12:37:10 +01:00
maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
platforms = [ "i686-linux" "x86_64-linux" ];
};
}