summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiziano Müller <dev-zero@gentoo.org>2016-03-17 11:50:14 +0100
committerTiziano Müller <dev-zero@gentoo.org>2016-03-17 11:50:14 +0100
commit984ab3fd0c2449a31c3f63eb4518f3b35d122f9b (patch)
tree8ba91e65cd116f909f477723995e826ec1090078 /sci-chemistry
parentnow in tree (diff)
downloaddev-zero-984ab3fd0c2449a31c3f63eb4518f3b35d122f9b.tar.gz
dev-zero-984ab3fd0c2449a31c3f63eb4518f3b35d122f9b.tar.bz2
dev-zero-984ab3fd0c2449a31c3f63eb4518f3b35d122f9b.zip
sci-chemistry/cp2k: initial commit
Diffstat (limited to 'sci-chemistry')
-rw-r--r--sci-chemistry/cp2k/Manifest1
-rw-r--r--sci-chemistry/cp2k/cp2k-3.0.ebuild81
2 files changed, 82 insertions, 0 deletions
diff --git a/sci-chemistry/cp2k/Manifest b/sci-chemistry/cp2k/Manifest
new file mode 100644
index 0000000..19a80c6
--- /dev/null
+++ b/sci-chemistry/cp2k/Manifest
@@ -0,0 +1 @@
+DIST cp2k-3.0.tar.bz2 48249778 SHA256 1acfacef643141045b7cbade7006f9b7538476d861eeecd9658c9e468dc61151 SHA512 3a3af3fbfdd9748b0b41f89981d866ab1c64f30ac238b10e17c28e1eb247f349bfb536db6ecdd68151445424d7c467aecc818fe8bcf141f575d1910c46d35a80 WHIRLPOOL 99dcf5ec0f424336fba7ff61d673ff132404081ce2ac18a3bb7feeaaee19d1a7efb9940d1a9ca59e9b42033dd47276c513651e63c6a699c2bba32e1d1ed0714a
diff --git a/sci-chemistry/cp2k/cp2k-3.0.ebuild b/sci-chemistry/cp2k/cp2k-3.0.ebuild
new file mode 100644
index 0000000..1d2218c
--- /dev/null
+++ b/sci-chemistry/cp2k/cp2k-3.0.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+PYTHON_COMPAT=( python{2_6,2_7} )
+
+inherit flag-o-matic fortran-2 toolchain-funcs python-any-r1
+
+FORTRAN_STANDARD=2003
+FORTRAN_NEED_OPENMP=1
+# OpenMP support would be optional
+
+DESCRIPTION="Quantum chemistry and solid state physics software package"
+HOMEPAGE="https://www.cp2k.org/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="+fftw openmp"
+
+RDEPEND="virtual/blas
+ fftw? ( sci-libs/fftw:3.0=[fortran,openmp?,threads] )"
+DEPEND="${RDEPEND}
+ virtual/pkgconfig
+ ${PYTHON_DEPS}"
+
+pkg_setup() {
+ python-any-r1_pkg_setup
+ fortran-2_pkg_setup
+}
+
+src_configure() {
+ if use openmp ; then
+ append-fflags -fopenmp
+ append-ldflags -fopenmp
+ fi
+
+ declare -a libs defines
+
+ if use fftw ; then
+ if use openmp ; then
+ libs+=($(pkg-config --libs fftw3))
+ else
+ libs+=($(pkg-config --libs fftw3_omp))
+ fi
+ defines+=(-D__FFTW3)
+ echo ${defines[*]}
+ fi
+
+ cat > arch/custom.gentoo << EOF
+CC = $(tc-getCC)
+# empty CPP var makes it use the compiler directly instead of two-step
+CPP =
+FC = $(tc-getFC)
+LD = $(tc-getFC)
+AR = $(tc-getAR) -r
+CPPFLAGS = ${defines[*]} ${CPPFLAGS}
+FCFLAGS = -ffree-form -ffree-line-length-none ${defines[*]} ${CPPFLAGS} ${FCFLAGS}
+LDFLAGS = ${LDFLAGS}
+LIBS = $(pkg-config --libs lapack) ${libs[*]}
+DATA_DIR = ${EPREFIX}/usr/share/cp2k
+EOF
+}
+
+src_compile() {
+ cd makefiles # using `-C makefiles` does not work, because "reasons"
+ emake ARCH=custom VERSION=gentoo
+}
+
+src_install() {
+ for e in cp2k cp2k_shell ; do
+ newbin exe/custom/$e.gentoo $e
+ done
+
+ insinto /usr/share/cp2k
+ doins -r data/*
+
+ dodoc README
+}