From 2366150cab4816c5b15271f60068ff438c8e6489 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 26 Jun 2020 11:48:18 +0200 Subject: [PATCH 1/2] mruby: Fix build with bison 3.6 --- .../compilers/mruby/bison-36-compat.patch | 59 +++++++++++++++++++ pkgs/development/compilers/mruby/default.nix | 2 + 2 files changed, 61 insertions(+) create mode 100644 pkgs/development/compilers/mruby/bison-36-compat.patch diff --git a/pkgs/development/compilers/mruby/bison-36-compat.patch b/pkgs/development/compilers/mruby/bison-36-compat.patch new file mode 100644 index 000000000000..674a88fe4c23 --- /dev/null +++ b/pkgs/development/compilers/mruby/bison-36-compat.patch @@ -0,0 +1,59 @@ +From acab088fd6af0b2ef2df1396aeb93bfc2e020fa5 Mon Sep 17 00:00:00 2001 +From: "Yukihiro \"Matz\" Matsumoto" +Date: Mon, 27 Apr 2020 18:52:43 +0900 +Subject: [PATCH 1/2] Updating `parse.y for recent `bison` (retry). + +--- + mrbgems/mruby-compiler/core/parse.y | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y +index 6a1faf4e..2a4f740e 100644 +--- a/mrbgems/mruby-compiler/core/parse.y ++++ b/mrbgems/mruby-compiler/core/parse.y +@@ -1323,7 +1323,7 @@ heredoc_end(parser_state *p) + + %} + +-%pure-parser ++%define api.pure + %parse-param {parser_state *p} + %lex-param {parser_state *p} + +-- +2.27.0 + +From 3cc682d943b29e84928a847a23f411ddbace74b7 Mon Sep 17 00:00:00 2001 +From: "Yukihiro \"Matz\" Matsumoto" +Date: Fri, 15 May 2020 12:30:13 +0900 +Subject: [PATCH 2/2] Remove `YYERROR_VERBOSE` which no longer supported since + `bison 3.6`. + +Instead we added `%define parse.error verbose`. +--- + mrbgems/mruby-compiler/core/parse.y | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y +index 2a4f740e..eee6a5e5 100644 +--- a/mrbgems/mruby-compiler/core/parse.y ++++ b/mrbgems/mruby-compiler/core/parse.y +@@ -9,7 +9,6 @@ + #ifdef PARSER_DEBUG + # define YYDEBUG 1 + #endif +-#define YYERROR_VERBOSE 1 + #define YYSTACK_USE_ALLOCA 1 + + #include +@@ -1323,6 +1322,7 @@ heredoc_end(parser_state *p) + + %} + ++%define parse.error verbose + %define api.pure + %parse-param {parser_state *p} + %lex-param {parser_state *p} +-- +2.27.0 + diff --git a/pkgs/development/compilers/mruby/default.nix b/pkgs/development/compilers/mruby/default.nix index f6a7fc2f1433..54bb5cd701cf 100644 --- a/pkgs/development/compilers/mruby/default.nix +++ b/pkgs/development/compilers/mruby/default.nix @@ -13,6 +13,8 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ ruby bison ]; + patches = [ ./bison-36-compat.patch ]; + # Necessary so it uses `gcc` instead of `ld` for linking. # https://github.com/mruby/mruby/blob/35be8b252495d92ca811d76996f03c470ee33380/tasks/toolchains/gcc.rake#L25 preBuild = if stdenv.isLinux then "unset LD" else null; From bfe2ba32b8951d1b5799a6594ceb4fac9da0d7ef Mon Sep 17 00:00:00 2001 From: adisbladis Date: Fri, 26 Jun 2020 11:48:35 +0200 Subject: [PATCH 2/2] mruby: 2.1.0 -> 2.1.1 --- pkgs/development/compilers/mruby/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/compilers/mruby/default.nix b/pkgs/development/compilers/mruby/default.nix index 54bb5cd701cf..2589c47c3bec 100644 --- a/pkgs/development/compilers/mruby/default.nix +++ b/pkgs/development/compilers/mruby/default.nix @@ -1,17 +1,17 @@ -{ stdenv, ruby, bison, fetchFromGitHub }: +{ stdenv, ruby, bison, rake, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "mruby"; - version = "2.1.0"; + version = "2.1.1"; src = fetchFromGitHub { owner = "mruby"; repo = "mruby"; rev = version; - sha256 = "1y072c7dh9jf8xwy7kia6cb4dkpspq4zf24ssn7zm5f46p4waxni"; + sha256 = "gEEb0Vn/G+dNgeY6r0VP8bMSPrEOf5s+0GoOcnIPtEU="; }; - nativeBuildInputs = [ ruby bison ]; + nativeBuildInputs = [ ruby bison rake ]; patches = [ ./bison-36-compat.patch ];