git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #94619 from doronbehar/saga-opencv4

saga: 7.6.3 -> 7.7.0

commit5a3aa5360059b2ba1b8c00a819d49807eae5cd3b authorMichael Raskin <7c6f434c@mail.ru> dateSun 16 Aug 2020, 10:17 (6 years ago) parent8b89e04adaf006
4 files changed+131−25
pkgs/applications/gis/saga/default.nix+77−14 pkgs/applications/gis/saga/opencv4.patch+14 pkgs/development/libraries/dxflib/default.nix+32−4 pkgs/development/libraries/libsvm/default.nix+8−7
pkgs/applications/gis/saga/default.nix+77−14
@@ -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";
pkgs/applications/gis/saga/opencv4.patchnew file+14
@@ -0,0 +1,14 @@
1+--- a/src/tools/imagery/imagery_opencv/Makefile.am
2++++ b/src/tools/imagery/imagery_opencv/Makefile.am
3+@@ -7,9 +7,9 @@
4+
5+ if HAVE_CV
6+ DEF_SAGA = -D_SAGA_LINUX -D_TYPEDEF_BYTE -D_TYPEDEF_WORD
7+-CXX_INCS = -I$(top_srcdir)/src/saga_core -I/usr/include/opencv
8++CXX_INCS = -I$(top_srcdir)/src/saga_core `pkg-config opencv4 --cflags`
9+ AM_CXXFLAGS = -fPIC $(CXX_INCS) $(DEF_SAGA) $(DBGFLAGS) $(GOMPFLAGS)
10+-AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv --libs`
11++AM_LDFLAGS = -fPIC -shared -avoid-version `pkg-config opencv4 --libs`
12+ pkglib_LTLIBRARIES = libimagery_opencv.la
13+ libimagery_opencv_la_SOURCES =\
14+ MLB_Interface.cpp\
pkgs/development/libraries/dxflib/default.nix+32−4
@@ -1,12 +1,40 @@
1−{stdenv, fetchurl}:
1+{ stdenv
2+, fetchurl
3+, qt5
4+}:
25
36stdenv.mkDerivation rec {
4− version = "3.12.2";
7+ version = "3.17.0";
58 pname = "dxflib";
69 src = fetchurl {
7− url = "http://www.qcad.org/archives/dxflib/${pname}-${version}.src.tar.gz";
8− sha256 = "20ad9991eec6b0f7a3cc7c500c044481a32110cdc01b65efa7b20d5ff9caefa9";
10+ url = "http://www.qcad.org/archives/dxflib/${pname}-${version}-src.tar.gz";
11+ sha256 = "09yjgzh8677pzkkr7a59pql5d11451c22pxksk2my30mapxsri96";
912 };
13+ nativeBuildInputs = [
14+ qt5.qmake
15+ ];
16+ preConfigure = ''
17+ sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro
18+ '';
19+ installPhase = ''
20+ install -d -m 0755 $out/lib
21+ cp -pr *.so* $out/lib
22+ install -d -m 0755 $out/include/dxflib
23+ cp -pr src/*.h $out/include/dxflib
24+ # Generate pkgconfig file
25+ install -d -m 0755 $out/lib/pkgconfig
26+ cat << 'EOF' > $out/lib/pkgconfig/dxflib.pc
27+ prefix=${placeholder "out"}
28+ libdir=${placeholder "out"}/lib
29+ includedir=${placeholder "out"}/include
30+ Name: dxflib
31+ Description: A C++ library for reading and writing DXF files
32+ Version: %{version}
33+ Libs: -L${placeholder "out"}/lib -ldxflib
34+ Cflags: -I${placeholder "out"}/include/dxflib
35+ EOF
36+ '';
37+ doCheck = true;
1038
1139 meta = {
1240 maintainers = with stdenv.lib.maintainers; [raskin];
pkgs/development/libraries/libsvm/default.nix+8−7
@@ -10,18 +10,19 @@ stdenv.mkDerivation rec {
1010 };
1111
1212 buildPhase = ''
13− make
14− make lib
13+ make
14+ make lib
1515 '';
1616
1717 installPhase = let
1818 libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
1919 in ''
20− mkdir -p $out/lib $out/bin $out/include;
21− cp libsvm.so.2 $out/lib/libsvm.2${libSuff};
22− ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff};
23− cp svm-scale svm-train svm-predict $out/bin;
24− cp svm.h $out/include;
20+ install -D libsvm.so.2 $out/lib/libsvm.2${libSuff}
21+ ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff}
22+ install -Dt $out/bin/ svm-scale svm-train svm-predict
23+ install -Dm644 -t $out/include svm.h
24+ mkdir $out/include/libsvm
25+ ln -s $out/include/svm.h $out/include/libsvm/svm.h
2526 '';
2627
2728 postFixup = stdenv.lib.optionalString stdenv.isDarwin ''