aboutsummaryrefslogtreecommitdiffstats
path: root/Mk
diff options
context:
space:
mode:
authortcberner <tcberner@FreeBSD.org>2018-01-03 00:49:24 +0800
committertcberner <tcberner@FreeBSD.org>2018-01-03 00:49:24 +0800
commit98f12cd71d8be47f727a159669046065aff7fb2b (patch)
treefefd75a0b797bfd5f2fbecc832b9a94f740ee983 /Mk
parent2e5f9718524f65806c04f8377358291676d5450b (diff)
downloadfreebsd-ports-gnome-98f12cd71d8be47f727a159669046065aff7fb2b.tar.gz
freebsd-ports-gnome-98f12cd71d8be47f727a159669046065aff7fb2b.tar.zst
freebsd-ports-gnome-98f12cd71d8be47f727a159669046065aff7fb2b.zip
New USES=eigen
Usage: USES=eigen:<version>[,<type>] version: 2 or 3 (required) type: build (default), run For example: USES=eigen:2,build,run will add a BUILD- and RUN_DEPENDS on math/eigen2, and USES=eigen:3 will add a BUILD_DEPENDS on math/eigen3. * Convert the existing ports to use it - biology/iqtree: remove run time dependency (seemed not to be needed) - graphics/movit: remove run time dependency (seemed not to be needed) - science/avogadro: add run time dependeny (installed cmake file requires it to be present) Reviewed by: rakuco, mat Differential Revision: https://reviews.freebsd.org/D13702
Diffstat (limited to 'Mk')
-rw-r--r--Mk/Uses/eigen.mk55
1 files changed, 55 insertions, 0 deletions
diff --git a/Mk/Uses/eigen.mk b/Mk/Uses/eigen.mk
new file mode 100644
index 000000000000..73ce0055fa2b
--- /dev/null
+++ b/Mk/Uses/eigen.mk
@@ -0,0 +1,55 @@
+# $FreeBSD$
+#
+# Handle dependency on eigen
+#
+# Feature: eigen
+# Usage: USES=eigen:ARGS
+# Valid ARGS: <version>,[build,run]
+#
+# version The chooseable versions are 2 and 3.
+# USES=eigen:2 # Use eigen 2.x
+# USES=eigen:3 # Use eigen 3.x
+#
+# build Add build depends [default]
+# run Add run depends
+#
+# MAINTAINER: kde@FreeBSD.org
+#
+
+.if ! defined(_INCLUDE_USES_EIGEN_MK)
+_INCLUDE_USES_EIGEN_MK= YES
+
+_EIGEN_SUPPORTED= 2 3
+
+_eigen_version= #
+. for _ver in ${_EIGEN_SUPPORTED:O:u}
+. if ${eigen_ARGS:M${_ver}}
+. if empty(_eigen_version)
+_eigen_version= ${_ver}
+. else
+IGNORE= Incorrect USES=eigen:${eigen_ARGS} - multiple versions defined
+. endif
+. endif
+. endfor
+
+. if empty(_eigen_version)
+IGNORE= Incorrect USES=eigen:${eigen_ARGS} - no version defined
+. endif
+
+# Export the version of the chosen eigen port
+_EIGEN_PORT= math/eigen${_eigen_version}
+_EIGEN_PATH= ${LOCALBASE}/libdata/pkgconfig/eigen${_eigen_version}.pc
+_EIGEN_DEP= ${_EIGEN_PATH}:${_EIGEN_PORT}
+
+# Append the correct BUILD-/RUN_DEPENDS
+. if empty(eigen_ARGS:Mbuild) && empty(eigen_ARGS:Mrun)
+eigen_ARGS+= build
+. endif
+. if ! empty(eigen_ARGS:Mbuild)
+BUILD_DEPENDS+= ${_EIGEN_DEP}
+. endif
+. if ! empty(eigen_ARGS:Mrun)
+RUN_DEPENDS+= ${_EIGEN_DEP}
+. endif
+
+.endif