Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions anda/buildsys/bsc/anda.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
project pkg {
rpm {
spec = "bsc.spec"
}
}
84 changes: 84 additions & 0 deletions anda/buildsys/bsc/bsc.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
%define debug_package %{nil}
%global __provides_exclude_from ^%{_libdir}/bsc/SAT/.*
%global __requires_exclude libstp\\.so\\.1|libyices\\.so\\.2\\.6

Name: bsc
Version: 2025.07
Release: 1%{?dist}
Summary: Bluespec Compiler (BSC)

License: BSD-3-Clause AND BSD-2-Clause AND MIT AND LGPL-2.0-or-later AND AND BSL-1.0
URL: https://github.com/B-Lang-org/bsc
Source: %{url}/archive/refs/tags/%{version}.tar.gz

BuildRequires: ghc
BuildRequires: ghc-regex-compat-devel
BuildRequires: ghc-syb-devel
BuildRequires: ghc-old-time-devel
BuildRequires: ghc-split-devel
BuildRequires: gperf
BuildRequires: gcc-c++
BuildRequires: autoconf
BuildRequires: flex
BuildRequires: bison
BuildRequires: zlib-devel
Comment thread
Owen-sz marked this conversation as resolved.
Outdated
BuildRequires: tcl-devel
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEAK ALERT


# For check
BuildRequires: binutils
BuildRequires: iverilog

Provides: bundled(stp)
Provides: bundled(yices)

Packager: Owen Zimmerman <owen@fyralabs.com>

%description
Compiler, simulator, and tools for the Bluespec Hardware Description Language.
Bluespec is a single language for digital electronic hardware designs that
comes in two syntactic flavors, which are interchangeable:

Bluespec SystemVerilog (BSV)
Bluespec Haskell (BH, or "Bluespec Classic")

Bluespec is a high-level hardware description language. It has a variety of
advanced features including a powerful type system that can prevent errors prior
to synthesis time, and its most distinguishing feature, Guarded Atomic Actions,
allow you to define hardware components in a modular manner based on their
invariants, and let the compiler pick a scheduler.

%prep
%git_clone %{url} %{version}

%build
%make_build install-src GHCJOBS=%{_smp_build_ncpus}

%install
mkdir -p %{buildroot}%{_datadir}/bsc/
mkdir -p %{buildroot}%{_bindir}
cp -r inst/ %{buildroot}%{_datadir}/bsc/

# https://github.com/B-Lang-org/bsc/blob/main/INSTALL.md#overview
# Note this is symlinking the wrapper scripts, not the ELFs
%{__ln_s} -f %{_datadir}/bsc/inst/bin/bsc %{buildroot}%{_bindir}/bsc
%{__ln_s} -f %{_datadir}/bsc/inst/bin/bluetcl %{buildroot}%{_bindir}/bluetcl

# Patch wrapper scripts to use correct paths
for wrapper in %{buildroot}%{_datadir}/bsc/inst/bin/bsc %{buildroot}%{_datadir}/bsc/inst/bin/bluetcl; do
sed -i 's|BLUESPECDIR="$(cd ${BINDIR}/../lib; echo $PWD)"|BLUESPECDIR="%{_datadir}/bsc/inst/lib"|' $wrapper
sed -i 's|BLUESPECEXEC=${BINDIR}/core/${SCRIPTNAME}|BLUESPECEXEC="%{_datadir}/bsc/inst/bin/core/${SCRIPTNAME}"|' $wrapper
done

%check
%{make_build} check-smoke

%files
%doc README.md DEVELOP.md
%license COPYING LICENSES/
%{_bindir}/bsc
%{_bindir}/bluetcl
%{_datadir}/bsc/*

%changelog
* Fri Apr 24 2026 Owen Zimmerman <owen@fyralabs.com>
- Initial commit
1 change: 1 addition & 0 deletions anda/buildsys/bsc/update.rhai
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpm.version(gh("B-Lang-org/bsc"));
Loading