pasta: missing setuptools dep (#32220)

* pasta: missing setuptools dep

* pasta: remove extraneous which

* pasta: convert to PythonPackage

* pasta: specify dendropy version
This commit is contained in:
snehring 2022-08-18 17:53:09 -05:00 committed by GitHub
parent 373d2ccf9f
commit 364e4e03ef
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,10 +3,12 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from os import unlink
from spack.package import *
class Pasta(Package):
class Pasta(PythonPackage):
"""PASTA (Practical Alignment using SATe and Transitivity)"""
homepage = "https://github.com/smirarab/pasta"
@ -16,10 +18,11 @@ class Pasta(Package):
version("1.9.0", commit="370ae2d21ef461bcb2cef7c20cb5a4a1db7ff99d")
version("1.8.3", commit="738bec5e0d5a18d013c193d7453374bed47456c9")
depends_on("python@3:", when="@1.9.0:")
depends_on("python@:2", when="@:1.8.3")
depends_on("py-dendropy")
depends_on("java")
depends_on("python@3:", when="@1.9.0:", type=("build", "run"))
depends_on("python@:2", when="@:1.8.3", type=("build", "run"))
depends_on("py-dendropy@4:", type=("build", "run"))
depends_on("py-setuptools", type="build")
depends_on("java", type="run")
resource(
name="tools",
@ -31,14 +34,24 @@ class Pasta(Package):
def setup_build_environment(self, env):
tools = join_path(self.prefix, "sate-tools-linux")
env.set("PASTA_TOOLS_DEVDIR", tools)
env.set("PASTA_TOOLS_RUNDIR", self.prefix.bin)
def install(self, spec, prefix):
# build process for pasta is very hacky -- uses hard links to source
# install the tree first so links don't break
install_tree(".", prefix)
def setup_run_environment(self, env):
env.set("PASTA_TOOLS_RUNDIR", self.prefix.bin)
# run the 'build' from within the prefix
python = which("python")
@run_before("install")
def install_resource(self):
with working_dir(self.stage.source_path):
tools = tools = join_path(self.prefix, "sate-tools-linux")
install_tree("sate-tools-linux", tools)
with working_dir(prefix):
python("setup.py", "develop")
@run_after("install")
def install_stragglers(self):
# install script negelects to actually copy some things
scripts = join_path(self.stage.source_path, "resources", "scripts")
with working_dir(scripts):
unlink(join_path(self.prefix.bin, "hmmeralign"))
install("hmmeralign", self.prefix.bin)
src_bin = join_path(self.stage.source_path, "bin")
with working_dir(src_bin):
install("treeshrink", self.prefix.bin)