From 74c5c8069d5d6503af52cc58d09d07b7cf5d2303 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 1 Apr 2025 13:40:54 +0300 Subject: [PATCH 1/2] jbofihe: fix build with gcc14 - add patch fixing gcc14 errors: `implicit-int`: ``` rpc_tab.c:1:8: error: type defaults to 'int' in declaration of 'elide_trace_reduce' [-Wimplicit-int] 1 | extern elide_trace_reduce(int, int); | ^~~~~~~~~~~~~~~~~~ rpc_tab.c:2:8: error: type defaults to 'int' in declaration of 'elide_trace_shift' [-Wimplicit-int] 2 | extern elide_trace_shift(int,int); | ^~~~~~~~~~~~~~~~~ rpc_tab.c:3:8: error: type defaults to 'int' in declaration of 'report_trace_shift' [-Wimplicit-int] 3 | extern report_trace_shift(int); | ^~~~~~~~~~~~~~~~~~ rpc_tab.c:4:8: error: type defaults to 'int' in declaration of 'report_trace_reduce' [-Wimplicit-int] 4 | extern report_trace_reduce(int, int); | ^~~~~~~~~~~~~~~~~~~ rpc_tab.c:5:8: error: type defaults to 'int' in declaration of 'report_trace_error' [-Wimplicit-int] 5 | extern report_trace_error(short *yyss, short *yyssp); | ^~~~~~~~~~~~~~~~~~ ``` `implicit-function-declaration`: ``` parse.tab.c: In function 'yyparse': parse.tab.c:1148:16: error: implicit declaration of function 'yylex' [-Wimplicit-function-declaration] 1148 | yychar = yylex (); | ^~~~~ parse.tab.c:1595:7: error: implicit declaration of function 'yyerror'; did you mean 'yyerrok'? [-Wimplicit-function-declaration] 1595 | yyerror (YY_("syntax error")); | ^~~~~~~ | yyerrok n2d.c: In function 'main': n2d.c:1529:12: error: implicit declaration of function 'yyparse' [-Wimplicit-function-declaration] 1529 | result = yyparse(); | ^~~~~~~ ``` --- .../by-name/jb/jbofihe/fix-gcc14-errors.patch | 37 +++++++++++++++++++ pkgs/by-name/jb/jbofihe/package.nix | 6 +++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/by-name/jb/jbofihe/fix-gcc14-errors.patch diff --git a/pkgs/by-name/jb/jbofihe/fix-gcc14-errors.patch b/pkgs/by-name/jb/jbofihe/fix-gcc14-errors.patch new file mode 100644 index 000000000000..0c95bf305c84 --- /dev/null +++ b/pkgs/by-name/jb/jbofihe/fix-gcc14-errors.patch @@ -0,0 +1,37 @@ +diff --git a/add_trace_to_tabc.pl b/add_trace_to_tabc.pl +index 04be787..3186075 100644 +--- a/add_trace_to_tabc.pl ++++ b/add_trace_to_tabc.pl +@@ -15,11 +15,11 @@ + # COPYRIGHT + + print <) { +diff --git a/dfasyn/n2d.h b/dfasyn/n2d.h +index b2159ba..6c56abb 100644 +--- a/dfasyn/n2d.h ++++ b/dfasyn/n2d.h +@@ -181,6 +181,10 @@ Expr * new_xor_expr(Expr *c1, Expr *c2); + Expr * new_cond_expr(Expr *c1, Expr *c2, Expr *c3); + Expr * new_sym_expr(char *sym_name); + ++int yyparse(void); ++void yyerror(char *); ++int yylex(void); ++ + void define_symbol(Evaluator *x, char *name, Expr *e); + void define_result(Evaluator *x, char *string, Expr *e, int early); + void define_symresult(Evaluator *x, char *string, Expr *e, int early); + diff --git a/pkgs/by-name/jb/jbofihe/package.nix b/pkgs/by-name/jb/jbofihe/package.nix index 199ee632c19c..31260fde1b90 100644 --- a/pkgs/by-name/jb/jbofihe/package.nix +++ b/pkgs/by-name/jb/jbofihe/package.nix @@ -18,6 +18,12 @@ stdenv.mkDerivation rec { sha256 = "1xx7x1256sjncyzx656jl6jl546vn8zz0siymqalz6v9yf341p98"; }; + patches = [ + # fix build with gcc14: + # https://github.com/lojban/jbofihe/pull/19 + ./fix-gcc14-errors.patch + ]; + nativeBuildInputs = [ bison flex From 04584e18359563fc9a3fbcda66caf318834011e6 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Tue, 1 Apr 2025 20:13:01 +0300 Subject: [PATCH 2/2] jbofihe: modernize - replace `rec` with `finalAttrs` - remove `with lib;` from `meta` --- pkgs/by-name/jb/jbofihe/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/jb/jbofihe/package.nix b/pkgs/by-name/jb/jbofihe/package.nix index 31260fde1b90..8bd66a04af6d 100644 --- a/pkgs/by-name/jb/jbofihe/package.nix +++ b/pkgs/by-name/jb/jbofihe/package.nix @@ -7,14 +7,14 @@ perl, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "jbofihe"; version = "0.43"; src = fetchFromGitHub { owner = "lojban"; repo = "jbofihe"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "1xx7x1256sjncyzx656jl6jl546vn8zz0siymqalz6v9yf341p98"; }; @@ -37,10 +37,10 @@ stdenv.mkDerivation rec { runHook postCheck ''; - meta = with lib; { + meta = { description = "Parser & analyser for Lojban"; homepage = "https://github.com/lojban/jbofihe"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ chkno ]; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ chkno ]; }; -} +})