Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 100 lines 1.9 kB view raw
1{ 2 lib, 3 stdenv, 4 config, 5 fetchFromGitHub, 6 7 # nativeBuildInputs 8 cmake, 9 libsForQt5, 10 pkg-config, 11 12 # buildInputs 13 eigen, 14 libXt, 15 libpcap, 16 libusb1, 17 llvmPackages, 18 19 # nativeBuildInputs 20 boost, 21 flann, 22 libpng, 23 libtiff, 24 qhull, 25 vtk, 26 27 gitUpdater, 28 29 cudaSupport ? config.cudaSupport, 30 cudaPackages, 31}: 32 33stdenv.mkDerivation (finalAttrs: { 34 pname = "pcl"; 35 version = "1.15.0"; 36 37 src = fetchFromGitHub { 38 owner = "PointCloudLibrary"; 39 repo = "pcl"; 40 tag = "pcl-${finalAttrs.version}"; 41 hash = "sha256-UCuQMWGwe+YxeGj0Y6m5IT58NW2lAWN5RqyZnvyFSr4="; 42 }; 43 44 strictDeps = true; 45 46 # remove attempt to prevent (x86/x87-specific) extended precision use 47 # when SSE not detected 48 postPatch = lib.optionalString (!stdenv.hostPlatform.isx86) '' 49 sed -i '/-ffloat-store/d' cmake/pcl_find_sse.cmake 50 ''; 51 52 nativeBuildInputs = [ 53 cmake 54 libsForQt5.wrapQtAppsHook 55 pkg-config 56 ] 57 ++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ]; 58 59 buildInputs = [ 60 eigen 61 libXt 62 libpcap 63 libsForQt5.qtbase 64 libusb1 65 ] 66 ++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; 67 68 propagatedBuildInputs = [ 69 boost 70 flann 71 libpng 72 libtiff 73 qhull 74 vtk 75 ]; 76 77 cmakeFlags = [ 78 (lib.cmakeBool "BUILD_CUDA" cudaSupport) 79 (lib.cmakeBool "BUILD_GPU" cudaSupport) 80 (lib.cmakeBool "PCL_ENABLE_MARCHNATIVE" false) 81 (lib.cmakeBool "WITH_CUDA" cudaSupport) 82 ]; 83 84 passthru.updateScript = gitUpdater { 85 rev-prefix = "pcl-"; 86 ignoredVersions = "rc"; 87 }; 88 89 meta = { 90 homepage = "https://pointclouds.org/"; 91 description = "Open project for 2D/3D image and point cloud processing"; 92 changelog = "https://github.com/PointCloudLibrary/pcl/blob/pcl-${finalAttrs.version}/CHANGES.md"; 93 license = lib.licenses.bsd3; 94 maintainers = with lib.maintainers; [ 95 GaetanLepage 96 usertam 97 ]; 98 platforms = with lib.platforms; linux ++ darwin; 99 }; 100})