File indexing completed on 2025-01-18 09:15:26
0001
0002
0003
0004
0005
0006 from spack.package import *
0007 import os
0008
0009
0010 class Dawncut(MakefilePackage):
0011 """DAWNCUT is a tool to generate a 3D scene data clipped with an arbitrary plane.
0012 It reads a source DAWN-format file and outputs a new DAWN-format data,
0013 describing a plane-clipped 3D scene. The output DAWN-format data can be
0014 visualized with Fukui Renderer DAWN.
0015 """
0016
0017
0018 homepage = "https://geant4.kek.jp/~tanaka"
0019 url = "http://geant4.kek.jp/~tanaka/src/dawncut_1_54a.taz"
0020 maintainers = ["sly2j"]
0021
0022 version(
0023 "1_54a",
0024 url="http://geant4.kek.jp/~tanaka/src/dawncut_1_54a.taz",
0025 sha256="531e1f0e2ed35de3e2b1803108c0efb732d83a0c676f14083bd41a71346b4fa9",
0026 expand=False,
0027 )
0028
0029 depends_on("c", type="build")
0030 depends_on("cxx", type="build")
0031
0032 phases = ["unpack", "repatch", "edit", "build", "install"]
0033
0034 def unpack(self, spec, prefix):
0035
0036 def members(tf, tld):
0037 l = len(tld)
0038 for member in tf.getmembers():
0039 if member.path.startswith(tld):
0040 member.path = member.path[l:]
0041 yield member
0042
0043 with working_dir(self.stage.source_path):
0044 import tarfile
0045
0046 install_tar = tarfile.open("dawncut_1_54a.taz")
0047 install_tar.extractall(members=members(install_tar, "dawncut_1_54a/"))
0048
0049 def repatch(self, spec, prefix):
0050
0051 src = self.stage.source_path
0052 patches = self.package_dir
0053 which("patch")("-N", "-l", "-p1", "-i", join_path(patches, "install.patch"))
0054
0055 def edit(self, spec, prefix):
0056 makefile = FileFilter("Makefile")
0057 makefile.filter("CC= .*", "CC = " + env["CC"])
0058 makefile.filter("CXX = .*", "CXX = " + env["CXX"])
0059 os.environ["INSTALL_DIR"] = "{}/bin".format(prefix)