mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
79 lines
1.5 KiB
Nix
79 lines
1.5 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, wrapQtAppsHook
|
|
, cmake
|
|
, qhull
|
|
, flann
|
|
, boost
|
|
, vtk
|
|
, eigen
|
|
, pkg-config
|
|
, qtbase
|
|
, libusb1
|
|
, libpcap
|
|
, libtiff
|
|
, libXt
|
|
, libpng
|
|
, Cocoa
|
|
, AGL
|
|
, OpenGL
|
|
, config
|
|
, cudaSupport ? config.cudaSupport, cudaPackages
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "pcl";
|
|
version = "1.13.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "PointCloudLibrary";
|
|
repo = "pcl";
|
|
rev = "${pname}-${version}";
|
|
sha256 = "sha256-JDiDAmdpwUR3Sff63ehyvetIFXAgGOrI+HEaZ5lURps=";
|
|
};
|
|
|
|
# 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 = [
|
|
pkg-config
|
|
cmake
|
|
wrapQtAppsHook
|
|
]
|
|
++ lib.optionals cudaSupport [ cudaPackages.cuda_nvcc ];
|
|
|
|
buildInputs = [
|
|
eigen
|
|
libusb1
|
|
libpcap
|
|
qtbase
|
|
libXt
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa AGL ];
|
|
|
|
propagatedBuildInputs = [
|
|
boost
|
|
flann
|
|
libpng
|
|
libtiff
|
|
qhull
|
|
vtk
|
|
];
|
|
|
|
cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [
|
|
"-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
|
|
] ++ lib.optionals cudaSupport [ "-DWITH_CUDA=true" ];
|
|
|
|
meta = {
|
|
homepage = "https://pointclouds.org/";
|
|
description = "Open project for 2D/3D image and point cloud processing";
|
|
license = lib.licenses.bsd3;
|
|
maintainers = [ ];
|
|
platforms = with lib.platforms; linux ++ darwin;
|
|
};
|
|
}
|