mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-04 14:00:04 +00:00
130 lines
2.6 KiB
Nix
130 lines
2.6 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
config,
|
|
fetchFromGitHub,
|
|
fetchpatch,
|
|
|
|
# nativeBuildInputs
|
|
cmake,
|
|
qt6,
|
|
pkg-config,
|
|
|
|
# buildInputs
|
|
eigen,
|
|
libxt,
|
|
libpcap,
|
|
libusb1,
|
|
llvmPackages,
|
|
nanoflann,
|
|
|
|
# nativeBuildInputs
|
|
boost,
|
|
flann,
|
|
libpng,
|
|
libtiff,
|
|
qhull,
|
|
vtk,
|
|
|
|
gitUpdater,
|
|
|
|
cudaSupport ? config.cudaSupport,
|
|
cudaPackages,
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "pcl";
|
|
version = "1.15.1";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "PointCloudLibrary";
|
|
repo = "pcl";
|
|
tag = "pcl-${finalAttrs.version}";
|
|
hash = "sha256-+KyaajJM0I5CAcr8AiOLC4TkGV3Gm73a0/X8LQWFZMI=";
|
|
};
|
|
|
|
outputs = [
|
|
"out"
|
|
"dev"
|
|
];
|
|
|
|
patches = [
|
|
(fetchpatch {
|
|
# see https://github.com/NixOS/nixpkgs/issues/485826 to be removed at next release after 1.15.1
|
|
name = "boost-1.89.patch";
|
|
url = "https://github.com/PointCloudLibrary/pcl/commit/99333442ac63971297b4cdd05fab9d2bd2ff57a4.patch";
|
|
hash = "sha256-5vg8VjxoAfEOx9n7Tby1DXe1u4rn+zharkefUovLHv0=";
|
|
})
|
|
];
|
|
|
|
strictDeps = true;
|
|
|
|
# remove attempt to prevent (x86/x87-specific) extended precision use
|
|
# when SSE not detected
|
|
postPatch = lib.optionalString (!stdenv.hostPlatform.isx86) ''
|
|
sed -i '/-ffloat-store/d' cmake/pcl_find_sse.cmake
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
cmake
|
|
qt6.wrapQtAppsHook
|
|
pkg-config
|
|
]
|
|
++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ];
|
|
|
|
buildInputs = [
|
|
eigen
|
|
libxt
|
|
libpcap
|
|
qt6.qtbase
|
|
libusb1
|
|
nanoflann
|
|
]
|
|
++ lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
|
|
|
|
propagatedBuildInputs = [
|
|
boost
|
|
flann
|
|
libpng
|
|
libtiff
|
|
qhull
|
|
vtk
|
|
];
|
|
|
|
postInstall = ''
|
|
moveToOutput "share/pcl-*" "$dev"
|
|
'';
|
|
|
|
# PCLConfig.cmake is in dev and needs an absolute path back to the libraries
|
|
postFixup = ''
|
|
substituteInPlace "$dev"/share/pcl-*/PCLConfig.cmake \
|
|
--replace-fail \
|
|
'set(PCL_LIBRARY_DIRS "''${PCL_ROOT}/lib")' \
|
|
"set(PCL_LIBRARY_DIRS \"$out/lib\")"
|
|
'';
|
|
|
|
cmakeFlags = [
|
|
(lib.cmakeBool "BUILD_CUDA" cudaSupport)
|
|
(lib.cmakeBool "BUILD_GPU" cudaSupport)
|
|
(lib.cmakeBool "PCL_ENABLE_MARCHNATIVE" false)
|
|
(lib.cmakeBool "WITH_CUDA" cudaSupport)
|
|
];
|
|
|
|
passthru.updateScript = gitUpdater {
|
|
rev-prefix = "pcl-";
|
|
ignoredVersions = "rc";
|
|
};
|
|
|
|
meta = {
|
|
homepage = "https://pointclouds.org/";
|
|
description = "Open project for 2D/3D image and point cloud processing";
|
|
changelog = "https://github.com/PointCloudLibrary/pcl/blob/pcl-${finalAttrs.version}/CHANGES.md";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = with lib.maintainers; [
|
|
GaetanLepage
|
|
usertam
|
|
];
|
|
platforms = with lib.platforms; linux ++ darwin;
|
|
};
|
|
})
|