nixpkgs/pkgs/tools/X11/virtualgl/lib.nix
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 b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

73 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchurl,
cmake,
libGL,
libGLU,
libXv,
libXtst,
libXi,
libjpeg_turbo,
fltk,
xorg,
opencl-headers,
opencl-clhpp,
ocl-icd,
}:
stdenv.mkDerivation rec {
pname = "virtualgl-lib";
version = "3.0.2";
src = fetchurl {
url = "mirror://sourceforge/virtualgl/VirtualGL-${version}.tar.gz";
sha256 = "sha256-OIEbwAQ71yOuHIzM+iaK7QkUJrKg6sXpGuFQOUPjM2w=";
};
postPatch = ''
# the unit tests take significant hacks to build and can't run anyway due to the lack
# of a 3D X server in the build sandbox. so we just chop out their build instructions.
head -n $(grep -n 'UNIT TESTS' server/CMakeLists.txt | cut -d : -f 1) server/CMakeLists.txt > server/CMakeLists2.txt
mv server/CMakeLists2.txt server/CMakeLists.txt
'';
cmakeFlags = [
"-DVGL_SYSTEMFLTK=1"
"-DTJPEG_LIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so"
];
makeFlags = [ "PREFIX=$(out)" ];
nativeBuildInputs = [ cmake ];
buildInputs = [
libjpeg_turbo
libGL
libGLU
fltk
libXv
libXtst
libXi
xorg.xcbutilkeysyms
opencl-headers
opencl-clhpp
ocl-icd
];
fixupPhase = ''
substituteInPlace $out/bin/vglrun \
--replace "LD_PRELOAD=libvglfaker" "LD_PRELOAD=$out/lib/libvglfaker" \
--replace "LD_PRELOAD=libdlfaker" "LD_PRELOAD=$out/lib/libdlfaker" \
--replace "LD_PRELOAD=libgefaker" "LD_PRELOAD=$out/lib/libgefaker"
'';
meta = with lib; {
homepage = "http://www.virtualgl.org/";
description = "X11 GL rendering in a remote computer with full 3D hw acceleration";
license = licenses.wxWindows;
platforms = platforms.linux;
maintainers = with maintainers; [ abbradar ];
};
}