Skip to content

Instantly share code, notes, and snippets.

@Informatic
Created June 14, 2019 21:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Informatic/27357fe7037a2944d7ed31504d327345 to your computer and use it in GitHub Desktop.
Save Informatic/27357fe7037a2944d7ed31504d327345 to your computer and use it in GitHub Desktop.
{ stdenv, fetchurl, patchelf, makeWrapper, xorg, gcc, gcc-unwrapped, freetype, fontconfig, liberation_ttf }:
stdenv.mkDerivation rec {
name = "IPMIView-${version}";
version = "2.16.0";
buildVersion = "190528";
src = fetchurl {
url = "https://www.supermicro.com/wftp/utility/IPMIView/Linux/IPMIView_${version}_build.${buildVersion}_bundleJRE_Linux_x64.tar.gz";
sha256 = "0pz4q8vsnv6wqpiy6am333c2cgsdjmxc6w9vm4hi8qyaavfbq0w2";
};
nativeBuildInputs = [ patchelf makeWrapper ];
buildInputs = [ liberation_ttf fontconfig freetype ];
buildPhase = with xorg; ''
patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ libX11 libXext libXrender libXtst libXi freetype fontconfig liberation_ttf]}" ./jre/lib/amd64/libawt_xawt.so
patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ freetype fontconfig liberation_ttf ]}" ./jre/lib/amd64/libfontmanager.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 "${stdenv.lib.makeLibraryPath [ libXcursor libX11 libXext libXrender libXtst libXi fontconfig freetype liberation_ttf ]}:${gcc.cc}/lib:$out/jre/lib/amd64/jli" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" ./jre/bin/java
'';
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"
'';
meta = with stdenv.lib; {
license = licenses.unfree;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment