about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2019-09-25 09:52:52 +0100
committerGitHub <noreply@github.com>2019-09-25 09:52:52 +0100
commit0802e5715a5776e739237b9f884c7302c188f5ab (patch)
tree2defc9116cdfe6dc58e6fc674d26f48baada210b
parent08a1aa4e6ae531c5114397f7991620872e1041b2 (diff)
parent3848206bd22fc2e5ba1aa04389ae0517dfacb80c (diff)
downloadnixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar.gz
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar.bz2
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar.lz
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar.xz
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.tar.zst
nixlib-0802e5715a5776e739237b9f884c7302c188f5ab.zip
IPMIView: 2.14.0 --> 2.16.0, fix iKVM console (#69406)
 IPMIView: 2.14.0 --> 2.16.0, fix iKVM console
-rw-r--r--pkgs/applications/misc/ipmiview/default.nix87
1 files changed, 63 insertions, 24 deletions
diff --git a/pkgs/applications/misc/ipmiview/default.nix b/pkgs/applications/misc/ipmiview/default.nix
index 64e0f0d325b5..e46df5d59e0e 100644
--- a/pkgs/applications/misc/ipmiview/default.nix
+++ b/pkgs/applications/misc/ipmiview/default.nix
@@ -1,33 +1,72 @@
-{ stdenv, fetchurl, patchelf, makeWrapper, xorg, gcc, gcc-unwrapped }:
+{ stdenv
+, fetchurl
+, makeDesktopItem
+, makeWrapper
+, patchelf
+, fontconfig
+, freetype
+, gcc
+, gcc-unwrapped
+, iputils
+, psmisc
+, xorg }:
 
 stdenv.mkDerivation rec {
-   pname = "IPMIView";
-   version = "2.14.0";
-   buildVersion = "180213";
+  pname = "IPMIView";
+  version = "2.16.0";
+  buildVersion = "190815";
 
-   src = fetchurl {
-    url = "ftp://ftp.supermicro.com/utility/IPMIView/Linux/IPMIView_${version}_build.${buildVersion}_bundleJRE_Linux_x64.tar.gz";
-    sha256 = "1wp22wm7smlsb25x0cck4p660cycfczxj381930crd1qrf68mw4h";
+  src = fetchurl {
+    url = "https://www.supermicro.com/wftp/utility/IPMIView/Linux/IPMIView_${version}_build.${buildVersion}_bundleJRE_Linux_x64.tar.gz";
+    sha256 = "0qw9zfnj0cyvab7ndamlw2y0gpczjhh1jkz8340kl42r2xmhkvpl";
   };
 
-   nativeBuildInputs = [ patchelf makeWrapper ];
+  nativeBuildInputs = [ patchelf makeWrapper ];
+  buildPhase = with xorg;
+    let
+      stunnelBinary = if stdenv.hostPlatform.system == "x86_64-linux" then "linux/stunnel64"
+      else if stdenv.hostPlatform.system == "i686-linux" then "linux/stunnel32"
+      else throw "IPMIView is not supported on this platform";
+    in
+  ''
+    patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libX11 libXext libXrender libXtst libXi ]}" ./jre/lib/amd64/libawt_xawt.so
+    patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ freetype ]}" ./jre/lib/amd64/libfontmanager.so
+    patchelf --set-rpath "${gcc-unwrapped.lib}/lib" ./libiKVM64.so
+    patchelf --set-rpath "${gcc.cc}/lib:$out/jre/lib/amd64/jli" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/java
+    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./BMCSecurity/${stunnelBinary}
+  '';
 
-   buildPhase = with xorg; ''
-     patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libX11 libXext libXrender libXtst libXi ]}" ./jre/lib/amd64/xawt/libmawt.so
-     patchelf --set-rpath "${gcc-unwrapped.lib}/lib" ./libiKVM64.so
-     patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libXcursor libX11 libXext libXrender libXtst libXi ]}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/javaws
-     patchelf --set-rpath "${gcc.cc}/lib:$out/jre/lib/amd64/jli" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/java
-   '';
+  desktopItem = makeDesktopItem rec {
+    name = "IPMIView";
+    exec = "IPMIView";
+    desktopName = name;
+    genericName = "Supermicro BMC manager";
+    categories = "Network;Configuration";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -R . $out/
 
-   installPhase = ''
-     mkdir -p $out/bin
-     cp -R . $out/
-     makeWrapper $out/jre/bin/java $out/bin/IPMIView \
-       --prefix PATH : "$out/jre/bin" \
-       --add-flags "-jar $out/IPMIView20.jar"
-   '';
+    ln -s ${desktopItem}/share $out/share
 
-   meta = with stdenv.lib; {
+    # LD_LIBRARY_PATH: fontconfig is used from java code
+    # PATH: iputils is used for ping, and psmisc is for killall
+    # WORK_DIR: unfortunately the ikvm related binaries are loaded from
+    #           and user configuration is written to files in the CWD
+    makeWrapper $out/jre/bin/java $out/bin/IPMIView \
+      --set LD_LIBRARY_PATH "${stdenv.lib.makeLibraryPath [ fontconfig ]}" \
+      --prefix PATH : "$out/jre/bin:${iputils}/bin:${psmisc}/bin" \
+      --add-flags "-jar $out/IPMIView20.jar" \
+      --run 'WORK_DIR=''${XDG_DATA_HOME:-~/.local/share}/ipmiview
+             mkdir -p $WORK_DIR
+             ln -snf '$out'/iKVM.jar '$out'/libiKVM* '$out'/libSharedLibrary* $WORK_DIR
+             cd $WORK_DIR'
+  '';
+
+  meta = with stdenv.lib; {
     license = licenses.unfree;
-   };
-  }
+    maintainers = with maintainers; [ vlaci ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+}