@@ -1,27 +1,90 @@
1−{ stdenv, fetchurl, gdal, wxGTK30, proj, libiodbc, lzma,
2− libharu, opencv2, vigra, postgresql, Cocoa,
3− unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }:
1+{ stdenv
2+, fetchurl
3+# native
4+, autoreconfHook
5+, pkg-config
6+# not native
7+, gdal
8+, wxGTK31-gtk3
9+, proj_5
10+, dxflib
11+, curl
12+, libiodbc
13+, lzma
14+, libharu
15+, opencv
16+, vigra
17+, postgresql
18+, Cocoa
19+, unixODBC
20+, poppler
21+, hdf4
22+, hdf5
23+, netcdf
24+, sqlite
25+, qhull
26+, giflib
27+, libsvm
28+, fftw
29+}:
430
5−stdenv.mkDerivation {
31+stdenv.mkDerivation rec {
632 pname = "saga";
7− version = "7.6.3";
33+ version = "7.7.0";
834
35+ src = fetchurl {
36+ url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%20${stdenv.lib.versions.major version}/SAGA%20-%20${version}/saga-${version}.tar.gz";
37+ sha256 = "1nmvrlcpcm2pas9pnav13iydnym9d8yqqnwq47lm0j6b0a2wy9zk";
38+ };
39+
40+ nativeBuildInputs = [
41+ # Upstream's gnerated ./configure is not reliable
42+ autoreconfHook
43+ pkg-config
44+ ];
45+ configureFlags = [
46+ "--with-system-svm"
47+ # hdf is no detected otherwise
48+ "HDF5_LIBS=-l${hdf5}/lib"
49+ "HDF5_CFLAGS=-I${hdf5.dev}/include"
50+ ];
51+ buildInputs = [
52+ curl
53+ dxflib
54+ fftw
55+ libsvm
56+ hdf5
57+ gdal
58+ wxGTK31-gtk3
59+ proj_5
60+ libharu
61+ opencv
62+ vigra
63+ postgresql
64+ libiodbc
65+ lzma
66+ qhull
67+ giflib
68+ ]
969 # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
1070 # for why the have additional buildInputs on darwin
11− buildInputs = [ gdal wxGTK30 proj libharu opencv2 vigra postgresql libiodbc lzma
12− qhull giflib ]
13− ++ stdenv.lib.optionals stdenv.isDarwin
14− [ Cocoa unixODBC poppler hdf4.out hdf5 netcdf sqlite ];
71+ ++ stdenv.lib.optionals stdenv.isDarwin [
72+ Cocoa
73+ unixODBC
74+ poppler
75+ netcdf
76+ sqlite
77+ ];
78+
79+ patches = [
80+ # See https://sourceforge.net/p/saga-gis/bugs/280/
81+ ./opencv4.patch
82+ ];
1583
1684 enableParallelBuilding = true;
1785
1886 CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
1987
20− src = fetchurl {
21− url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%207/SAGA%20-%207.6.3/saga-7.6.3.tar.gz";
22− sha256 = "0f1qy2y929gd9y7h45bkv9x71xapbzyn06v6wqivjaiydsi1qycb";
23− };
24−
2588 meta = with stdenv.lib; {
2689 description = "System for Automated Geoscientific Analyses";
2790 homepage = "http://www.saga-gis.org";