aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/applications/gis/saga
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/applications/gis/saga
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/applications/gis/saga')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/gis/saga/clang_patch.patch19
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/gis/saga/default.nix95
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/gis/saga/finite.patch13
-rw-r--r--infra/libkookie/nixpkgs/pkgs/applications/gis/saga/opencv4.patch14
4 files changed, 141 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/clang_patch.patch b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/clang_patch.patch
new file mode 100644
index 000000000000..e6af8d130514
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/clang_patch.patch
@@ -0,0 +1,19 @@
+commit e92b250968e9656084ab5984689747ca615ff6e7
+Author: Volker Wichmann <wichmann@laserdata.at>
+Date: Sun Mar 5 13:49:53 2017 +0100
+
+ saga_api, CSG_Table::Del_Records(): bug fix, check record count correctly
+
+diff --git a/src/saga_core/saga_api/table.cpp b/src/saga_core/saga_api/table.cpp
+index 76a1d8d..fa1a66f 100644
+--- a/src/saga_core/saga_api/table.cpp
++++ b/src/saga_core/saga_api/table.cpp
+@@ -901,7 +901,7 @@ bool CSG_Table::Del_Record(int iRecord)
+ //---------------------------------------------------------
+ bool CSG_Table::Del_Records(void)
+ {
+- if( m_Records > 0 )
++ if( m_nRecords > 0 )
+ {
+ _Index_Destroy();
+
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/default.nix b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/default.nix
new file mode 100644
index 000000000000..aa418148209e
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/default.nix
@@ -0,0 +1,95 @@
+{ stdenv
+, fetchurl
+# native
+, autoreconfHook
+, pkg-config
+# not native
+, gdal
+, wxGTK31-gtk3
+, proj
+, dxflib
+, curl
+, libiodbc
+, lzma
+, libharu
+, opencv
+, vigra
+, postgresql
+, Cocoa
+, unixODBC
+, poppler
+, hdf4
+, hdf5
+, netcdf
+, sqlite
+, qhull
+, giflib
+, libsvm
+, fftw
+}:
+
+stdenv.mkDerivation rec {
+ pname = "saga";
+ version = "7.7.0";
+
+ src = fetchurl {
+ url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%20${stdenv.lib.versions.major version}/SAGA%20-%20${version}/saga-${version}.tar.gz";
+ sha256 = "1nmvrlcpcm2pas9pnav13iydnym9d8yqqnwq47lm0j6b0a2wy9zk";
+ };
+
+ nativeBuildInputs = [
+ # Upstream's gnerated ./configure is not reliable
+ autoreconfHook
+ pkg-config
+ ];
+ configureFlags = [
+ "--with-system-svm"
+ # hdf is no detected otherwise
+ "HDF5_LIBS=-l${hdf5}/lib"
+ "HDF5_CFLAGS=-I${hdf5.dev}/include"
+ ];
+ buildInputs = [
+ curl
+ dxflib
+ fftw
+ libsvm
+ hdf5
+ gdal
+ wxGTK31-gtk3
+ proj
+ libharu
+ opencv
+ vigra
+ postgresql
+ libiodbc
+ lzma
+ qhull
+ giflib
+ ]
+ # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
+ # for why the have additional buildInputs on darwin
+ ++ stdenv.lib.optionals stdenv.isDarwin [
+ Cocoa
+ unixODBC
+ poppler
+ netcdf
+ sqlite
+ ];
+
+ patches = [
+ # See https://sourceforge.net/p/saga-gis/bugs/280/
+ ./opencv4.patch
+ ];
+
+ enableParallelBuilding = true;
+
+ CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
+
+ meta = with stdenv.lib; {
+ description = "System for Automated Geoscientific Analyses";
+ homepage = "http://www.saga-gis.org";
+ license = licenses.gpl2Plus;
+ maintainers = with maintainers; [ michelk mpickering ];
+ platforms = with platforms; unix;
+ };
+}
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/finite.patch b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/finite.patch
new file mode 100644
index 000000000000..7f60743534bd
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/finite.patch
@@ -0,0 +1,13 @@
+diff --git a/saga-gis/src/modules/imagery/imagery_maxent/me.cpp b/saga-gis/src/modules/imagery/imagery_maxent/me.cpp
+index c5da854..d3e9cff 100755
+--- a/src/modules/imagery/imagery_maxent/me.cpp
++++ b/src/modules/imagery/imagery_maxent/me.cpp
+@@ -21,7 +21,7 @@
+ #ifdef _SAGA_MSW
+ #define isinf(x) (!_finite(x))
+ #else
+-#define isinf(x) (!finite(x))
++#define isinf(x) (!isfinite(x))
+ #endif
+
+ /** The input array contains a set of log probabilities lp1, lp2, lp3
diff --git a/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/opencv4.patch b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/opencv4.patch
new file mode 100644
index 000000000000..0b26192bf09b
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/applications/gis/saga/opencv4.patch
@@ -0,0 +1,14 @@
+--- a/src/tools/imagery/imagery_opencv/Makefile.am
++++ b/src/tools/imagery/imagery_opencv/Makefile.am
+@@ -7,9 +7,9 @@
+
+ if HAVE_CV
+ DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
+-CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
++CXX_INCS = -I$(top_srcdir)/src/saga_core `pkg-config opencv4 --cflags`
+ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
+-AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv --libs`
++AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv4 --libs`
+ pkglib_LTLIBRARIES = libimagery_opencv.la
+ libimagery_opencv_la_SOURCES =\
+ MLB_Interface.cpp\