ruby: hack for yacc (fix build)

This commit is contained in:
Gerasim Troeglazov
2021-08-18 10:12:36 +00:00
parent 208c556b3a
commit 9f67ac65c9

View File

@@ -13,7 +13,7 @@ HOMEPAGE="https://www.ruby-lang.org/"
COPYRIGHT="1993-2021 Yukihiro Matsumoto"
LICENSE="Ruby
BSD (3-clause)"
REVISION="1"
REVISION="2"
SOURCE_URI="https://cache.ruby-lang.org/pub/ruby/2.7/ruby-$portVersion.tar.bz2"
CHECKSUM_SHA256="bffa8aec9da392eda98f1c561071bb6e71d217d541c617fc6e3282d79f4e7d48"
SOURCE_DIR="ruby-$portVersion"
@@ -88,6 +88,16 @@ BUILD_PREREQUIRES="
defineDebugInfoPackage ruby$secondaryArchSuffix \
"$libDir"/libruby.so.$libVersion
PATCH()
{
# Hack for ripper build
sed -i \
-e "/#define YYLTYPE_IS_DECLARED 1/a #define YYEMPTY -2" \
-e "/#define YYLTYPE_IS_DECLARED 1/a #define YYUNDEF 257" \
-e "/#define YYLTYPE_IS_DECLARED 1/a #define YYerror 256" \
$sourceDir/ext/ripper/ripper.y
}
BUILD()
{
export CFLAGS="-D_BSD_SOURCE"