Skip to content

Commit

Permalink
huexpress: add build patch for newer clang
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Sep 15, 2024
1 parent d3cbc6d commit f9dce93
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Formula/h/huexpress.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ class Huexpress < Formula
depends_on "mesa-glu"
end

# Workaround for newer Clang
# upstream bug report, https://github.com/kallisti5/huexpress/issues/19
patch :DATA

def install

Check failure on line 39 in Formula/h/huexpress.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew install --verbose --formula --build-bottle huexpress` failed on Linux!

huexpress.cpp /usr/bin/gcc-11 -o src/iniconfig.o -c -g -pthread -DVERSION_MAJOR=3 -DVERSION_MINOR=0 -DVERSION_UPDATE=4 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -D_REENTRANT -Isrc/includes -Isrc/engine -I/home/linuxbrew/.linuxbrew/include/SDL2 -I/home/linuxbrew/.linuxbrew/Cellar/libxmp/4.6.0/include -I/home/linuxbrew/.linuxbrew/Cellar/fluid-synth/2.3.6/include -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/include -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/include/glib-2.0 -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/lib/glib-2.0/include -I/home/linuxbrew/.linuxbrew/Cellar/pcre2/10.44/include -I/home/linuxbrew/.linuxbrew/Cellar/libsndfile/1.2.2/include -I/home/linuxbrew/.linuxbrew/Cellar/libvorbis/1.3.7/include -I/home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/include -I/home/linuxbrew/.linuxbrew/Cellar/portaudio/19.7.0/include -I/home/linuxbrew/.linuxbrew/Cellar/jack/1.9.22_1/include -I/home/linuxbrew/.linuxbrew/Cellar/systemd/256.5/include -I/home/linuxbrew/.linuxbrew/Cellar/readline/8.2.13/include -I/home/linuxbrew/.linuxbrew/Cellar/ncurses/6.5/include/ncursesw -I/home/linuxbrew/.linuxbrew/Cellar/ncurses/6.5/include -I/home/linuxbrew/.linuxbrew/Cellar/game-music-emu/0.6.3_2/include -I/home/linuxbrew/.linuxbrew/Cellar/flac/1.4.3/include -I/home/linuxbrew/.linuxbrew/Cellar/mpg123/1.32.7/include -I/home/linuxbrew/.linuxbrew/Cellar/opusfile/0.12_1/include/opus -I/home/linuxbrew/.linuxbrew/Cellar/libogg/1.3.5/include -I/home/linuxbrew/.linuxbrew/Cellar/opus/1.5.2/include/opus -I/home/linuxbrew/.linuxbrew/Cellar/wavpack/5.7.0/include -I/home/linuxbrew/.linuxbrew/Cellar/libzip/1.10.1/include src/iniconfig.c src/iniconfig.c: In function ‘parse_INIfile’: src/iniconfig.c:527:34: warning: ‘%s’ directive writing 13 bytes into a region of size between 0 and 4095 [-Wformat-overflow=] 527 | sprintf(config_file, "%s/%s", config_basepath, SETTINGS_FILENAME); | ^~ src/iniconfig.c:527:9: note: ‘sprintf’ output between 15 and 4110 bytes into a destination of size 4096 527 | sprintf(config_file, "%s/%s", config_basepath, SETTINGS_FILENAME); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ src/iniconfig.c: In function ‘save_config’: src/iniconfig.c:726:34: warning: ‘/huexpress.ini’ directive writing 14 bytes into a region of size between 1 and 4096 [-Wformat-overflow=] 726 | sprintf (config_name, "%s/huexpress.ini", config_basepath); | ^~~~~~~~~~~~~~ src/iniconfig.c:726:9: note: ‘sprintf’ output between 15 and 4110 bytes into a destination of size 4096 726 | sprintf (config_name, "%s/huexpress.ini", config_basepath); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/bin/gcc-11 -o src/view_inf.o -c -g -pthread -DVERSION_MAJOR=3 -DVERSION_MINOR=0 -DVERSION_UPDATE=4 -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=600 -D_REENTRANT -Isrc/includes -Isrc/engine -I/home/linuxbrew/.linuxbrew/include/SDL2 -I/home/linuxbrew/.linuxbrew/Cellar/libxmp/4.6.0/include -I/home/linuxbrew/.linuxbrew/Cellar/fluid-synth/2.3.6/include -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/include -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/include/glib-2.0 -I/home/linuxbrew/.linuxbrew/Cellar/glib/2.82.0/lib/glib-2.0/include -I/home/linuxbrew/.linuxbrew/Cellar/pcre2/10.44/include -I/home/linuxbrew/.linuxbrew/Cellar/libsndfile/1.2.2/include -I/home/linuxbrew/.linuxbrew/Cellar/libvorbis/1.3.7/include -I/home/linuxbrew/.linuxbrew/Cellar/alsa-lib/1.2.12/include -I/home/linuxbrew/.linuxbrew/Cellar/portaudio/19.7.0/include -I/home/linuxbrew/.linuxbrew/Cellar/jack/1.9.22_1/include -I/home/linuxbrew/.linuxbrew/Cellar/systemd/256.5/include -I/home/linuxbrew/.linuxbrew/Cellar/readline/8.2.13/include -I/home/linuxbrew/.linuxbrew/Cellar/ncurses/6.5/include/ncursesw -I/home/linuxbrew/.linuxbrew/Cellar/ncurses/6.5/include -I/home/linuxbrew/.linuxbrew/Cellar/game-music-emu/0.6.3_2/include -I/home/linuxbrew/.linuxbrew/Cellar/flac/1.4.3/include -I/home/linuxbrew/.linuxbrew/Cellar/mpg123/1.32.7/include -I/home/li
# Don't statically link to libzip.
inreplace "src/SConscript", "pkg-config --cflags --libs --static libzip", "pkg-config --cflags --libs libzip"
Expand All @@ -43,3 +47,22 @@ def install
assert_match(/Version #{version}$/, shell_output("#{bin}/huexpress -h", 1))
end
end

__END__
diff --git a/SConstruct b/SConstruct
index 096a1ef..98216b9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -40,5 +40,12 @@ env.Append(CPPDEFINES={'VERSION_MAJOR' : '3'})
env.Append(CPPDEFINES={'VERSION_MINOR' : '0'})
env.Append(CPPDEFINES={'VERSION_UPDATE' : '4'})

+# Workaround for newer Clang
+clang_version = env['CCVERSION']
+if env['PLATFORM'] == 'darwin' and 'clang' in env['CC']:
+ clang_version_parts = [int(part) for part in clang_version.split('.')]
+ if clang_version_parts >= [15, 0, 0]:
+ env.Append(CFLAGS=['-Wno-incompatible-function-pointer-types', '-Wno-int-conversion']) # Pass as separate flags
+
Export("env")
SConscript('src/SConscript')

0 comments on commit f9dce93

Please sign in to comment.