* add liblas

This commit is contained in:
Alexander Baldeck 2021-10-24 20:36:43 +02:00
parent 07ae8d32ac
commit 7c71012bf1
2 changed files with 85 additions and 0 deletions

57
liblas/PKGBUILD Normal file
View File

@ -0,0 +1,57 @@
# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Bruno Pagani <archange@archlinux.org>
pkgname=liblas
pkgver=1.8.1.r120+ge12742f4
pkgrel=6
pkgdesc="C/C++ library for reading and writing the very common LAS LiDAR format"
arch=(x86_64 powerpc64le powerpc)
url="https://liblas.org/"
license=(BSD)
depends=(boost-libs gdal laszip2 libgeotiff proj)
makedepends=(cmake boost git)
#source=(https://download.osgeo.org/liblas/libLAS-${pkgver}.tar.bz2)
#md5sums=('2e6a975dafdf57f59a385ccb87eb5919')
#sha256sums=('9adb4a98c63b461ed2bc82e214ae522cbd809cff578f28511122efe6c7ea4e76')
source=(git+https://github.com/libLAS/libLAS.git#commit=e12742f4152146d3a71f9b2de573257e91736c93
fix-gdal-2.5.patch)
sha256sums=(SKIP c492dd229664c0f1be1a7ca7a7e2df0414a04e2ac89dc5b5ce61463fbe84a6af)
pkgver() {
cd libLAS
git describe --tags | sed 's/^mfoc-//;s/\([^-]*-g\)/r\1/;s/-/./;s/-/+/'
}
prepare() {
cd libLAS
# https://github.com/libLAS/libLAS/issues/164
patch -Np1 -i ../fix-gdal-2.5.patch
# Find our laszip 2.x version
sed -i 's@laszip/@laszip2/@g' cmake/modules/FindLASzip.cmake
sed -i 's@laszip/@laszip2/@g' src/header.cpp
sed -i 's@laszip/@laszip2/@g' src/version.cpp
sed -i 's@laszip/@laszip2/@g' src/detail/zippoint.cpp
sed -i 's@laszip/@laszip2/@g' src/detail/reader/zipreader.cpp
sed -i 's@laszip/@laszip2/@g' src/detail/writer/zipwriter.cpp
}
build() {
#cmake -B build -S libLAS-${pkgver} \
cmake -B build -S libLAS \
-DCMAKE_INSTALL_PREFIX=/usr \
-DWITH_GDAL=True \
-DWITH_GEOTIFF=True \
-DWITH_LASZIP=True \
-DWITH_UTILITIES=True \
-DCMAKE_INSTALL_RPATH=/usr/lib/laszip2 \
-DLASZIP_INCLUDE_DIR=/usr/include \
-DLASZIP_LIBRARY=/usr/lib/laszip2/liblaszip.so \
-G "Unix Makefiles"
make -C build
}
package() {
make -C build DESTDIR="${pkgdir}" install
#install -Dm644 libLAS-${pkgver}/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}
install -Dm644 libLAS/LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}
}

28
liblas/fix-gdal-2.5.patch Normal file
View File

@ -0,0 +1,28 @@
diff --git a/src/gt_wkt_srs.cpp b/src/gt_wkt_srs.cpp
--- a/src/gt_wkt_srs.cpp
+++ b/src/gt_wkt_srs.cpp
@@ -299,7 +299,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
oSRS.SetFromUserInput(pszWKT);
oSRS.SetExtension( "PROJCS", "PROJ4",
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs" );
- oSRS.FixupOrdering();
CPLFree(pszWKT);
pszWKT = NULL;
oSRS.exportToWkt(&pszWKT);
@@ -505,7 +504,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
{
char *pszWKT;
oSRS.morphFromESRI();
- oSRS.FixupOrdering();
if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE )
return pszWKT;
}
@@ -1107,8 +1105,6 @@ char *GTIFGetOGISDefn( GTIF *hGTIF, GTIFDefn * psDefn )
/* ==================================================================== */
char *pszWKT;
- oSRS.FixupOrdering();
-
if( oSRS.exportToWkt( &pszWKT ) == OGRERR_NONE )
return pszWKT;
else