Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 78 lines 1.5 kB view raw
1{ lib 2, stdenv 3, fetchFromGitHub 4, wrapQtAppsHook 5, cmake 6, qhull 7, flann 8, boost 9, vtk 10, eigen 11, pkg-config 12, qtbase 13, libusb1 14, libpcap 15, libtiff 16, libXt 17, libpng 18, Cocoa 19, AGL 20, OpenGL 21, config 22, cudaSupport ? config.cudaSupport, cudaPackages 23}: 24 25stdenv.mkDerivation rec { 26 pname = "pcl"; 27 version = "1.13.0"; 28 29 src = fetchFromGitHub { 30 owner = "PointCloudLibrary"; 31 repo = "pcl"; 32 rev = "${pname}-${version}"; 33 sha256 = "sha256-JDiDAmdpwUR3Sff63ehyvetIFXAgGOrI+HEaZ5lURps="; 34 }; 35 36 # remove attempt to prevent (x86/x87-specific) extended precision use 37 # when SSE not detected 38 postPatch = lib.optionalString (!stdenv.hostPlatform.isx86) '' 39 sed -i '/-ffloat-store/d' cmake/pcl_find_sse.cmake 40 ''; 41 42 nativeBuildInputs = [ 43 pkg-config 44 cmake 45 wrapQtAppsHook 46 ] 47 ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; 48 49 buildInputs = [ 50 eigen 51 libusb1 52 libpcap 53 qtbase 54 libXt 55 ] 56 ++ lib.optionals stdenv.isDarwin [ Cocoa AGL ]; 57 58 propagatedBuildInputs = [ 59 boost 60 flann 61 libpng 62 libtiff 63 qhull 64 vtk 65 ]; 66 67 cmakeFlags = lib.optionals stdenv.isDarwin [ 68 "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" 69 ] ++ lib.optionals cudaSupport [ "-DWITH_CUDA=true" ]; 70 71 meta = { 72 homepage = "https://pointclouds.org/"; 73 description = "Open project for 2D/3D image and point cloud processing"; 74 license = lib.licenses.bsd3; 75 maintainers = [ ]; 76 platforms = with lib.platforms; linux ++ darwin; 77 }; 78}