Racket package: disable parallel build; add variants (#27506)

- Prevent `-j` flags to `make`, which has been known to cause problems
  with Racket builds.
- Add variants for various common build flags, including support
  for both versions of the Racket VM environment.

In addition:

- Prefer the minimal release to improve install times. Bells and
  whistles carry their own runtime dependencies and should be
  installed via `raco`. An enterprising user may even create a
  `RacoPackage` class to make spack aware of `raco` installed packages.
- Match the official version numbering scheme.
This commit is contained in:
Thomas Dickerson 2021-11-23 19:45:18 -05:00 committed by GitHub
parent dfc95cdf1c
commit c263b64d2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,28 +11,57 @@ class Racket(Package):
homepage = "https://www.racket-lang.org" homepage = "https://www.racket-lang.org"
maintainers = ['arjunguha'] maintainers = ['arjunguha', 'elfprince13']
version('8.3.0', 'c4af1a10b957e5fa0daac2b5ad785cda79805f76d11482f550626fa68f07b949') version('8.3', '3b963cd29ae119e1acc2c6dc4781bd9f25027979589caaae3fdfc021aac2324b')
depends_on('libffi', type=('build', 'link', 'run')) depends_on('libffi', type=('build', 'link', 'run'))
depends_on('patchutils') depends_on('patchutils')
depends_on('libtool', type=('build'))
phases = ['configure', 'build', 'install'] phases = ['configure', 'build', 'install']
def url_for_version(self, version): def url_for_version(self, version):
url = "http://mirror.racket-lang.org/installers/{0}/racket-src.tgz" return "https://mirror.racket-lang.org/installers/{0}/racket-minimal-{0}-src-builtpkgs.tgz".format(version)
return url.format(version.up_to(2))
variant('cs', default=True, description='Build Racket CS (new ChezScheme VM)')
variant('bc', default=False, description='Build Racket BC (old MZScheme VM)')
variant('shared', default=True, description="Enable shared")
variant('jit', default=True, description="Just-in-Time Compilation")
parallel = False
extendable = True
def toggle(self, spec, variant):
toggle_text = ("enable" if spec.variants[variant].value else "disable")
return "--{0}-{1}".format(toggle_text, variant)
def configure(self, spec, prefix): def configure(self, spec, prefix):
with working_dir('src'): with working_dir('src'):
configure = Executable('./configure') configure = Executable("./configure")
configure("--prefix", prefix) configure_args = [self.toggle(spec, 'cs'),
self.toggle(spec, 'bc'),
self.toggle(spec, 'jit')]
toggle_shared = self.toggle(spec, 'shared')
if sys.platform == 'darwin':
configure_args += ["--enable-macprefix"]
if "+xonx" in spec:
configure_args += ["--enable-xonx", toggle_shared]
else:
configure_args += [toggle_shared]
configure_args += ["--prefix={0}".format(prefix)]
configure(*configure_args)
def build(self, spec, prefix): def build(self, spec, prefix):
with working_dir('src'): with working_dir('src'):
make() if spec.variants["bc"].value:
make("bc")
if spec.variants["cs"].value:
make("cs")
def install(self, spec, prefix): def install(self, spec, prefix):
with working_dir('src'): with working_dir('src'):
make('install') if spec.variants["bc"].value:
make('install-bc')
if spec.variants["cs"].value:
make('install-cs')