at 18.03-beta 95 lines 3.5 kB view raw
1{ stdenv, fetchurl, writeTextFile, jre, makeWrapper, fontsConf, licenseAccepted ? false }: 2 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 7 8if !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'; 12 '' 13else assert licenseAccepted; 14 15# the installer is very picky and demands 1.7.0.07 16let dotInstall4j = path: writeTextFile { name = "dot-install4j"; text = '' 17 JRE_VERSION ${path} 1 7 0 7 18 JRE_INFO ${path} 94 19 ''; }; 20 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 26 sys.languageId=en 27 sys.component.Load\ Generator$Boolean=true 28 sys.installationTypeId=Controller 29 sys.installationDir=INSTALLDIR/lib/neoload 30 sys.symlinkDir=INSTALLDIR/bin 31 ''; }; 32 33in stdenv.mkDerivation rec { 34 name = "neoload-4.1.4"; 35 36 src = fetchurl ( 37 if stdenv.system == "x86_64-linux" then 38 { url = http://neoload.installers.neotys.com/documents/download/neoload/v4.1/neoload_4_1_4_linux_x64.sh; 39 sha256 = "199jcf5a0nwfm8wfld2rcjgq64g91vvz2bkmki8dxfzf1yasifcd"; } 40 else 41 { url = http://neoload.installers.neotys.com/documents/download/neoload/v4.1/neoload_4_1_4_linux_x86.sh; 42 sha256 = "1z66jiwcxixsqqwa0f4q8m2p5kna4knq6lic8y8l74dgv25mw912"; } ); 43 44 buildInputs = [ makeWrapper ]; 45 phases = [ "installPhase" ]; 46 47 # TODO: load generator / monitoring agent only builds 48 49 installPhase = '' 50 mkdir -p $out/lib/neoload 51 52 # the installer wants to use its internal JRE 53 # disable this. The extra spaces are needed because the installer carries 54 # a binary payload, so should not change in size 55 sed -e 's/^if \[ -f jre.tar.gz/if false /' $src > installer 56 chmod a+x installer 57 58 cp ${dotInstall4j jre} .install4j 59 chmod u+w .install4j 60 61 sed -e "s|INSTALLDIR|$out|" ${responseVarfile} > response.varfile 62 63 export HOME=`pwd` 64 export INSTALL4J_JAVA_HOME=${jre.home} 65 export FONTCONFIG_FILE=${fontsConf} 66 bash -ic './installer -q -varfile response.varfile' 67 68 sed -i 's/Xmx450m/Xmx900m/;s/Xss192k/Xss384k/' $out/lib/neoload/conf/agent.properties 69 70 for i in $out/bin/*; do 71 wrapProgram $i --run 'cp ${dotInstall4j "${jre.home}/jre"} ~/.install4j' \ 72 --run 'chmod u+w ~/.install4j' 73 done 74 75 mkdir -p $out/share/applications 76 for i in $out/lib/neoload/*.desktop; do 77 name=$(basename "$i") 78 sed -e 's|/lib/neoload/bin|/bin|' "$i" > "$out/share/applications/$name" 79 done 80 rm -r $out/lib/neoload/*.desktop $out/lib/neoload/uninstall 81 82 ''; 83 84 meta = { 85 description = "Load testing software for Web applications to realistically simulate user activity and analyze server behavior"; 86 87 homepage = https://www.neotys.com/product/overview-neoload.html; 88 89 # https://www.neotys.com/documents/legal/eula/neoload/eula_en.html 90 license = stdenv.lib.licenses.unfree; 91 92 maintainers = [ stdenv.lib.maintainers.bluescreen303 ]; 93 platforms = [ "i686-linux" "x86_64-linux" ]; 94 }; 95}