Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 72 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 cmake, 6 libGL, 7 libGLU, 8 libXv, 9 libXtst, 10 libXi, 11 libjpeg_turbo, 12 fltk, 13 xorg, 14 opencl-headers, 15 opencl-clhpp, 16 ocl-icd, 17}: 18 19stdenv.mkDerivation rec { 20 pname = "virtualgl-lib"; 21 version = "3.0.2"; 22 23 src = fetchurl { 24 url = "mirror://sourceforge/virtualgl/VirtualGL-${version}.tar.gz"; 25 sha256 = "sha256-OIEbwAQ71yOuHIzM+iaK7QkUJrKg6sXpGuFQOUPjM2w="; 26 }; 27 28 postPatch = '' 29 # the unit tests take significant hacks to build and can't run anyway due to the lack 30 # of a 3D X server in the build sandbox. so we just chop out their build instructions. 31 head -n $(grep -n 'UNIT TESTS' server/CMakeLists.txt | cut -d : -f 1) server/CMakeLists.txt > server/CMakeLists2.txt 32 mv server/CMakeLists2.txt server/CMakeLists.txt 33 ''; 34 35 cmakeFlags = [ 36 "-DVGL_SYSTEMFLTK=1" 37 "-DTJPEG_LIBRARY=${libjpeg_turbo.out}/lib/libturbojpeg.so" 38 ]; 39 40 makeFlags = [ "PREFIX=$(out)" ]; 41 42 nativeBuildInputs = [ cmake ]; 43 44 buildInputs = [ 45 libjpeg_turbo 46 libGL 47 libGLU 48 fltk 49 libXv 50 libXtst 51 libXi 52 xorg.xcbutilkeysyms 53 opencl-headers 54 opencl-clhpp 55 ocl-icd 56 ]; 57 58 fixupPhase = '' 59 substituteInPlace $out/bin/vglrun \ 60 --replace "LD_PRELOAD=libvglfaker" "LD_PRELOAD=$out/lib/libvglfaker" \ 61 --replace "LD_PRELOAD=libdlfaker" "LD_PRELOAD=$out/lib/libdlfaker" \ 62 --replace "LD_PRELOAD=libgefaker" "LD_PRELOAD=$out/lib/libgefaker" 63 ''; 64 65 meta = with lib; { 66 homepage = "https://www.virtualgl.org/"; 67 description = "X11 GL rendering in a remote computer with full 3D hw acceleration"; 68 license = licenses.wxWindows; 69 platforms = platforms.linux; 70 maintainers = with maintainers; [ abbradar ]; 71 }; 72}