Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a0943687d2a5094a6d92f25a4b6e16a76b5b7
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

109 lines
2.9 KiB
Nix

{
lib,
stdenv,
fetchurl,
makeWrapper,
libX11,
libXext,
libXrandr,
freetype,
fontconfig,
libXrender,
libXinerama,
autoPatchelfHook,
libglvnd,
openal,
imagemagick,
makeDesktopItem,
}:
let
version = "4.0";
arch =
if stdenv.hostPlatform.system == "x86_64-linux" then
"x64"
else if stdenv.hostPlatform.system == "i686-linux" then
"x86"
else
throw "Unsupported platform ${stdenv.hostPlatform.system}";
desktopItem = makeDesktopItem {
name = "Heaven";
exec = "heaven";
genericName = "A GPU Stress test tool from the UNIGINE";
icon = "Heaven";
desktopName = "Heaven Benchmark";
};
in
stdenv.mkDerivation {
pname = "unigine-heaven";
inherit version;
src = fetchurl {
url = "https://assets.unigine.com/d/Unigine_Heaven-${version}.run";
sha256 = "19rndwwxnb9k2nw9h004hyrmr419471s0fp25yzvvc6rkd521c0v";
};
installPhase = ''
sh $src --target $name
mkdir -p $out/lib/unigine/heaven/bin
mkdir -p $out/bin
mkdir -p $out/share/applications/
mkdir -p $out/share/icons/hicolor
install -m 0755 $name/bin/browser_${arch} $out/lib/unigine/heaven/bin
install -m 0755 $name/bin/libApp{Stereo,Surround,Wall}_${arch}.so $out/lib/unigine/heaven/bin
install -m 0755 $name/bin/libGPUMonitor_${arch}.so $out/lib/unigine/heaven/bin
install -m 0755 $name/bin/libQt{Core,Gui,Network,WebKit,Xml}Unigine_${arch}.so.4 $out/lib/unigine/heaven/bin
install -m 0755 $name/bin/libUnigine_${arch}.so $out/lib/unigine/heaven/bin
install -m 0755 $name/bin/heaven_${arch} $out/lib/unigine/heaven/bin
install -m 0755 $name/heaven $out/bin/heaven
cp -R $name/data $name/documentation $out/lib/unigine/heaven
wrapProgram $out/bin/heaven --prefix LD_LIBRARY_PATH : ${libglvnd}/lib:$out/bin:${openal}/lib --run "cd $out/lib/unigine/heaven/"
convert $out/lib/unigine/heaven/data/launcher/icon.png -resize 128x128 $out/share/icons/Heaven.png
for RES in 16 24 32 48 64 128 256
do
mkdir -p $out/share/icons/hicolor/"$RES"x"$RES"/apps
convert $out/lib/unigine/heaven/data/launcher/icon.png -resize "$RES"x"$RES" $out/share/icons/hicolor/"$RES"x"$RES"/apps/Heaven.png
done
ln -s ${desktopItem}/share/applications/* $out/share/applications
'';
nativeBuildInputs = [
autoPatchelfHook
makeWrapper
imagemagick
];
buildInputs = [
libX11
stdenv.cc.cc
libXext
libXrandr
freetype
fontconfig
libXrender
libXinerama
];
dontUnpack = true;
meta = {
description = "Unigine Heaven GPU benchmarking tool";
homepage = "https://benchmark.unigine.com/heaven";
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.BarinovMaxim ];
platforms = [
"x86_64-linux"
"i686-linux"
];
mainProgram = "heaven";
};
}