Merge pull request #94619 from doronbehar/saga-opencv4
saga: 7.6.3 -> 7.7.0
This commit is contained in:
commit
5a3aa53600
@ -1,27 +1,90 @@
|
|||||||
{ stdenv, fetchurl, gdal, wxGTK30, proj, libiodbc, lzma,
|
{ stdenv
|
||||||
libharu, opencv2, vigra, postgresql, Cocoa,
|
, fetchurl
|
||||||
unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }:
|
# native
|
||||||
|
, autoreconfHook
|
||||||
|
, pkg-config
|
||||||
|
# not native
|
||||||
|
, gdal
|
||||||
|
, wxGTK31-gtk3
|
||||||
|
, proj_5
|
||||||
|
, dxflib
|
||||||
|
, curl
|
||||||
|
, libiodbc
|
||||||
|
, lzma
|
||||||
|
, libharu
|
||||||
|
, opencv
|
||||||
|
, vigra
|
||||||
|
, postgresql
|
||||||
|
, Cocoa
|
||||||
|
, unixODBC
|
||||||
|
, poppler
|
||||||
|
, hdf4
|
||||||
|
, hdf5
|
||||||
|
, netcdf
|
||||||
|
, sqlite
|
||||||
|
, qhull
|
||||||
|
, giflib
|
||||||
|
, libsvm
|
||||||
|
, fftw
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation rec {
|
||||||
pname = "saga";
|
pname = "saga";
|
||||||
version = "7.6.3";
|
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_5
|
||||||
|
libharu
|
||||||
|
opencv
|
||||||
|
vigra
|
||||||
|
postgresql
|
||||||
|
libiodbc
|
||||||
|
lzma
|
||||||
|
qhull
|
||||||
|
giflib
|
||||||
|
]
|
||||||
# See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
|
# See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
|
||||||
# for why the have additional buildInputs on darwin
|
# for why the have additional buildInputs on darwin
|
||||||
buildInputs = [ gdal wxGTK30 proj libharu opencv2 vigra postgresql libiodbc lzma
|
++ stdenv.lib.optionals stdenv.isDarwin [
|
||||||
qhull giflib ]
|
Cocoa
|
||||||
++ stdenv.lib.optionals stdenv.isDarwin
|
unixODBC
|
||||||
[ Cocoa unixODBC poppler hdf4.out hdf5 netcdf sqlite ];
|
poppler
|
||||||
|
netcdf
|
||||||
|
sqlite
|
||||||
|
];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
# See https://sourceforge.net/p/saga-gis/bugs/280/
|
||||||
|
./opencv4.patch
|
||||||
|
];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
|
CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11 -Wno-narrowing";
|
||||||
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://sourceforge.net/projects/saga-gis/files/SAGA%20-%207/SAGA%20-%207.6.3/saga-7.6.3.tar.gz";
|
|
||||||
sha256 = "0f1qy2y929gd9y7h45bkv9x71xapbzyn06v6wqivjaiydsi1qycb";
|
|
||||||
};
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "System for Automated Geoscientific Analyses";
|
description = "System for Automated Geoscientific Analyses";
|
||||||
homepage = "http://www.saga-gis.org";
|
homepage = "http://www.saga-gis.org";
|
||||||
|
14
pkgs/applications/gis/saga/opencv4.patch
Normal file
14
pkgs/applications/gis/saga/opencv4.patch
Normal file
@ -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\
|
@ -1,12 +1,40 @@
|
|||||||
{stdenv, fetchurl}:
|
{ stdenv
|
||||||
|
, fetchurl
|
||||||
|
, qt5
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
version = "3.12.2";
|
version = "3.17.0";
|
||||||
pname = "dxflib";
|
pname = "dxflib";
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://www.qcad.org/archives/dxflib/${pname}-${version}.src.tar.gz";
|
url = "http://www.qcad.org/archives/dxflib/${pname}-${version}-src.tar.gz";
|
||||||
sha256 = "20ad9991eec6b0f7a3cc7c500c044481a32110cdc01b65efa7b20d5ff9caefa9";
|
sha256 = "09yjgzh8677pzkkr7a59pql5d11451c22pxksk2my30mapxsri96";
|
||||||
};
|
};
|
||||||
|
nativeBuildInputs = [
|
||||||
|
qt5.qmake
|
||||||
|
];
|
||||||
|
preConfigure = ''
|
||||||
|
sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
install -d -m 0755 $out/lib
|
||||||
|
cp -pr *.so* $out/lib
|
||||||
|
install -d -m 0755 $out/include/dxflib
|
||||||
|
cp -pr src/*.h $out/include/dxflib
|
||||||
|
# Generate pkgconfig file
|
||||||
|
install -d -m 0755 $out/lib/pkgconfig
|
||||||
|
cat << 'EOF' > $out/lib/pkgconfig/dxflib.pc
|
||||||
|
prefix=${placeholder "out"}
|
||||||
|
libdir=${placeholder "out"}/lib
|
||||||
|
includedir=${placeholder "out"}/include
|
||||||
|
Name: dxflib
|
||||||
|
Description: A C++ library for reading and writing DXF files
|
||||||
|
Version: %{version}
|
||||||
|
Libs: -L${placeholder "out"}/lib -ldxflib
|
||||||
|
Cflags: -I${placeholder "out"}/include/dxflib
|
||||||
|
EOF
|
||||||
|
'';
|
||||||
|
doCheck = true;
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
maintainers = with stdenv.lib.maintainers; [raskin];
|
maintainers = with stdenv.lib.maintainers; [raskin];
|
||||||
|
@ -17,11 +17,12 @@ stdenv.mkDerivation rec {
|
|||||||
installPhase = let
|
installPhase = let
|
||||||
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
|
libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
|
||||||
in ''
|
in ''
|
||||||
mkdir -p $out/lib $out/bin $out/include;
|
install -D libsvm.so.2 $out/lib/libsvm.2${libSuff}
|
||||||
cp libsvm.so.2 $out/lib/libsvm.2${libSuff};
|
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff}
|
||||||
ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff};
|
install -Dt $out/bin/ svm-scale svm-train svm-predict
|
||||||
cp svm-scale svm-train svm-predict $out/bin;
|
install -Dm644 -t $out/include svm.h
|
||||||
cp svm.h $out/include;
|
mkdir $out/include/libsvm
|
||||||
|
ln -s $out/include/svm.h $out/include/libsvm/svm.h
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user