#-*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           cmake   1.1
PortGroup           github  1.0
PortGroup           boost   1.0

github.setup        libLAS libLAS 0756b73ed41211d1bb8d9b96c6767f2350d8fe2b
github.tarball_from archive
version             1.8.1-20251108
revision            0
checksums           rmd160  11a9be43477b7afba465f6cd62ec9e4a006bd169 \
                    sha256  72d0e479c8381ad7f0a072082fab28b9ff5089b1e4fbaeca376cf0ae10be4b9a \
                    size    10744329

name                liblas
license             BSD
categories          gis
maintainers         nomaintainer
description         LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset

long_description \
    libLAS is a C/C++ library for reading and writing the very common LAS \
    LiDAR format. The ASPRS LAS format is a sequential binary format used to \
    store data from LiDAR sensors and by LiDAR processing software for data \
    interchange and archival.

homepage            https://liblas.org/

compiler.cxx_standard \
                    2014

patchfiles          patch-apps_CMakeLists.txt.diff

post-patch {
    reinplace "s|c++11|c++14|g" CMakeLists.txt
    reinplace "s|CMAKE_CXX_STANDARD 11|CMAKE_CXX_STANDARD 14|g" CMakeLists.txt
}

configure.args-append \
                    -DPROJ4_INCLUDE_DIR=${prefix}/lib/proj9 \
                    -DPROJ4_LIBRARY=${prefix}/lib/proj9 \
                    -DWITH_GDAL=ON \
                    -DWITH_GEOTIFF=ON \
                    -DWITH_LASZIP=OFF

configure.env-append \
                    GDAL_HOME=${prefix}

boost.version       1.81
depends_lib-append  port:gdal \
                    port:libgeotiff \
                    port:proj \
                    port:tiff \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:zlib \
                    port:laszip
