2024-06-20 14:57:18 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, boost, cmake, libgeotiff, libtiff, laszip_2, 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";
|
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "aarch64-darwin.patch";
|
|
|
|
url = "https://github.com/libLAS/libLAS/commit/ded463732db1f9baf461be6f3fe5b8bb683c41cd.patch";
|
|
|
|
sha256 = "sha256-aWMpazeefDHE9OzuLR3FJ8+oXeGhEsk1igEm6j2DUnw=";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-build-with-boost-1.73-1.patch";
|
|
|
|
url = "https://github.com/libLAS/libLAS/commit/af431abce95076b59f4eb7c6ef0930ca57c8a063.patch";
|
|
|
|
hash = "sha256-2lr028t5hq3oOLZFXnvIJXCUsoVHbG/Mus93OZvi5ZU=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fix-build-with-boost-1.73-2.patch";
|
|
|
|
url = "https://github.com/libLAS/libLAS/commit/0d3b8d75f371a6b7c605bbe5293091cb64a7e2d3.patch";
|
|
|
|
hash = "sha256-gtNIazR+l1h+Xef+4qQc7EVi+Nlht3F8CrwkINothtA=";
|
|
|
|
})
|
2024-01-02 11:29:13 +00:00
|
|
|
# remove on update. fix compile error in apps/las2col.c
|
|
|
|
# https://github.com/libLAS/libLAS/pull/151
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fflush-x2-is-not-an-fsync.patch";
|
|
|
|
url = "https://github.com/libLAS/libLAS/commit/e789d43df4500da0c12d2f6d3ac1d031ed835493.patch";
|
|
|
|
hash = "sha256-0zI0NvOt9C5BPrfAbgU1N1kj3rZFB7rf0KRj7yemyWI=";
|
|
|
|
})
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
|
2024-06-20 14:57:18 +00:00
|
|
|
buildInputs = [ boost libgeotiff libtiff laszip_2 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-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.
|
2024-06-20 14:57:18 +00:00
|
|
|
"-DLASZIP_INCLUDE_DIR=${laszip_2}/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 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|