From 4c11d2d882e1f962afde0ab1471f43c8c2e5739c Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Wed, 8 May 2024 21:57:44 +0200 Subject: [PATCH] add patch to cmake fles to not include liblas-depends.cmake which causes build failure to vtk [release 1.8.1.20240404git.96d4dc9-2mamba;Wed May 08 2024] --- README.md | 2 + ...4dc9-fix-cmake-remove-liblas-depends.patch | 10 ++ ...s-1.8.1.20240404git.96d4dc9-gdal-2.5.patch | 28 +++++ liblas.spec | 118 ++++++++++++++++++ 4 files changed, 158 insertions(+) create mode 100644 liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch create mode 100644 liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch create mode 100644 liblas.spec diff --git a/README.md b/README.md index 8a4d25f..d817d44 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # liblas +C++ library and programs for reading and writing ASPRS LAS format with LiDAR data. + diff --git a/liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch b/liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch new file mode 100644 index 0000000..212875d --- /dev/null +++ b/liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch @@ -0,0 +1,10 @@ +--- libLAS-1.8.1.20240404git.96d4dc9/cmake/liblas-config.cmake.in.orig 2024-05-08 20:10:07.277967001 +0200 ++++ libLAS-1.8.1.20240404git.96d4dc9/cmake/liblas-config.cmake.in 2024-05-08 20:10:37.478033219 +0200 +@@ -24,7 +24,6 @@ + set (libLAS_LIBRARY_DIRS "${PROJECT_ROOT_DIR}/lib") + set (libLAS_BINARY_DIRS "${PROJECT_ROOT_DIR}/bin") + +-include ("${_DIR}/liblas-depends.cmake") + set (libLAS_LIBRARIES las las_c) + + # For backwards compatibility diff --git a/liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch b/liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch new file mode 100644 index 0000000..c7fb075 --- /dev/null +++ b/liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch @@ -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 diff --git a/liblas.spec b/liblas.spec new file mode 100644 index 0000000..9d189e5 --- /dev/null +++ b/liblas.spec @@ -0,0 +1,118 @@ +%define git_commit %(echo %version | cut -d. -f5) +%define git_tag %(echo %version | cut -d. -f1-3) +Name: liblas +Version: 1.8.1.20240404git.96d4dc9 +Release: 2mamba +Summary: C++ library and programs for reading and writing ASPRS LAS format with LiDAR data +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://liblas.org/ +Source: https://github.com/libLAS/libLAS.git/%{git_tag}@%{git_commit}/libLAS-%{version}.tar.bz2 +Patch0: liblas-1.8.1.20240404git.96d4dc9-gdal-2.5.patch +Patch1: liblas-1.8.1.20240404git.96d4dc9-fix-cmake-remove-liblas-depends.patch +License: BSD +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: libboost-devel +BuildRequires: libgcc +BuildRequires: libgdal-devel +BuildRequires: libgeotiff-devel +BuildRequires: libproj-devel +BuildRequires: libstdc++6-devel +BuildRequires: libtiff-devel +## AUTOBUILDREQ-END +BuildRequires: cmake + +%description +C++ library and programs for reading and writing ASPRS LAS format with LiDAR data. + +%package devel +Group: Development/Libraries +Summary: Development files for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description devel +This package contains libraries and header files for developing applications that use %{name}. + +%package tools +Group: Applications/Scientific +Summary: Utility applications for %{name} +Requires: %{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description tools +This package contains utility applications for %{name}. + +%debug_package + +%prep +%setup -q -n libLAS-%{version} +%define _default_patch_fuzz 2 +%patch 0 -p1 -b .gdal-2.5 +%patch 1 -p1 + +%build +%cmake \ + -DCMAKE_CXX_FLAGS="-std=gnu++11" \ + -DLIBLAS_LIB_SUBDIR="%{_lib}" \ + -DWITH_GDAL=ON \ + -DWITH_GEOTIFF=ON \ + -DWITH_UTILITIES=ON + +# TODO: +# -DWITH_LASZIP=ON \ +# -DCMAKE_INSTALL_RPATH=/usr/lib/laszip2 \ +# -DLASZIP_INCLUDE_DIR=/usr/include \ +# -DLASZIP_LIBRARY=/usr/lib/laszip2/liblaszip.so \ + +%cmake_build + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" +%cmake_install + +rm -rf %{buildroot}%{_datadir}/liblas/doc + +# Requires pkgconfig(geotiff) which does not exist +rm -f %{buildroot}%{_libdir}/pkgconfig/liblas.pc + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%post -p /sbin/ldconfig +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%{_libdir}/liblas.so.* +%{_libdir}/liblas_c.so.* +%doc AUTHORS LICENSE.txt + +%files devel +%defattr(-,root,root) +%dir %{_includedir}/liblas +%{_includedir}/liblas/* +%{_libdir}/liblas.so +%{_libdir}/liblas_c.so +%dir %{_libdir}/cmake/libLAS +%{_libdir}/cmake/libLAS/liblas-*.cmake + +%files tools +%defattr(-,root,root) +%{_bindir}/las2col +%{_bindir}/las2las +%{_bindir}/las2ogr +%{_bindir}/las2pg +%{_bindir}/las2txt +%{_bindir}/lasblock +%{_bindir}/lasinfo +%{_bindir}/ts2las +%{_bindir}/txt2las + +%changelog +* Wed May 08 2024 Silvan Calarco 1.8.1.20240404git.96d4dc9-2mamba +- add patch to cmake fles to not include liblas-depends.cmake which causes build failure to vtk + +* Mon May 06 2024 Silvan Calarco 1.8.1.20240404git.96d4dc9-1mamba +- package created using the webbuild interface