Skip to content

Commit

Permalink
Add build for B-lang-org/bsc-contrib repo as 'bluespec-libraries' tar…
Browse files Browse the repository at this point in the history
…get, also add 'bluespec' alias (#404)

'bluespec-libraries' builds and installs the B-lang-org/bsc-contrib repo
into the local install.

'bluespec' is a dummy target which depends on 'bluespec-libraries' which
depends on 'bluespec-compiler', so building 'bluespec' with dependencies
builds both.

Upstream bluespec-compiler's makefile tends to rebuild all its BSV files
even if nothing changed, so building 'bluespec-libraries' also causes the
BSV inside bluespec-compiler to get rebuilt.  Not sure if there's an easy
solution for this.
  • Loading branch information
tmarkettos committed Aug 12, 2024
1 parent 0bbf3cc commit ed00235
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions pycheribuild/projects/bluespec_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
# SUCH DAMAGE.
#
from .project import DefaultInstallDir, GitRepository, MakeCommandKind, Project
from .simple_project import TargetAliasWithDependencies
from ..utils import OSInfo


Expand Down Expand Up @@ -86,3 +87,26 @@ def install(self, **kwargs):

def run_tests(self) -> None:
self.run_cmd("check-smoke")


class BuildBluespecLibraries(Project):
target = "bluespec-libraries"
dependencies = ("bluespec-compiler",)
default_directory_basename = "bsc-contrib"
repository = GitRepository("https://github.com/B-Lang-org/bsc-contrib.git")
native_install_dir = DefaultInstallDir.BOOTSTRAP_TOOLS
build_in_source_dir = True
make_kind = MakeCommandKind.GnuMake

def compile(self, **kwargs):
self.make_args.set(PREFIX=self.install_dir)
self.run_make("all")

def clean(self):
self.make_args.set(PREFIX=self.install_dir)
self.run_make("full_clean", cwd=self.source_dir)


class BuildBluespec(TargetAliasWithDependencies):
target = "bluespec"
dependencies = ("bluespec-libraries",)

0 comments on commit ed00235

Please sign in to comment.