Skip to content

Commit

Permalink
Merge pull request #172 from adisbladis/mruby-2_1_1
Browse files Browse the repository at this point in the history
mruby: Fix compatibility with bison 3.6 & bump package version
  • Loading branch information
samueldr committed Jun 26, 2020
2 parents f39ebf4 + 04ae148 commit 89d31e5
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
59 changes: 59 additions & 0 deletions overlay/mruby-builder/mruby/bison-36-compat.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
From acab088fd6af0b2ef2df1396aeb93bfc2e020fa5 Mon Sep 17 00:00:00 2001
From: "Yukihiro \"Matz\" Matsumoto" <matz@ruby.or.jp>
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" <matz@ruby.or.jp>
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 <ctype.h>
@@ -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

8 changes: 5 additions & 3 deletions overlay/mruby-builder/mruby/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ in
, buildPackages
, ruby
, bison
, rake
, fetchFromGitHub
, file
, mruby
Expand Down Expand Up @@ -147,21 +148,22 @@ let
in
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=";
};

patches = [
./0001-HACK-Ensures-a-host-less-build-can-be-made.patch
./0001-Nixpkgs-dump-linker-flags-for-re-use.patch
./bison-36-compat.patch
];

nativeBuildInputs = [ ruby bison ] ++ gemNativeBuildInputs;
nativeBuildInputs = [ ruby bison rake ] ++ gemNativeBuildInputs;
buildInputs = gemBuildInputs;

# Necessary so it uses `gcc` instead of `ld` for linking.
Expand Down

0 comments on commit 89d31e5

Please sign in to comment.