Skip to content

Commit

Permalink
grackle: fix url, checksums, deps and sbang (spack#46516)
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored Sep 22, 2024
1 parent 3e0331b commit 2375f87
Showing 1 changed file with 25 additions and 8 deletions.
33 changes: 25 additions & 8 deletions var/spack/repos/builtin/packages/grackle/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import os.path

from spack.hooks.sbang import filter_shebang
from spack.package import *


Expand All @@ -15,23 +16,39 @@ class Grackle(Package):
simulation code
"""

homepage = "http://grackle.readthedocs.io/en/grackle-3.1/"
url = "https://bitbucket.org/grackle/grackle/get/grackle-3.1.tar.bz2"
homepage = "http://grackle.readthedocs.io/en/latest/"
url = "https://github.com/grackle-project/grackle/archive/refs/tags/grackle-3.1.tar.gz"

version("3.1", sha256="504fb080c7f8578c92dcde76cf9e8b851331a38ac76fc4a784df4ecbe1ff2ae8")
version("3.0", sha256="9219033332188d615e49135a3b030963f076b3afee098592b0c3e9f8bafdf504")
version("2.2", sha256="b1d201313c924df38d1e677015f7c31dce42083ef6a0e0936bb9410ccd8a3655")
version("2.0.1", sha256="8f784aaf53d98ddb52b448dc51eb9ec452261a2dbb360170a798693b85165f7d")
version("3.1", sha256="5705985a70d65bc2478cc589ca26f631a8de90e3c8f129a6b2af69db17c01079")
version("3.0", sha256="41e9ba1fe18043a98db194a6f5b9c76a7f0296a95a457d2b7d73311195b7d781")
version("2.2", sha256="5855cb0f93736fd8dd47efeb0abdf36af9339ede86de7f895f527513566c0fae")
version("2.0.1", sha256="bcdf6b3ff7b7515ae5e9f1f3369b2690ed8b3c450040e92a03e40582f57a0864")

variant("float", default=False, description="Build with float")

depends_on("libtool", when="@2.2")
depends_on("libtool", when="@2.2:")

depends_on("c", type="build")
depends_on("fortran", type="build")
depends_on("tcsh", type="build")
depends_on("mpi")
depends_on("hdf5+mpi")

parallel = False

@run_before("install")
def filter_sbang(self):
"""Run before install so that the standard Spack sbang install hook
can fix up the path to the tcsh binary.
"""
tcsh = self.spec["tcsh"].command
with working_dir(self.stage.source_path):
match = "^#!/bin/csh.*"
substitute = f"#!{tcsh}"
filter_file(match, substitute, "configure")
# Since scripts are run during installation, we need to add sbang
filter_shebang("configure")

def install(self, spec, prefix):
template_name = "{0.architecture}-{0.compiler.name}"
grackle_architecture = template_name.format(spec)
Expand Down Expand Up @@ -59,7 +76,7 @@ def install(self, spec, prefix):
filter_file(key, value, makefile)

configure()
with working_dir("src/clib"):
with working_dir(join_path(self.stage.source_path, "src", "clib")):
make("clean")
make("machine-{0}".format(grackle_architecture))
make("opt-high")
Expand Down

0 comments on commit 2375f87

Please sign in to comment.