Skip to content

Commit

Permalink
Merge branch 'main' into r_mapcalc_add_data_ypes_info_to_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pesekon2 authored Apr 16, 2024
2 parents 08aa852 + 11b986b commit 9e8ab9a
Show file tree
Hide file tree
Showing 84 changed files with 3,912 additions and 2,843 deletions.
2 changes: 1 addition & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ per-file-ignores =
gui/wxpython/gcp/g.gui.gcp.py: F841
gui/wxpython/gcp/manager.py: E501, F841, E722
gui/wxpython/gcp/mapdisplay.py: F841
gui/wxpython/gmodeler/*: F841, E722, W605, F405, F403, E402
gui/wxpython/gmodeler/*: E501
gui/wxpython/gui_core/*: F841, E266, E722, W605
gui/wxpython/gui_core/dialogs.py: E501, E722, F841, W605
gui/wxpython/gui_core/forms.py: E501, E722, F841
Expand Down
105 changes: 91 additions & 14 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,98 @@
---
name: Coverity Scan

on:
workflow_dispatch: # run whenever a contributor calls it
schedule:
- cron: '48 5 * * *' # Run at 05:48
# Coverity will let GRASS do a scan a maximum of twice per day, so this schedule will help GRASS fit within that limit with some additional space for manual runs

# Coverity will let GRASS do a scan a maximum of twice per day, so this
# schedule will help GRASS fit within that limit with some additional space
# for manual runs
permissions:
contents: read
# action based off of
# https://github.com/OSGeo/PROJ/blob/905c9a6c2da3dc6b7aa2c89d3ab78d9d1a9cd070/.github/workflows/coverity-scan.yml
jobs:
build:
runs-on: [ ubuntu-latest ]
coverity:
runs-on: ubuntu-22.04
if: github.repository == 'OSGeo/grass'
steps:
- name: Checkout Source
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Coverity Scan
uses: synopsys-sig/synopsys-action@cef5e38596faf5d2787bbff78a5d7255a9f7682b # v1.8.0
with:
### SCANNING: Required fields
coverity_url: ${{ secrets.COVERITY_URL }} # The URL to Coverity
coverity_user: ${{ secrets.COVERITY_USER }} # The user for the Coverity project
coverity_passphrase: ${{ secrets.COVERITY_PASSPHRASE }} # The password for the Coverity user
coverity_version: '2023.6.2' # The version for Coverity Scan
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Get dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y wget git gawk findutils
xargs -a <(awk '! /^ *(#|$)/' ".github/workflows/apt.txt") -r -- \
sudo apt-get install -y --no-install-recommends --no-install-suggests
- name: Create installation directory
run: |
mkdir $HOME/install
- name: Download Coverity Build Tool
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 \
--post-data "token=$TOKEN&project=grass" -O cov-analysis-linux64.tar.gz
mkdir cov-analysis-linux64
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C cov-analysis-linux64
env:
TOKEN: ${{ secrets.COVERITY_PASSPHRASE }}
- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
- name: Set LD_LIBRARY_PATH for compilation
run: |
echo "LD_LIBRARY_PATH=$HOME/install/lib" >> $GITHUB_ENV
- name: Print build environment variables
run: |
printenv | sort
gcc --version
ldd --version
- name: Configure
run: |
echo "CFLAGS=${{ env.CFLAGS }}" >> $GITHUB_ENV
echo "CXXFLAGS=${{ env.CXXFLAGS }}" >> $GITHUB_ENV
./configure \
--prefix="$HOME/install/" \
--enable-largefile \
--with-cxx \
--with-zstd \
--with-bzlib \
--with-blas \
--with-lapack \
--with-readline \
--without-openmp \
--with-pdal \
--without-pthread \
--with-tiff \
--with-freetype \
--with-freetype-includes="/usr/include/freetype2/" \
--with-proj-share=/usr/share/proj \
--with-geos \
--with-sqlite \
--with-fftw \
--with-netcdf
env:
CFLAGS: -fPIC -g
CXXFLAGS: -fPIC -g
- name: Build with cov-build
run: |
pwd
export PATH=`pwd`/cov-analysis-linux64/bin:$PATH
cov-build --dir cov-int make
- name: Submit to Coverity Scan
run: |
tar czvf grass.tgz cov-int
curl \
--form project=grass \
--form token=$TOKEN \
--form email=$EMAIL \
--form [email protected] \
--form version=main \
--form description="`git rev-parse --abbrev-ref HEAD` `git rev-parse --short HEAD`" \
https://scan.coverity.com/builds?project=grass
env:
TOKEN: ${{ secrets.COVERITY_PASSPHRASE }}
EMAIL: ${{ secrets.COVERITY_USER }}
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@2b51285047da1547ffb1b2203d8be4c0af6b1f20 # v3.2.0
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Login to DockerHub
uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0
with:
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/osgeo4w.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ jobs:
python3-matplotlib,python3-numpy,python3-ply,python3-pywin32,\
python3-wxpython,regex-devel,zstd-devel"

- name: Set number of cores for compilation
run: |
echo "MAKEFLAGS=-j$(nproc)" >> $GITHUB_ENV
shell: msys2 {0}

- name: Compile GRASS GIS
run: D:\msys64\usr\bin\bash.exe -l (''+(Get-Location)+'\.github\workflows\build_osgeo4w.sh') (Get-Location)

Expand Down
41 changes: 26 additions & 15 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -10473,42 +10473,53 @@ pdal::PointTable table;
_ACEOF
if ac_fn_cxx_try_link "$LINENO"
then :

PDAL_LIBS="$PDAL_LIBS"
else $as_nop

as_fn_error $? "*** Unable to locate suitable (>=1.7.1) PDAL library." "$LINENO" 5

fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext


printf "%s\n" "#define HAVE_PDAL 1" >>confdefs.h


{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether to use PDAL NoFilenameWriter" >&5
printf %s "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 (void)
{
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_nop

as_fn_error $? "*** Unable to locate suitable (>=1.7.1) PDAL library." "$LINENO" 5

fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
printf "%s\n" "#define HAVE_PDAL_NOFILENAMEWRITER 1" >>confdefs.h

{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }

else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext

LIBS=${ac_save_libs}
CFLAGS=${ac_save_cflags}


printf "%s\n" "#define HAVE_PDAL 1" >>confdefs.h

fi


Expand Down
22 changes: 15 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1076,17 +1076,25 @@ else
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_LINK_IFELSE([AC_LANG_PROGRAM([[#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.])
])
])
LIBS=${ac_save_libs}
CFLAGS=${ac_save_cflags}

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}
fi

AC_SUBST(PDAL_LIBS)
Expand Down
2 changes: 1 addition & 1 deletion docker/debian/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:stable@sha256:e8f0d90c2b8a7b8040aa032b166866a93431bb221494d938a826dd7ad3a476bd
FROM debian:stable@sha256:fef26aa981ff8c3eeb09b20555ec6e02b38e6b227ec0b88bef7fde778cbf848a
# currently Debian 12

# docker run -it --rm debian:stable bash
Expand Down
2 changes: 1 addition & 1 deletion general/g.mapsets/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ MODULE_TOPDIR = ../..

PGM = g.mapsets

LIBES = $(GISLIB)
LIBES = $(PARSONLIB) $(GISLIB)
DEPENDENCIES = $(GISDEP)

include $(MODULE_TOPDIR)/include/Make/Module.make
Expand Down
16 changes: 16 additions & 0 deletions general/g.mapsets/g.mapsets.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ <h3>Print available mapsets</h3>
PERMANENT user1 user2
</pre></div>

Mapsets can be also printed out as json by setting the format option to "json" (<b>format="json"</b>).

<div class="code">
<pre>
g.mapsets format="json" -l

{
"mapsets": [
"PERMANENT",
"user1",
"user2"
]
}
</pre>
</div>

<h3>Add new mapset</h3>

Add mapset 'user2' to the current mapset search path
Expand Down
Loading

0 comments on commit 9e8ab9a

Please sign in to comment.