Skip to content
Open
Changes from all 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
21 changes: 17 additions & 4 deletions Formula/b/bsc.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
class Bsc < Formula
desc "Bluespec Compiler (BSC)"
homepage "https://github.com/B-Lang-org/bsc"
url "https://github.com/B-Lang-org/bsc.git",
tag: "2025.01.1",
revision: "65e3a87a17f6b9cf38cbb7b6ad7a4473f025c098"
license "BSD-3-Clause"
head "https://github.com/B-Lang-org/bsc.git", branch: "main"

stable do
url "https://github.com/B-Lang-org/bsc.git",
tag: "2025.01.1",
revision: "65e3a87a17f6b9cf38cbb7b6ad7a4473f025c098"

# Backport support for TCL 9
patch do
url "https://github.com/B-Lang-org/bsc/commit/8dbe999224a5d7d644e11274e696ea3536026683.patch?full_index=1"
sha256 "2a17f251216fbf874804ff7664ffd863767969f9b7a7cfe6858b322b1acc027e"
end
patch do
url "https://github.com/B-Lang-org/bsc/commit/36da7029be8ae11e8889db9a312f514663e44b96.patch?full_index=1"
sha256 "ba76094403b68d16c47ee4fae124dec4cb2664e4391dc37a06082bde1a23bf72"
end
end

no_autobump! because: :requires_manual_review

bottle do
Expand All @@ -27,12 +40,12 @@ class Bsc < Formula
depends_on "pkgconf" => :build
depends_on "gmp"
depends_on "icarus-verilog"
depends_on "tcl-tk@8"

uses_from_macos "bison" => :build
uses_from_macos "flex" => :build
uses_from_macos "libffi"
uses_from_macos "perl"
uses_from_macos "tcl-tk"
Copy link
Member

Choose a reason for hiding this comment

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

macOS tcl-tk is old and deprecated; we probably shouldn't be using it anymore.

Copy link
Member Author

Choose a reason for hiding this comment

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

Would need upstream changes as they specifically set to system copy - https://github.com/B-Lang-org/bsc/blob/main/platform.sh#L81-L86

if [ ${OSTYPE} = "Darwin" ] ; then
    # Have Makefile avoid Homebrew's install of tcl on Mac
    TCLSH=/usr/bin/tclsh
else
    TCLSH=`which tclsh`
fi

Copy link
Contributor

@gromgit gromgit Sep 6, 2025

Choose a reason for hiding this comment

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

Probably worth clarifying with upstream if this change, introduced over 4 years ago, still makes sense, especially since:-

sonoma$ /usr/bin/tclsh

WARNING: This version of tcl is included in macOS for compatibility with legacy software.
In future versions of macOS the tcl runtime will not be available by
default, and may require you to install an additional package.

% 

Copy link
Member Author

@cho-m cho-m Sep 6, 2025

Choose a reason for hiding this comment

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

Maybe I'll try make TCLSH=... to see if it overrides lookup.

EDIT: insufficient as still used to find tclversion and tclinc:

Using tclsh: /opt/homebrew/opt/tcl-tk/bin/tclsh
Tcl version: 8.5
Using Tcl defines: TCL85
Using tcl include flags: 
Using tcl library flags: -ltcl8.5

Copy link
Member Author

@cho-m cho-m Sep 6, 2025

Choose a reason for hiding this comment

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

Upstream should be aware that system Tcl is outdated and has mentioned interest in moving away from it back in 2022:

Someone in issue discussion patched out the system Tcl logic like: kammoh/bsc@ded6d77


conflicts_with "libbsc", because: "both install `bsc` binaries"

Expand Down
Loading