aboutsummaryrefslogtreecommitdiff
path: root/math/saga/Makefile
blob: d10355f3b672b59d16ea62719e92362b7d367edf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
PORTNAME=	saga
PORTVERSION=	9.4.0
CATEGORIES=	math
MASTER_SITES=	SF/saga-gis/SAGA%20-%20${PORTVERSION:C/\.[[:digit:]]\.[[:digit:]]*$//}/SAGA%20-%20${PORTVERSION}

MAINTAINER=	rhurlin@FreeBSD.org
COMMENT=	System for Automated Geoscientific Analyses
WWW=		http://www.saga-gis.org/en/index.html

LICENSE=	GPLv2 LGPL21
LICENSE_COMB=	multi

.if !exists(/usr/include/omp.h)
BROKEN=		requires OpenMP support that is missing on this architecture
.endif

BUILD_DEPENDS=	swig:devel/swig
LIB_DEPENDS=	libcurl.so:ftp/curl \
		libfftw3.so:math/fftw3 \
		libgdal.so:graphics/gdal \
		libhdf5.so:science/hdf5 \
		libhpdf.so:print/libharu \
		libodbc.so:databases/unixODBC \
		libopencv_core.so:graphics/opencv \
		libpdalcpp.so:math/pdal \
		libproj.so:graphics/proj \
		libsvm.so:science/libsvm \
		libsz.so:science/libaec \
		libtiff.so:graphics/tiff
RUN_DEPENDS:=	swig:devel/swig

USES=		cmake compiler:c++17-lang desktop-file-utils dos2unix gnome \
		iconv:wchar_t libtool localbase pkgconfig python
DOS2UNIX_GLOB=	*.cpp *.h
USE_LDCONFIG=	yes
USE_WX=		3.2+

GIT_TAGNAME=	0c6bbea57

CMAKE_ARGS=	-DSVM_INCLUDE:PATH=${LOCALBASE}/include/svm.h
CMAKE_ON=	CMAKE_VERBOSE_MAKEFILE
CMAKE_ON+=	WITH_DEV_TOOLS
CMAKE_ON+=	WITH_EXCERCISES
CMAKE_ON+=	WITH_LIFETIME_TRACKER
CMAKE_ON+=	WITH_MRMR
CMAKE_ON+=	WITH_SYSTEM_SVM
CMAKE_ON+=	WITH_TOOLS_HPDF
CMAKE_ON+=	WITH_TOOLS_OPENCV
CMAKE_ON+=	WITH_PYTHON_PKG
CMAKE_ON+=	WITH_TOOLS_PDAL
CMAKE_ON+=	WITH_TOOLS_POSTGRES
CMAKE_ON+=	WITH_TOOLS_PROJ
CMAKE_OFF=	WITH_CLIPPER_ONE
CMAKE_OFF+=	WITH_TOOLS_RIEGL

SUB_FILES=	pkg-message

WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}/${PORTNAME}-gis

PLIST_SUB=	PORTVERSION=${PORTVERSION}

OPTIONS_DEFINE=	PGSQL OPENMP VIGRA
OPTIONS_DEFAULT=	PGSQL VIGRA
OPTIONS_DEFAULT_amd64=	OPENMP
OPTIONS_DEFAULT_i386=	OPENMP
OPTIONS_DEFAULT_powerpc64=	OPENMP
OPTIONS_DEFAULT_powerpc64le=	OPENMP
NO_OPTIONS_SORT=	yes
OPTIONS_SUB=	yes
OPENMP_DESC=	Enable Multiprocessing (only amd64, i386 and powerpc64*)
VIGRA_DESC=	Enable 'Vision with Generic Algorithms' Library

OPENMP_CONFIGURE_ENABLE=	openmp
PGSQL_USES=		pgsql
PGSQL_CONFIGURE_WITH=	postgresql
VIGRA_BUILD_DEPENDS=	${LOCALBASE}/lib/libvigraimpex.so:graphics/vigra
VIGRA_RUN_DEPENDS=	${LOCALBASE}/lib/libvigraimpex.so:graphics/vigra

.include <bsd.port.pre.mk>

SUB_FILES=	pkg-message

post-patch:
.if ${ARCH} == "powerpc"
	@${REINPLACE_CMD} -e 's|typedef unsigned long	DWORD;|typedef unsigned int	DWORD;|' \
		${WRKSRC}/src/saga_core/saga_api/api_core.h
.endif
	@${REINPLACE_CMD} -e 's|GIT_TAGNAME|${GIT_TAGNAME}|g' \
		${WRKSRC}/src/saga_core/saga_gui/CMakeLists.txt \
		${WRKSRC}/src/saga_core/saga_gui/dlg_about.cpp
	@${REINPLACE_CMD} -e 's|-lgomp|-lomp|' \
		${WRKSRC}/src/accessories/templates/template4saga-tools/my_tool_library/Makefile

post-install:
	${MKDIR} ${STAGEDIR}${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga*.txt ${STAGEDIR}${DATADIR}
	${INSTALL_DATA} ${WRKSRC}/src/saga_core/saga_gui/res/saga.png ${STAGEDIR}${DATADIR}
	${RM} ${STAGEDIR}${DATADIR}/saga_dic.txt ${STAGEDIR}${DATADIR}/saga_srs.txt
# Put accessories under share/saga, python/data already under site-packages/PySAGA ;)
	(cd ${WRKSRC}/src/accessories && ${RM} -R python)
	(cd ${WRKSRC}/src/accessories && ${COPYTREE_SHARE} . ${STAGEDIR}${DATADIR})
	${RM} -R ${STAGEDIR}${DATADIR}/CMakeLists.txt
	${RM} -R ${STAGEDIR}${DATADIR}/templates/template4saga-tools/my_tool_library/Makefile.bak
# library helper files are not needed and cripple some math/qgis extensions
	@${RM} ${STAGEDIR}${PREFIX}/lib/saga/*.la

.include <bsd.port.post.mk>