3
0
Fork 0
forked from mirrors/nixpkgs

pcl: visualization components in darwin

Supplies the necessary frameworks and build system tweaks to build the
vtkWithQt4 components on darwin. This follows on from PRs #14705 and #14749.
This commit is contained in:
Anthony Cowley 2016-04-15 18:13:55 -04:00 committed by Bjørn Forsman
parent ddcf5d3941
commit e4e422aa91
2 changed files with 14 additions and 3 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, fetchzip, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qt4 { stdenv, fetchzip, cmake, qhull, flann, boost, vtk, eigen, pkgconfig, qt4
, libusb1, libpcap, libXt, libpng , libusb1, libpcap, libXt, libpng, Cocoa, AGL, cf-private
}: }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
@ -14,13 +14,22 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true; enableParallelBuilding = true;
buildInputs = [ cmake qhull flann boost eigen pkgconfig libusb1 libpcap buildInputs = [ cmake qhull flann boost eigen pkgconfig libusb1 libpcap
libpng vtk qt4 libXt ]; libpng vtk qt4 libXt ]
++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa AGL cf-private ];
cmakeFlags = stdenv.lib.optionals stdenv.isDarwin [
"-DCMAKE_OSX_SYSROOT=" "-DCMAKE_OSX_DEPLOYMENT_TARGET=" ];
preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
NIX_CFLAGS_COMPILE=$(echo "$NIX_CFLAGS_COMPILE" | sed "s,[[:space:]]*-F$NIX_STORE/[[:alnum:]]*-CF-osx-[[:digit:].]*/Library/Frameworks,,g")
sed -i 's,^\( target_link_libraries("''${LIB_NAME}" "-framework Cocoa")\),\1\n target_link_libraries("''${LIB_NAME}" "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation"),' visualization/CMakeLists.txt
sed -i 's,^\(set(SUBSYS_DEPS common io kdtree geometry search)\),\1\nset(CMAKE_OSX_SYSROOT "")\nset(CMAKE_OSX_DEPLOYMENT_TARGET ""),' visualization/CMakeLists.txt
'';
meta = { meta = {
homepage = http://pointclouds.org/; homepage = http://pointclouds.org/;
description = "Open project for 2D/3D image and point cloud processing"; description = "Open project for 2D/3D image and point cloud processing";
license = stdenv.lib.licenses.bsd3; license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [viric]; maintainers = with stdenv.lib.maintainers; [viric];
platforms = with stdenv.lib.platforms; linux; platforms = with stdenv.lib.platforms; linux ++ darwin;
}; };
} }

View file

@ -8611,6 +8611,8 @@ in
pcl = callPackage ../development/libraries/pcl { pcl = callPackage ../development/libraries/pcl {
vtk = vtkWithQt4; vtk = vtkWithQt4;
inherit (darwin) cf-private;
inherit (darwin.apple_sdk.frameworks) Cocoa AGL;
}; };
pcre = callPackage ../development/libraries/pcre { }; pcre = callPackage ../development/libraries/pcre { };