Skip to content

Commit 0dd02ce

Browse files
Update sunshine.rb
1 parent d8d6f2e commit 0dd02ce

File tree

1 file changed

+9
-16
lines changed

1 file changed

+9
-16
lines changed

packaging/sunshine.rb

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class Sunshine < Formula
2828

2929
depends_on "cmake" => :build
3030
depends_on "doxygen" => :build
31+
depends_on "gcc@14" => [:build, :test]
3132
depends_on "graphviz" => :build
3233
depends_on "node" => :build
3334
depends_on "pkgconf" => :build
@@ -43,7 +44,6 @@ class Sunshine < Formula
4344
end
4445

4546
on_linux do
46-
depends_on "gcc@14" => [:build, :test]
4747
depends_on "avahi"
4848
depends_on "gnu-which"
4949
depends_on "libayatana-appindicator"
@@ -81,12 +81,10 @@ def install
8181
ENV["BUILD_VERSION"] = "@BUILD_VERSION@"
8282
ENV["COMMIT"] = "@GITHUB_COMMIT@"
8383

84-
# Ensure we use GCC 14 consistently on Linux
85-
if OS.linux?
86-
gcc14 = Formula["gcc@14"]
87-
ENV["CC"] = "#{gcc14.opt_bin}/gcc-14"
88-
ENV["CXX"] = "#{gcc14.opt_bin}/g++-14"
89-
end
84+
# Use GCC because gcov from llvm cannot handle our paths
85+
gcc14 = Formula["gcc@14"]
86+
ENV["CC"] = "#{gcc14.opt_bin}/gcc-14"
87+
ENV["CXX"] = "#{gcc14.opt_bin}/g++-14"
9088

9189
args = %W[
9290
-DBUILD_WERROR=ON
@@ -190,22 +188,17 @@ def caveats
190188

191189
# Change to the source directory for gcovr to work properly
192190
cd "#{buildpath}/build" do
193-
# Use the same GCC version that was used for compilation
194-
gcov_executable = "#{Formula["llvm"].opt_bin}/llvm-cov gcov"
195-
196-
if OS.linux?
197-
# Use GCC 14 to match what was used during compilation
198-
gcc14 = Formula["gcc@14"]
199-
gcov_executable = "#{gcc14.opt_bin}/gcov-14"
200-
end
191+
# Use GCC 14 to match what was used during compilation
192+
gcc14 = Formula["gcc@14"]
193+
gcov_executable = "#{gcc14.opt_bin}/gcov-14"
201194

202195
system "gcovr", ".",
203196
"-r", "../src",
204197
"--gcov-executable", gcov_executable,
205198
"--exclude-noncode-lines",
206199
"--exclude-throw-branches",
207200
"--exclude-unreachable-branches",
208-
"--verbose", # TODO: remove verbose once working
201+
"--verbose", # TODO: remove verbose once working
209202
"--xml-pretty",
210203
"-o=#{testpath}/coverage.xml"
211204
end

0 commit comments

Comments
 (0)