14 stdenv.mkDerivation rec {
19 url = "https://download.osgeo.org/liblas/libLAS-${version}.tar.bz2";
20 sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
25 name = "aarch64-darwin.patch";
26 url = "https://github.com/libLAS/libLAS/commit/ded463732db1f9baf461be6f3fe5b8bb683c41cd.patch";
27 sha256 = "sha256-aWMpazeefDHE9OzuLR3FJ8+oXeGhEsk1igEm6j2DUnw=";
30 name = "fix-build-with-boost-1.73-1.patch";
31 url = "https://github.com/libLAS/libLAS/commit/af431abce95076b59f4eb7c6ef0930ca57c8a063.patch";
32 hash = "sha256-2lr028t5hq3oOLZFXnvIJXCUsoVHbG/Mus93OZvi5ZU=";
35 name = "fix-build-with-boost-1.73-2.patch";
36 url = "https://github.com/libLAS/libLAS/commit/0d3b8d75f371a6b7c605bbe5293091cb64a7e2d3.patch";
37 hash = "sha256-gtNIazR+l1h+Xef+4qQc7EVi+Nlht3F8CrwkINothtA=";
39 # remove on update. fix compile error in apps/las2col.c
40 # https://github.com/libLAS/libLAS/pull/151
42 name = "fflush-x2-is-not-an-fsync.patch";
43 url = "https://github.com/libLAS/libLAS/commit/e789d43df4500da0c12d2f6d3ac1d031ed835493.patch";
44 hash = "sha256-0zI0NvOt9C5BPrfAbgU1N1kj3rZFB7rf0KRj7yemyWI=";
48 # Disable setting of C++98 standard which was dropped in boost 1.84.0
50 substituteInPlace CMakeLists.txt \
51 --replace-fail 'set(CMAKE_CXX_FLAGS "''${CMAKE_CXX_FLAGS} -std=c++98 -ansi")' '#'
54 nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
64 # libLAS is currently not compatible with LASzip 3,
65 # see https://github.com/libLAS/libLAS/issues/144.
66 "-DLASZIP_INCLUDE_DIR=${laszip_2}/include"
67 "-DCMAKE_EXE_LINKER_FLAGS=-pthread"
70 postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
71 install_name_tool -change "@rpath/liblas.3.dylib" "$out/lib/liblas.3.dylib" $out/lib/liblas_c.dylib
75 description = "LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset";
76 homepage = "https://liblas.org";
77 license = licenses.bsd3;
78 platforms = platforms.unix;
79 maintainers = with maintainers; teams.geospatial.members ++ [ lib.maintainers.michelk ];