2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip2, fixDarwinDylibNames }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-01-13 20:06:32 +00:00
|
|
|
pname = "libLAS";
|
|
|
|
version = "1.8.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-01-13 20:06:32 +00:00
|
|
|
url = "https://download.osgeo.org/liblas/libLAS-${version}.tar.bz2";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = [ boost gdal libgeotiff libtiff LASzip2 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DGDAL_CONFIG=${gdal}/bin/gdal-config"
|
|
|
|
"-DWITH_LASZIP=ON"
|
2020-07-18 16:06:22 +00:00
|
|
|
# libLAS is currently not compatible with LASzip 3,
|
|
|
|
# see https://github.com/libLAS/libLAS/issues/144.
|
|
|
|
"-DLASZIP_INCLUDE_DIR=${LASzip2}/include"
|
2020-04-24 23:36:52 +00:00
|
|
|
"-DCMAKE_EXE_LINKER_FLAGS=-pthread"
|
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isDarwin ''
|
2020-04-24 23:36:52 +00:00
|
|
|
install_name_tool -change "@rpath/liblas.3.dylib" "$out/lib/liblas.3.dylib" $out/lib/liblas_c.dylib
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset";
|
|
|
|
homepage = "https://liblas.org";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.bsd3;
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
maintainers = [ lib.maintainers.michelk ];
|
2022-12-17 10:02:37 +00:00
|
|
|
# never built on aarch64-darwin since first introduction in nixpkgs
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|