2020-06-25 18:54:27 +00:00
|
|
|
{ stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip2, fixDarwinDylibNames }:
|
2014-09-23 14:49:48 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2016-11-11 02:54:37 +00:00
|
|
|
name = "libLAS-1.8.1";
|
2014-09-23 14:49:48 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
|
2018-06-28 18:43:35 +00:00
|
|
|
url = "https://download.osgeo.org/liblas/${name}.tar.bz2";
|
2016-11-11 02:54:37 +00:00
|
|
|
sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
|
2014-09-23 14:49:48 +00:00
|
|
|
};
|
|
|
|
|
2020-06-25 18:54:27 +00:00
|
|
|
buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip2 ]
|
2018-04-16 22:08:17 +00:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
|
2014-09-23 14:49:48 +00:00
|
|
|
|
2018-04-16 22:08:17 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DGDAL_CONFIG=${gdal}/bin/gdal-config"
|
2018-04-20 21:15:06 +00:00
|
|
|
"-DWITH_LASZIP=ON"
|
2020-06-25 18:54:27 +00:00
|
|
|
# libLAS is currently not compatible with LASzip 3,
|
|
|
|
# see https://github.com/libLAS/libLAS/issues/144.
|
|
|
|
"-DLASZIP_INCLUDE_DIR=${LASzip2}/include"
|
2019-01-24 21:23:22 +00:00
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS=-pthread"
|
2018-04-16 22:08:17 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
install_name_tool -change "@rpath/liblas.3.dylib" "$out/lib/liblas.3.dylib" $out/lib/liblas_c.dylib
|
|
|
|
'';
|
2014-09-23 14:49:48 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://liblas.org";
|
2014-09-23 14:49:48 +00:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2018-04-16 22:08:17 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
2014-09-23 14:49:48 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.michelk ];
|
|
|
|
};
|
|
|
|
}
|