From 944dd5a76d50dcce1ba28de60a35d45079d25f09 Mon Sep 17 00:00:00 2001
From: Lorenz Thielbeer <thielblz@rh04359.villa-bosch.de>
Date: Thu, 28 Apr 2022 19:18:34 +0200
Subject: [PATCH] introduction of apbs, py-pdb2pqr and sda

---
 packages/apbs/package.py       | 46 ++++++++++++++++++++++++++++++
 packages/py-pdb2pqr/package.py | 27 ++++++++++++++++++
 packages/sda/package.py        | 51 ++++++++++++++++++++++++++++++++++
 packages/sda/package.py.backup |  8 ++++++
 4 files changed, 132 insertions(+)
 create mode 100644 packages/apbs/package.py
 create mode 100644 packages/py-pdb2pqr/package.py
 create mode 100644 packages/sda/package.py
 create mode 100644 packages/sda/package.py.backup

diff --git a/packages/apbs/package.py b/packages/apbs/package.py
new file mode 100644
index 00000000..cf459b4f
--- /dev/null
+++ b/packages/apbs/package.py
@@ -0,0 +1,46 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+
+
+class Apbs(CMakePackage):
+    """
+    APBS (Adaptive Poisson-Boltzmann Solver) solves the equations of continuum electrostatics
+    for large biomolecular assemblages. This software was designed “from the ground up”
+    using modern design principles to ensure its ability to interface with other computational
+    packages and evolve as methods and applications change over time. The APBS code is
+    accompanied by extensive documentation for both users and programmers and is supported
+    by a variety of utilities for preparing calculations and analyzing results.
+    Finally, the free, open-source APBS license ensures its accessibility to the entire
+    biomedical community.
+    """
+
+    # Homepage and Github URL.
+    homepage = "https://www.poissonboltzmann.org/"
+    url      = "https://github.com/Electrostatics/apbs/archive/refs/tags/v3.4.0.tar.gz"
+
+    # List of GitHub accounts to notify when the package is updated.
+    maintainers = ['thielblz', 'richtesn']
+
+    # SHA256 checksum.
+    version('3.4.0', sha256='572ff606974119430020ec948c78e171d8525fb0e67a56dad937a897cac67461')
+
+    # Dependencies.
+    depends_on('cmake@3.19', type='build')
+    depends_on('python@3.9:3.10', type=('build'))
+    depends_on('blas', type='build')
+    depends_on('suite-sparse', type='build')
+    depends_on('maloc', type='build')
+
+    def cmake_args(self):
+        # Min and max Python versions need to be set as variables to pass tests.
+        # See tests/CMakeLists.txt lines 6-14.
+        args = [
+                '-DPYTHON_MIN_VERSION=3.9',
+                '-DPYTHON_MAX_VERSION=3.10',
+                ]
+        return args
diff --git a/packages/py-pdb2pqr/package.py b/packages/py-pdb2pqr/package.py
new file mode 100644
index 00000000..39c2a60b
--- /dev/null
+++ b/packages/py-pdb2pqr/package.py
@@ -0,0 +1,27 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+
+
+class PyPdb2pqr(PythonPackage):
+    """
+    PDB2PQR - determining titration states,
+    adding missing atoms, and assigning
+    charges/radii to biomolecules.
+    """
+
+    # Url for the package's homepage.
+    homepage = "http://www.poissonboltzmann.org/"
+    pypi     = "pdb2pqr/pdb2pqr-3.5.2.tar.gz"
+
+    # List of GitHub accounts to
+    # notify when the package is updated.
+    maintainers = ['richtesn', 'thielblz']
+
+    version('3.5.2', sha256='9d145ff3797a563ce818f9d2488413ac339f66c58230670c2455b2572cccd957')
+    
+    depends_on('python@3.8:', type=('build','run'))
diff --git a/packages/sda/package.py b/packages/sda/package.py
new file mode 100644
index 00000000..0116831d
--- /dev/null
+++ b/packages/sda/package.py
@@ -0,0 +1,51 @@
+# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+
+from spack import *
+
+
+class Sda(MakefilePackage):
+    """
+    SDA 7 can be used to carry out Brownian dynamics simulations of the diffusional association
+    in a continuum aqueous solvent of two solute molecules, e.g. proteins, or of a solute
+    molecule to an inorganic surface. SDA 7 can also be used to simulate the diffusion of
+    multiple proteins, in dilute or concentrated solutions, e.g., to study the effects of
+    macromolecular crowding.
+    """
+
+    # Url for the package's homepage.
+    homepage = "https://mcm.h-its.org/sda/doc/doc_sda7/doc/doc_sda7/index.html"
+    url      = "https://mcm.h-its.org/wiki/lib/exe/fetch.php?media=googlecolab:sda-7.3.3c.tgz"
+
+    # A list of GitHub accounts to notify when the package is updated.
+    maintainers = ['richtesn', 'thielblz']
+
+    # Versions and checksums.
+    version('7.3.3c', sha256='cf16a9e4dac520c205879f076505f688b93de12e6589143b8681cb055c74e6f4')
+
+    # Dependencies.
+    depends_on('gcc@9.4.0')
+    depends_on('python@3.8:', type=('build','run'))
+    conflicts('%gcc', when='@9.5:')
+    conflicts('%intel')
+
+    build_directory = 'src'
+    build_jobs = 1
+
+    def edit(self, spec, prefix):
+        makefile = FileFilter('src/Makefile')
+        makefile.filter(r'gfortran', spack_fc)
+        makefile.filter(r'^\s*FC\s*=.*',  'FC = '  + spack_fc)
+        makefile.filter(r'^\s*CC_plus\s*=.*', 'CXX = ' + spack_cxx)
+        makefile.filter(r'\${CC_plus}', '${CXX}')
+        makefile.filter(r'^\s*CC_moins\s*=.*', 'CC = ' + spack_cc)
+        makefile.filter(r'\${CC_moins}', '${CC}')
+
+    @property
+    def install_targets(self):
+        build_directory = 'sda_flex-7.3.3b/src/'
+        targets = ['init libsda sda_flex tools auxi clust test_module']
+        return ['prefix={0}'.format(self.prefix), 'install']
diff --git a/packages/sda/package.py.backup b/packages/sda/package.py.backup
new file mode 100644
index 00000000..bdb029e4
--- /dev/null
+++ b/packages/sda/package.py.backup
@@ -0,0 +1,8 @@
+from spack import *
+
+# Usage
+class Sda(PythonPackage):
+    url = 'https://mcm.h-its.org/wiki/lib/exe/fetch.php?media=googlecolab:sda-7.3.3.tgz'
+    maintainers = ['richtesn', 'thielblz']
+    version('7.3.3', sha256='d7b3b122743d4c26cfb9d7bb81d87dd67b63c2966fd0a0dcd11d67c868f21f43')
+    depends_on('python@3.8:', type=('build','run'))
-- 
GitLab