Skip to content

Use GCC for build ... the object files are compat with clang FFS #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
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
27 changes: 13 additions & 14 deletions Formula/gerbil-scheme.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,19 @@ class GerbilScheme < Formula
desc "Opinionated dialect of Scheme designed for Systems Programming"
homepage "https://cons.io"
url "https://github.com/mighty-gerbils/gerbil.git",
using: :git, revision: "92b1a2f642d6ebbcd3bd223ccc0af7ec0d9a42ad"
using: :git, revision: "c5546da0bfdc3aa17c66fe1307038bc727ed0816"
version "0.18.1"
license any_of: ["LGPL-2.1-or-later", "Apache-2.0"]
# revision 3
revision 1
head "https://github.com/mighty-gerbils/gerbil.git", using: :git, branch: "master"

bottle do
root_url "https://github.com/mighty-gerbils/homebrew-gerbil/releases/download/gerbil-scheme-0.18.1"
sha256 arm64_sonoma: "58175d28302fde3403f454ecec5ffa76edd9c452d3f97d0060f39300c7ef3aae"
sha256 ventura: "0c432f016e9c0e0ec0324f655a63fd3a90633fc9f77b18a693125b49c08a9fee"
sha256 monterey: "f2a1d37c331248b88762ece4a0c0b57b2c6efdd2012be69cb526352b64df594f"
sha256 x86_64_linux: "748cd86ebcba934e24aeafef7b5ee0b0b5b94ee24823a6e3cbb13f17aae6ed11"
end

depends_on "coreutils" => :build
depends_on "pkg-config" => :build
depends_on "openssl@3"
depends_on "sqlite"
depends_on "zlib"
on_macos do
depends_on "llvm"
depends_on "gcc@13"
end
on_linux do
depends_on "gcc@13"
Expand All @@ -32,22 +24,29 @@ class GerbilScheme < Formula
version "12" # Select new gcc
cause "Make it easy with all the same"
end
fails_with :clang do
cause "Must be GCC"
end

def install
nproc = `nproc`.to_i - 1

if OS.mac?
ENV.prepend_path("PATH", "/usr/local/opt/llvm/bin")
ENV.prepend_path("PATH", "/opt/homebrew/opt/llvm/bin")
ENV.prepend_path("PATH", "/usr/local/opt/gcc/bin")
ENV.prepend_path("PATH", "/opt/homebrew/opt/gcc/bin")
ENV["LDFLAGS"] = "-Wl,-ld_classic"
end

if OS.linux?
ENV.prepend_path("PATH", "/home/linuxbrew/.linuxbrew/bin")
ENV.prepend_path("PATH", "/home/linuxbrew/.linuxbrew/sbin")
end

ENV["GERBIL_GCC"] = ENV.cc.to_s
ENV["CC"] = ENV.cc.to_s
ENV["CXX"] = ENV.cxx.to_s
ENV["GERBIL_BUILD_CORES"] = nproc.to_s

system "echo", ENV.cc.to_s
system ENV.cc.to_s, "--version"
system "./configure", "--prefix=#{prefix}", "--enable-march="
system "make", "-j#{nproc}"
Expand Down
23 changes: 18 additions & 5 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@ brew install mighty-gerbils/gerbil/gerbil-scheme

* How do I install these formulae?

`brew install mighty-gerbils/gerbil/<formula>`
~brew install mighty-gerbils/gerbil/<formula>~

Or ~brew tap mighty-gerbils/gerbil~ and then ~brew install <formula>~.

** Build the HEAD of Master

Sometimes, like for testing pre-release, we want to build and test the
lastest commit to the =master= branch.

#+begin_src sh
brew install mighty-gerbils/gerbil/gerbil-scheme
#+end_src

Or `brew tap mighty-gerbils/gerbil` and then `brew install <formula>`.

* Documentation

Expand Down Expand Up @@ -119,10 +129,13 @@ These packages are literate and tangled from this README.org.

* HACKING

Trying to make it work for the github thing means fixing a bunch.
Trying to make it work for the github thing often means fixing a of
whitespace and other styles that are frowned upon.

==> brew style --fix mighty-gerbils/gerbil/gerbil-scheme

brew audit mighty-gerbils/gerbil/gerbil-scheme --online --new
#+begin_src sh
brew style --fix mighty-gerbils/gerbil/gerbil-scheme

brew audit mighty-gerbils/gerbil/gerbil-scheme --online --new
#+end_src