forked from macports/macports-ports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grass: fix runtime bug with PDAL 2.7.0+
Committed upstream OSGeo/grass@544a780
- Loading branch information
Showing
2 changed files
with
138 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
Addressed upstream: https://github.com/OSGeo/grass/commit/544a78044fb61d74ecac5683268dccbb1320bd38 | ||
|
||
--- configure.orig 2024-03-06 22:24:05 | ||
+++ configure 2024-04-09 10:47:08 | ||
@@ -9378,41 +9378,52 @@ | ||
} | ||
_ACEOF | ||
if ac_fn_cxx_try_link "$LINENO"; then : | ||
- | ||
+ PDAL_LIBS="$PDAL_LIBS" | ||
else | ||
|
||
+ as_fn_error $? "*** Unable to locate suitable (>=1.7.1) PDAL library." "$LINENO" 5 | ||
+ | ||
+fi | ||
+rm -f core conftest.err conftest.$ac_objext \ | ||
+ conftest$ac_exeext conftest.$ac_ext | ||
+ | ||
+ | ||
+$as_echo "#define HAVE_PDAL 1" >>confdefs.h | ||
+ | ||
+ | ||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use PDAL NoFilenameWriter" >&5 | ||
+$as_echo_n "checking whether to use PDAL NoFilenameWriter... " >&6; } | ||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
/* end confdefs.h. */ | ||
-#include <pdal/PointTable.hpp> | ||
- #include <pdal/Streamable.hpp> | ||
- class St:public pdal::Streamable {}; | ||
+#include <pdal/Writer.hpp> | ||
+ class St:public pdal::NoFilenameWriter {}; | ||
int | ||
main () | ||
{ | ||
-pdal::PointTable table; | ||
+ | ||
+ class NFWTest : public pdal::NoFilenameWriter {}; | ||
+ | ||
; | ||
return 0; | ||
} | ||
_ACEOF | ||
if ac_fn_cxx_try_link "$LINENO"; then : | ||
- PDAL_LIBS="$PDAL_LIBS" | ||
-else | ||
|
||
- as_fn_error $? "*** Unable to locate suitable (>=1.7.1) PDAL library." "$LINENO" 5 | ||
|
||
-fi | ||
-rm -f core conftest.err conftest.$ac_objext \ | ||
- conftest$ac_exeext conftest.$ac_ext | ||
+$as_echo "#define HAVE_PDAL_NOFILENAMEWRITER 1" >>confdefs.h | ||
+ | ||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 | ||
+$as_echo "yes" >&6; } | ||
|
||
+else | ||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 | ||
+$as_echo "no" >&6; } | ||
fi | ||
rm -f core conftest.err conftest.$ac_objext \ | ||
conftest$ac_exeext conftest.$ac_ext | ||
+ | ||
LIBS=${ac_save_libs} | ||
CFLAGS=${ac_save_cflags} | ||
- | ||
- | ||
-$as_echo "#define HAVE_PDAL 1" >>confdefs.h | ||
- | ||
fi | ||
|
||
|
||
--- configure.ac.orig 2024-03-06 22:24:05 | ||
+++ configure.ac 2024-04-09 10:39:46 | ||
@@ -1058,18 +1058,26 @@ | ||
LIBS="$LIBS $PDAL_LIBS" | ||
CFLAGS="$CFLAGS $PDAL_CFLAGS" | ||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pdal/PointTable.hpp> | ||
- #include <pdal/Streamable.hpp> | ||
- class St:public pdal::Streamable {};]], [[pdal::PointTable table;]])],[],[ | ||
- AC_TRY_LINK([#include <pdal/PointTable.hpp> | ||
#include <pdal/Streamable.hpp> | ||
- class St:public pdal::Streamable {};],[pdal::PointTable table;],PDAL_LIBS="$PDAL_LIBS",[ | ||
+ class St:public pdal::Streamable {};]], [[pdal::PointTable table;]])], | ||
+ [PDAL_LIBS="$PDAL_LIBS"],[ | ||
AC_MSG_ERROR([*** Unable to locate suitable (>=1.7.1) PDAL library.]) | ||
]) | ||
- ]) | ||
+ | ||
+ AC_DEFINE(HAVE_PDAL, 1, [Define to 1 if PDAL exists.]) | ||
+ | ||
+ AC_MSG_CHECKING(whether to use PDAL NoFilenameWriter) | ||
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pdal/Writer.hpp> | ||
+ class St:public pdal::NoFilenameWriter {};]], [[ | ||
+ class NFWTest : public pdal::NoFilenameWriter {}; | ||
+ ]])], | ||
+ [ | ||
+ AC_DEFINE(HAVE_PDAL_NOFILENAMEWRITER, 1, [Define to 1 if PDAL NoFilenameWriter is present.]) | ||
+ AC_MSG_RESULT(yes) | ||
+ ],[AC_MSG_RESULT(no)]) | ||
+ | ||
LIBS=${ac_save_libs} | ||
CFLAGS=${ac_save_cflags} | ||
- | ||
- AC_DEFINE(HAVE_PDAL, 1, [Define to 1 if PDAL is to be used.]) | ||
fi | ||
|
||
AC_SUBST(PDAL_LIBS) | ||
--- include/grass/config.h.in.orig 2024-03-06 22:24:05 | ||
+++ include/grass/config.h.in 2024-04-09 10:44:21 | ||
@@ -155,6 +155,9 @@ | ||
/* Define to 1 if PDAL is to be used. */ | ||
#undef HAVE_PDAL | ||
|
||
+/* Define to 1 if PDAL NoFilenameWriter is present. */ | ||
+#undef HAVE_PDAL_NOFILENAMEWRITER | ||
+ | ||
/* define if glXCreateGLXPixmap exists */ | ||
#undef HAVE_PIXMAPS | ||
|
||
--- raster/r.in.pdal/grassrasterwriter.h.orig 2024-03-06 22:24:05 | ||
+++ raster/r.in.pdal/grassrasterwriter.h 2024-04-09 10:45:31 | ||
@@ -32,7 +32,12 @@ | ||
#include <pdal/Writer.hpp> | ||
|
||
/* Binning code wrapped as a PDAL Writer class */ | ||
+#ifdef HAVE_PDAL_NOFILENAMEWRITER | ||
+class GrassRasterWriter : public pdal::NoFilenameWriter, | ||
+ public pdal::Streamable { | ||
+#else | ||
class GrassRasterWriter : public pdal::Writer, public pdal::Streamable { | ||
+#endif | ||
public: | ||
GrassRasterWriter() : n_processed(0) {} | ||
|