Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv 2, fetchurl 3, makeDesktopItem 4, makeWrapper 5, patchelf 6, fontconfig 7, freetype 8, gcc 9, gcc-unwrapped 10, iputils 11, psmisc 12, xorg }: 13 14stdenv.mkDerivation rec { 15 pname = "IPMIView"; 16 version = "2.21.0"; 17 buildVersion = "221118"; 18 19 src = fetchurl { 20 url = "https://www.supermicro.com/wftp/utility/IPMIView/Linux/IPMIView_${version}_build.${buildVersion}_bundleJRE_Linux_x64.tar.gz"; 21 hash = "sha256-ZN0vadGbjGj9U2wPqvHLjS9fsk3DNCbXoNvzUfnn8IM="; 22 }; 23 24 nativeBuildInputs = [ patchelf makeWrapper ]; 25 buildPhase = with xorg; 26 let 27 stunnelBinary = if stdenv.hostPlatform.system == "x86_64-linux" then "linux/stunnel64" 28 else if stdenv.hostPlatform.system == "i686-linux" then "linux/stunnel32" 29 else throw "IPMIView is not supported on this platform"; 30 in 31 '' 32 runHook preBuild 33 34 patchelf --set-rpath "${lib.makeLibraryPath [ libX11 libXext libXrender libXtst libXi ]}" ./jre/lib/libawt_xawt.so 35 patchelf --set-rpath "${lib.makeLibraryPath [ freetype ]}" ./jre/lib/libfontmanager.so 36 patchelf --set-rpath "${gcc.cc}/lib:$out/jre/lib/jli" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/java 37 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./BMCSecurity/${stunnelBinary} 38 39 runHook postBuild 40 ''; 41 42 desktopItem = makeDesktopItem rec { 43 name = "IPMIView"; 44 exec = "IPMIView"; 45 desktopName = name; 46 genericName = "Supermicro BMC manager"; 47 categories = [ "Network" ]; 48 }; 49 50 installPhase = '' 51 runHook preInstall 52 53 mkdir -p $out/bin 54 cp -R . $out/ 55 56 ln -s ${desktopItem}/share $out/share 57 58 # LD_LIBRARY_PATH: fontconfig is used from java code 59 # PATH: iputils is used for ping, and psmisc is for killall 60 # WORK_DIR: unfortunately the ikvm related binaries are loaded from 61 # and user configuration is written to files in the CWD 62 makeWrapper $out/jre/bin/java $out/bin/IPMIView \ 63 --set LD_LIBRARY_PATH "${lib.makeLibraryPath [ fontconfig gcc-unwrapped.lib ]}" \ 64 --prefix PATH : "$out/jre/bin:${iputils}/bin:${psmisc}/bin" \ 65 --add-flags "-jar $out/IPMIView20.jar" \ 66 --run 'WORK_DIR=''${XDG_DATA_HOME:-~/.local/share}/ipmiview 67 mkdir -p $WORK_DIR 68 ln -snf '$out'/iKVM.jar '$out'/iKVM_ssl.jar '$out'/libiKVM* '$out'/libSharedLibrary* $WORK_DIR 69 cd $WORK_DIR' 70 71 runHook postInstall 72 ''; 73 74 meta = with lib; { 75 sourceProvenance = with sourceTypes; [ 76 binaryBytecode 77 binaryNativeCode 78 ]; 79 license = licenses.unfree; 80 maintainers = with maintainers; [ vlaci ]; 81 platforms = [ "x86_64-linux" "i686-linux" ]; 82 }; 83}