banister / texplay

image manipulation tool for ruby and gosu
66 stars 16 forks source link

Texplay not building (neither 0.4.3 nor 0.4.4-pre) in Ruby 3 / macOS Big Sur #35

Open chesterbr opened 3 years ago

chesterbr commented 3 years ago

0.4.3 fails like in #30 (can't find glut.h), 0.4.4-pre (building directly from default branch in GitHub) has some different errors (see below).

Installing freeglut via Homebrew (as suggested here) doesn't change either.

Details

Texplay versions: 0.4.3 and 0.4.4-pre (from source) Ruby version: 3.0.0 macOS version: 11.1 (20C69)

0.4.3 error log ``` current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/texplay-0.4.3/ext/texplay /Users/chesterbr/.rbenv/versions/3.0.0/bin/ruby -I /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210110-19233-68a8ss.rb extconf.rb creating Makefile current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/texplay-0.4.3/ext/texplay make "DESTDIR=" clean current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/texplay-0.4.3/ext/texplay make "DESTDIR=" compiling actions.c In file included from actions.c:1: ./texplay.h:32:3: error: expected identifier false, true ^ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:17:15: note: expanded from macro 'false' #define false 0 ^ In file included from actions.c:1: ./texplay.h:32:10: error: expected identifier false, true ^ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:16:14: note: expanded from macro 'true' #define true 1 ^ In file included from actions.c:1: ./texplay.h:33:2: error: expected ';' after enum } bool; ^ ; ./texplay.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef enum e_bool { ^~~~~~~ ./texplay.h:33:3: warning: declaration does not declare anything [-Wmissing-declarations] } bool; ^~~~ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool' #define bool _Bool ^~~~~ In file included from actions.c:1: ./texplay.h:41:3: error: redefinition of 'sync' as different kind of symbol } sync; ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:598:7: note: previous definition is here void sync(void); ^ In file included from actions.c:1: ./texplay.h:96:3: error: unknown type name 'sync' sync sync_mode; ^ In file included from actions.c:3: ./graphics_utils.h:9:71: error: unknown type name 'sync' sync sync_mode, bool primary, action_struct ** payload_ptr); ^ In file included from actions.c:4: ./actions.h:14:71: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] trace_match line_do_action(int, int, int, int, texture_info *, VALUE, sync, bool primary, action_struct * payload); ^ ./actions.h:17:61: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] void circle_do_action(int, int, int, texture_info *, VALUE, sync, bool primary, action_struct * payload); ^ ./actions.h:20:55: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] void pixel_do_action(int, int, texture_info *, VALUE, sync, bool primary, action_struct * payload); ^ ./actions.h:24:21: error: unknown type name 'sync' sync sync_mode, bool primary, action_struct * payload); ^ ./actions.h:27:77: error: unknown type name 'sync' void flood_fill_do_action(int x, int y, texture_info * tex, VALUE hash_arg, sync sync_mode, bool primary, ^ ./actions.h:31:76: error: unknown type name 'sync' void glow_fill_do_action(int x, int y, texture_info * tex, VALUE hash_arg, sync sync_mode, bool primary, ^ ./actions.h:36:26: error: unknown type name 'sync' sync sync_mode, bool primary, action_struct * payload); ^ ./actions.h:39:75: error: unknown type name 'sync' void polyline_do_action(VALUE points, texture_info * tex, VALUE hash_arg, sync sync_mode, bool primary, ^ ./actions.h:43:73: error: unknown type name 'sync' void bezier_do_action(VALUE points, texture_info * tex, VALUE hash_arg, sync sync_mode, bool primary, ^ ./actions.h:48:21: error: unknown type name 'sync' sync sync_mode, bool primary, action_struct * payload); ^ ./actions.h:53:59: error: unknown type name 'sync' texture_info * tex, VALUE hash_arg, sync sync_mode, ^ ./actions.h:58:27: error: unknown type name 'sync' sync sync_mode, bool primary, action_struct * payload); ^ actions.c:8:11: fatal error: 'glut.h' file not found # include ^~~~~~~~ 5 warnings and 16 errors generated. make: *** [actions.o] Error 1 make failed, exit code 2 ```
0.4.4-pre error log ``` current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/bundler/gems/texplay-a7055d39aee3/ext/texplay /Users/chesterbr/.rbenv/versions/3.0.0/bin/ruby -I /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210110-20519-w59fcz.rb extconf.rb creating Makefile current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/bundler/gems/texplay-a7055d39aee3/ext/texplay make "DESTDIR=" clean current directory: /Users/chesterbr/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/bundler/gems/texplay-a7055d39aee3/ext/texplay make "DESTDIR=" compiling actions.c In file included from actions.c:1: ./texplay.h:32:3: error: expected identifier false, true ^ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:17:15: note: expanded from macro 'false' #define false 0 ^ In file included from actions.c:1: ./texplay.h:32:10: error: expected identifier false, true ^ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:16:14: note: expanded from macro 'true' #define true 1 ^ In file included from actions.c:1: ./texplay.h:33:2: error: expected ';' after enum } bool; ^ ; ./texplay.h:31:1: warning: typedef requires a name [-Wmissing-declarations] typedef enum e_bool { ^~~~~~~ ./texplay.h:33:3: warning: declaration does not declare anything [-Wmissing-declarations] } bool; ^~~~ /Library/Developer/CommandLineTools/usr/lib/clang/12.0.0/include/stdbool.h:15:14: note: expanded from macro 'bool' #define bool _Bool ^~~~~ actions.c:57:40: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(has_optional_hash_arg(hash_arg, "thickness")) ^~~~~~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:58:53: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] thickness = NUM2INT(get_from_hash(hash_arg, "thickness")); ^~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:60:40: warning: passing 'const char [6]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(has_optional_hash_arg(hash_arg, "trace") && primary) { ^~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:61:50: warning: passing 'const char [6]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE trace_hash = get_from_hash(hash_arg, "trace"); ^~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:69:44: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(has_optional_hash_arg(trace_hash, "until_color")) { ^~~~~~~~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:70:45: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE c = get_from_hash(trace_hash, "until_color"); ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:74:49: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] else if(has_optional_hash_arg(trace_hash, "while_color")) { ^~~~~~~~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:75:45: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE c = get_from_hash(trace_hash, "while_color"); ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:118:42: warning: passing 'const char [5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] set_hash_value(hash_arg, "fill", Qtrue); ^~~~~~ ./utils.h:57:41: note: passing argument to parameter 'sym' here VALUE set_hash_value(VALUE hash, char * sym, VALUE val); ^ actions.c:146:42: warning: passing 'const char [5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] set_hash_value(hash_arg, "fill", Qtrue); ^~~~~~ ./utils.h:57:41: note: passing argument to parameter 'sym' here VALUE set_hash_value(VALUE hash, char * sym, VALUE val); ^ actions.c:171:34: warning: passing 'const char [5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] set_hash_value(hash_arg, "fill", Qtrue); ^~~~~~ ./utils.h:57:41: note: passing argument to parameter 'sym' here VALUE set_hash_value(VALUE hash, char * sym, VALUE val); ^ actions.c:235:42: warning: passing 'const char [7]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "closed")) || RTEST(get_from_hash(hash_arg, "close"))) { ^~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:235:86: warning: passing 'const char [6]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "closed")) || RTEST(get_from_hash(hash_arg, "close"))) { ^~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:249:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] num_point_pairs = RARRAY_LEN(points); ~ ^~~~~~~~~~~~~~~~~~ /Users/chesterbr/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/internal/core/rarray.h:52:36: note: expanded from macro 'RARRAY_LEN' #define RARRAY_LEN rb_array_len ^ actions.c:264:46: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] num_point_pairs = RARRAY_LEN(points) / 2; ~ ~~~~~~~~~~~~~~~~~~~^~~ actions.c:302:42: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "thickness"))) { ^~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:303:57: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] thickness = NUM2INT(get_from_hash(hash_arg, "thickness")); ^~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:312:42: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "start_angle"))) { ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:313:53: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] angle = NUM2INT(get_from_hash(hash_arg, "start_angle")) / 360.0 * 2 * PI; ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:354:42: warning: passing 'const char [5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "fill")) || RTEST(get_from_hash(hash_arg, "filled"))) { ^~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:354:84: warning: passing 'const char [7]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "fill")) || RTEST(get_from_hash(hash_arg, "filled"))) { ^~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:358:40: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] delete_from_hash(hash_arg, "thickness"); ^~~~~~~~~~~ ./utils.h:60:43: note: passing argument to parameter 'sym' here VALUE delete_from_hash(VALUE hash, char * sym); ^ actions.c:360:47: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] else if(RTEST(get_from_hash(hash_arg, "thickness"))) { ^~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:361:57: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] thickness = NUM2INT(get_from_hash(hash_arg, "thickness")); ^~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:409:42: warning: passing 'const char [5]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "fill")) || RTEST(get_from_hash(hash_arg, "filled"))) { ^~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:409:84: warning: passing 'const char [7]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "fill")) || RTEST(get_from_hash(hash_arg, "filled"))) { ^~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:414:40: warning: passing 'const char [10]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] delete_from_hash(hash_arg, "thickness"); ^~~~~~~~~~~ ./utils.h:60:43: note: passing argument to parameter 'sym' here VALUE delete_from_hash(VALUE hash, char * sym); ^ actions.c:630:51: warning: passing 'const char [8]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE try_image = get_from_hash(hash_arg, "texture"); ^~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:818:42: warning: passing 'const char [7]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "closed")) || RTEST(get_from_hash(hash_arg, "close"))) { ^~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:818:86: warning: passing 'const char [6]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "closed")) || RTEST(get_from_hash(hash_arg, "close"))) { ^~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:826:42: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(RTEST(get_from_hash(hash_arg, "sample_size"))) { ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:827:47: warning: passing 'const char [12]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE c = get_from_hash(hash_arg, "sample_size"); ^~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:839:27: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] num_point_pairs = RARRAY_LEN(points); ~ ^~~~~~~~~~~~~~~~~~ /Users/chesterbr/.rbenv/versions/3.0.0/include/ruby-3.0.0/ruby/internal/core/rarray.h:52:36: note: expanded from macro 'RARRAY_LEN' #define RARRAY_LEN rb_array_len ^ actions.c:853:46: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32] num_point_pairs = RARRAY_LEN(points) / 2; ~ ~~~~~~~~~~~~~~~~~~~^~~ actions.c:963:40: warning: passing 'const char [11]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] if(has_optional_hash_arg(hash_arg, "chroma_key")) { ^~~~~~~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:964:43: warning: passing 'const char [11]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] VALUE c = get_from_hash(hash_arg, "chroma_key"); ^~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ actions.c:968:45: warning: passing 'const char [15]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] else if(has_optional_hash_arg(hash_arg, "chroma_key_not")) { ^~~~~~~~~~~~~~~~ ./utils.h:66:47: note: passing argument to parameter 'sym' here bool has_optional_hash_arg(VALUE hash, char * sym); ^ actions.c:969:70: warning: passing 'const char [15]' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] chromakey = convert_rb_color_to_rgba(get_from_hash(hash_arg, "chroma_key_not")); ^~~~~~~~~~~~~~~~ ./utils.h:54:40: note: passing argument to parameter 'sym' here VALUE get_from_hash(VALUE hash, char * sym); ^ 40 warnings and 3 errors generated. make: *** [actions.o] Error 1 make failed, exit code 2 ```
niyialimi commented 3 years ago

I have the same issue on my macOS Big Sur as well

daniel-rikowski commented 2 years ago

This should fixed by #36

SyntheticMind commented 1 year ago

In file included from /usr/include/ruby-3.0.0/ruby/internal/stdbool.h:40, from /usr/include/ruby-3.0.0/ruby/backward/2/bool.h:23, from /usr/include/ruby-3.0.0/ruby/defines.h:74, from /usr/include/ruby-3.0.0/ruby/ruby.h:23, from /usr/include/ruby-3.0.0/ruby.h:38, from texplay.h:10, from actions.c:1: texplay.h:32:3: error: expected identifier before numeric constant 32 | false, true | ^~~~~ texplay.h:33:3: error: expected ‘;’, identifier or ‘(’ before ‘_Bool’ 33 | } bool; | ^~~~ In file included from actions.c:1: texplay.h:41:3: error: ‘sync’ redeclared as different kind of symbol 41 | } sync; | ^~~~ In file included from /usr/include/ruby-3.0.0/ruby/defines.h:59, from /usr/include/ruby-3.0.0/ruby/ruby.h:23, from /usr/include/ruby-3.0.0/ruby.h:38, from texplay.h:10, from actions.c:1: /usr/include/unistd.h:1005:13: note: previous declaration of ‘sync’ with type ‘void(void)’ 1005 | extern void sync (void) __THROW;