Skip to content

Commit 57533dc

Browse files
committed
nesfab 1.6 (new formula)
1 parent b1b44bf commit 57533dc

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

Formula/n/nesfab.rb

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
class Nesfab < Formula
2+
desc "Programming language that targets the Nintendo Entertainment System"
3+
homepage "https://pubby.games/nesfab.html"
4+
# for this version only, point to a specific commit. post-1.6, this will point to a tagged release.
5+
url "https://github.com/pubby/nesfab/archive/da18a43dc7b941cc4c56c949303aa37633fdc1b0.tar.gz"
6+
version "1.6"
7+
sha256 "bfd8c497df0d87138fda9e5de61d1ab5a36fb1951eeaed413b6619032b711745"
8+
license "GPL-3.0-only"
9+
10+
depends_on "make" => :build
11+
depends_on "boost"
12+
on_ventura do
13+
depends_on "llvm@18" => :build
14+
end
15+
on_linux do
16+
depends_on "gcc" => :build
17+
end
18+
19+
fails_with :clang do
20+
build 1599
21+
cause "Missing std::lexicographical_compare_three_way"
22+
end
23+
24+
def install
25+
# update this when bumping package version
26+
git_sha = "da18a43d"
27+
28+
if OS.mac? && MacOS.version == :ventura
29+
ENV.llvm_clang
30+
ENV["LDFLAGS"] =
31+
"-L$HOMEBREW_PREFIX/opt/llvm@18/lib/c++ -L$HOMEBREW_PREFIX/opt/llvm@18/lib -lunwind"
32+
end
33+
34+
if OS.mac?
35+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "CXX=#{ENV.cxx}", "release" if Hardware::CPU.intel?
36+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "CXX=#{ENV.cxx}", "ARCH=", "release" if Hardware::CPU.arm?
37+
bin.install "nesfab" => "nesfab-release"
38+
39+
system "make", "clean"
40+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "CXX=#{ENV.cxx}", "debug" if Hardware::CPU.intel?
41+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "CXX=#{ENV.cxx}", "ARCH=", "debug" if Hardware::CPU.arm?
42+
bin.install "nesfab"
43+
else
44+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "release" if Hardware::CPU.intel?
45+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "ARCH=", "release" if Hardware::CPU.arm?
46+
bin.install "nesfab" => "nesfab-release"
47+
48+
system "make", "clean"
49+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "debug" if Hardware::CPU.intel?
50+
system "make", "GIT_COMMIT=#{git_sha}-homebrew", "ARCH=", "debug" if Hardware::CPU.arm?
51+
bin.install "nesfab" => "nesfab"
52+
end
53+
end
54+
55+
test do
56+
system bin/"nesfab", "--version"
57+
end
58+
end

0 commit comments

Comments
 (0)