git.iko.soy/typeable/nixpkgs
on master help sign in
saga: 6.3.0 -> 7.2.0
commite478e6bdff2f8de59ecebd5e3377d03d5150e8a0 authorVincent Laporte <Vincent.Laporte@gmail.com> dateMon 17 Jun 2019, 06:48 (7 years ago) parentde56d6b
2 files changed+3−60
pkgs/applications/gis/saga/default.nix+3−5 pkgs/applications/gis/saga/finite-6.3.0.patch−55
pkgs/applications/gis/saga/default.nix+3−5
@@ -3,7 +3,7 @@
33 unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }:
44
55stdenv.mkDerivation rec {
6− name = "saga-6.3.0";
6+ name = "saga-7.2.0";
77
88 # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
99 # for why the have additional buildInputs on darwin
@@ -14,13 +14,11 @@ stdenv.mkDerivation rec {
1414
1515 enableParallelBuilding = true;
1616
17− patches = [ ./finite-6.3.0.patch];
18−
1917 CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
2018
2119 src = fetchurl {
22− url = "mirror://sourceforge/project/saga-gis/SAGA%20-%206/SAGA%20-%206.3.0/saga-6.3.0.tar.gz";
23− sha256 = "0hyjim8fcp3mna1hig22nnn4ki3j6b7096am2amcs99sdr09jjxv";
20+ url = "mirror://sourceforge/project/saga-gis/SAGA%20-%207/SAGA%20-%207.2.0/saga-7.2.0.tar.gz";
21+ sha256 = "10gjc5mc5kwg2c2la22hgwx6s5q60z9xxffjpjw0zrlhksijl5an";
2422 };
2523
2624 meta = with stdenv.lib; {
pkgs/applications/gis/saga/finite-6.3.0.patchdeleted−55
@@ -1,55 +0,0 @@
1−diff --git a/src/tools/imagery/imagery_maxent/me.cpp b/src/tools/imagery/imagery_maxent/me.cpp
2−index c5da854..d3e9cff 100755
3−--- a/src/tools/imagery/imagery_maxent/me.cpp
4−+++ b/src/tools/imagery/imagery_maxent/me.cpp
5−@@ -21,7 +21,7 @@
6− #ifdef _SAGA_MSW
7− #define isinf(x) (!_finite(x))
8− #else
9−-#define isinf(x) (!finite(x))
10−+#define isinf(x) (!isfinite(x))
11− #endif
12−
13− /** The input array contains a set of log probabilities lp1, lp2, lp3
14−@@ -47,7 +47,7 @@ double sumLogProb(vector<double>& logprobs)
15− /** returns log (e^logprob1 + e^logprob2). */
16− double sumLogProb(double logprob1, double logprob2)
17− {
18−- if (isinf(logprob1) && isinf(logprob2))
19−+ if (isinf(logprob1) && isinf(logprob2))
20− return logprob1; // both prob1 and prob2 are 0, return log 0.
21− if (logprob1>logprob2)
22− return logprob1+log(1+exp(logprob2-logprob1));
23−@@ -70,8 +70,8 @@ void MaxEntModel::print(ostream& ostrm, MaxEntTrainer& trainer)
24− for (FtMap::iterator it = _index.begin(); it!=_index.end(); it++) {
25− unsigned long i = it->second;
26− for (unsigned long c = 0; c<_classes; c++) {
27−- ostrm << "lambda(" << trainer.className(c) << ", "
28−- << trainer.getStr(it->first) << ")="
29−+ ostrm << "lambda(" << trainer.className(c) << ", "
30−+ << trainer.getStr(it->first) << ")="
31− << _lambda[i+c] << endl;
32− }
33− }
34−@@ -86,7 +86,7 @@ int MaxEntModel::getProbs(MaxEntEvent& event, vector<double>& probs)
35− double s = 0;
36− for (unsigned int f = 0; f<event.size(); f++) {
37− FtMap::iterator it = _index.find(event[f]);
38−- if (it!=_index.end())
39−+ if (it!=_index.end())
40− s += _lambda[it->second+c];
41− }
42− probs[c] = s;
43−@@ -142,10 +142,10 @@ double MaxEntModel::getObsCounts(EventSet& events, vector<double>& obsCounts)
44− double ftSum = 0;
45− for (unsigned long j=0; j<e.size(); j++) {
46− FtMap::iterator it = _index.find(e[j]);
47−- if (it!=_index.end())
48−+ if (it!=_index.end())
49− obsCounts[it->second+c] += count;
50− else { // new feature, need to expand obsCounts and _lambda
51−- for (unsigned int k = 0; k<_classes; k++)
52−+ for (unsigned int k = 0; k<_classes; k++)
53− obsCounts.push_back(0);
54− obsCounts[_lambda.size()+c] += count;
55− addFeature(e[j]);