professor: set PWD in environment
This commit is contained in:
parent
f321833a64
commit
5b3d0cc67d
@ -3,6 +3,7 @@
|
|||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
import spack.util.environment
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -52,7 +53,6 @@ def url_for_version(self, version):
|
|||||||
return f"https://professor.hepforge.org/downloads/?f=Professor-{version}.tar.gz"
|
return f"https://professor.hepforge.org/downloads/?f=Professor-{version}.tar.gz"
|
||||||
|
|
||||||
def setup_build_environment(self, env: EnvironmentModifications) -> None:
|
def setup_build_environment(self, env: EnvironmentModifications) -> None:
|
||||||
env.set("PROF_ROOT", self.stage.source_path)
|
|
||||||
env.set("PROF_VERSION", self.spec.version)
|
env.set("PROF_VERSION", self.spec.version)
|
||||||
|
|
||||||
@run_before("install")
|
@run_before("install")
|
||||||
@ -65,7 +65,9 @@ def configure(self):
|
|||||||
|
|
||||||
def install(self, spec, prefix):
|
def install(self, spec, prefix):
|
||||||
with working_dir(self.stage.source_path):
|
with working_dir(self.stage.source_path):
|
||||||
make()
|
# Makefile sets PROF_ROOT to PWD but that is not set for root user in CI
|
||||||
make(f"PREFIX={prefix}", "install")
|
with spack.util.environment.set_env(PWD=self.stage.source_path):
|
||||||
if self.spec.satisfies("~interactive"):
|
make()
|
||||||
os.remove(join_path(prefix.bin, "prof2-I"))
|
make(f"PREFIX={prefix}", "install")
|
||||||
|
if self.spec.satisfies("~interactive"):
|
||||||
|
os.remove(join_path(prefix.bin, "prof2-I"))
|
||||||
|
Loading…
Reference in New Issue
Block a user