1 { lib, stdenv, fetchurl, writeTextFile, jre, makeWrapper, fontsConf, licenseAccepted ? false }:
3 # If you happen to use this software on the XMonad window manager, you will have issues with
4 # grey windows, no resizing, menus not showing and other glitches.
5 # This can be fixed by setting a different WM name:
6 # http://www.haskell.org/haskellwiki/Xmonad/Frequently_asked_questions#Using_SetWMName
8 if !licenseAccepted then throw ''
9 You have to accept the neoload EULA at
10 https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
11 by setting nixpkgs config option 'neoload.accept_license = true';
13 else assert licenseAccepted;
15 # the installer is very picky and demands 1.7.0.07
16 let dotInstall4j = path: writeTextFile { name = "dot-install4j"; text = ''
17 JRE_VERSION ${path} 1 7 0 7
21 responseVarfile = writeTextFile { name = "response.varfile"; text = ''
22 sys.programGroupDisabled$Boolean=false
23 sys.component.Monitor\ Agent$Boolean=true
24 sys.component.Common$Boolean=true
25 sys.component.Controller$Boolean=true
27 sys.component.Load\ Generator$Boolean=true
28 sys.installationTypeId=Controller
29 sys.installationDir=INSTALLDIR/lib/neoload
30 sys.symlinkDir=INSTALLDIR/bin
33 in stdenv.mkDerivation rec {
38 if stdenv.hostPlatform.system == "x86_64-linux" then
39 { url = "http://neoload.installers.neotys.com/documents/download/${pname}/v${lib.versions.majorMinor version}/${pname}_${lib.replaceStrings ["."] ["_"] version}_linux_x64.sh";
40 sha256 = "199jcf5a0nwfm8wfld2rcjgq64g91vvz2bkmki8dxfzf1yasifcd"; }
42 { url = "http://neoload.installers.neotys.com/documents/download/${pname}/v${lib.versions.majorMinor version}/${pname}_${lib.replaceStrings ["."] ["_"] version}_linux_x86.sh";
43 sha256 = "1z66jiwcxixsqqwa0f4q8m2p5kna4knq6lic8y8l74dgv25mw912"; } );
45 nativeBuildInputs = [ makeWrapper ];
46 phases = [ "installPhase" ];
48 # TODO: load generator / monitoring agent only builds
51 mkdir -p $out/lib/neoload
53 # the installer wants to use its internal JRE
54 # disable this. The extra spaces are needed because the installer carries
55 # a binary payload, so should not change in size
56 sed -e 's/^if \[ -f jre.tar.gz/if false /' $src > installer
59 cp ${dotInstall4j jre} .install4j
62 sed -e "s|INSTALLDIR|$out|" ${responseVarfile} > response.varfile
65 export INSTALL4J_JAVA_HOME=${jre.home}
66 export FONTCONFIG_FILE=${fontsConf}
67 bash -ic './installer -q -varfile response.varfile'
69 sed -i 's/Xmx450m/Xmx900m/;s/Xss192k/Xss384k/' $out/lib/neoload/conf/agent.properties
71 for i in $out/bin/*; do
72 wrapProgram $i --run 'cp ${dotInstall4j "${jre.home}/jre"} ~/.install4j' \
73 --run 'chmod u+w ~/.install4j'
76 mkdir -p $out/share/applications
77 for i in $out/lib/neoload/*.desktop; do
79 sed -e 's|/lib/neoload/bin|/bin|' "$i" > "$out/share/applications/$name"
81 rm -r $out/lib/neoload/*.desktop $out/lib/neoload/uninstall
86 description = "Load testing software for Web applications to realistically simulate user activity and analyze server behavior";
88 homepage = "https://www.neotys.com/product/overview-neoload.html";
90 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
91 # https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
92 license = lib.licenses.unfree;
94 maintainers = [ lib.maintainers.bluescreen303 ];
95 platforms = [ "i686-linux" "x86_64-linux" ];