Fix building with ruby 4.0
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
name: vim
|
||||
description: A highly configurable text editor
|
||||
version: 9.1.2028
|
||||
revision: 2
|
||||
revision: 3
|
||||
url: https://www.vim.org/
|
||||
license: vim
|
||||
architecture: any
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
From 293c5e235bf590bca1088e9ce0af71e1c25b3678 Mon Sep 17 00:00:00 2001
|
||||
From: EnumDev <[email protected]>
|
||||
Date: Tue, 30 Dec 2025 17:10:53 +0200
|
||||
Subject: [PATCH 1/2] Fix building with ruby 4.0
|
||||
|
||||
Signed-off-by: EnumDev <[email protected]>
|
||||
---
|
||||
src/if_ruby.c | 14 +++++++++++++-
|
||||
1 file changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/if_ruby.c b/src/if_ruby.c
|
||||
index 6af508beccdc1d..a2dc53da8b79f0 100644
|
||||
--- a/src/if_ruby.c
|
||||
+++ b/src/if_ruby.c
|
||||
@@ -244,7 +244,11 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
|
||||
# define rb_check_type dll_rb_check_type
|
||||
# endif
|
||||
# ifdef USE_TYPEDDATA
|
||||
-# define rb_check_typeddata dll_rb_check_typeddata
|
||||
+# if RUBY_VERSION >= 40
|
||||
+# define rbimpl_check_typeddata dll_rbimpl_check_typeddata
|
||||
+# else
|
||||
+# define define rb_check_typeddata dll_rb_check_typeddata
|
||||
+# endif
|
||||
# endif
|
||||
# define rb_class_path dll_rb_class_path
|
||||
# ifdef USE_TYPEDDATA
|
||||
@@ -373,7 +377,11 @@ VALUE *dll_rb_cTrueClass;
|
||||
static VALUE (*dll_rb_class_new_instance) (int,VALUE*,VALUE);
|
||||
static void (*dll_rb_check_type) (VALUE,int);
|
||||
# ifdef USE_TYPEDDATA
|
||||
+# if RUBY_VERSION >= 40
|
||||
+static void *(*dll_rbimpl_check_typeddata) (VALUE,const rb_data_type_t *);
|
||||
+# else
|
||||
static void *(*dll_rb_check_typeddata) (VALUE,const rb_data_type_t *);
|
||||
+# endif
|
||||
# endif
|
||||
static VALUE (*dll_rb_class_path) (VALUE);
|
||||
# ifdef USE_TYPEDDATA
|
||||
@@ -632,7 +640,11 @@ static struct
|
||||
{"rb_class_new_instance", (RUBY_PROC*)&dll_rb_class_new_instance},
|
||||
{"rb_check_type", (RUBY_PROC*)&dll_rb_check_type},
|
||||
# ifdef USE_TYPEDDATA
|
||||
+# if RUBY_VERSION >= 40
|
||||
+ {"rbimpl_check_typeddata", (RUBY_PROC*)&dll_rbimpl_check_typeddata},
|
||||
+# else
|
||||
{"rb_check_typeddata", (RUBY_PROC*)&dll_rb_check_typeddata},
|
||||
+# endif
|
||||
# endif
|
||||
{"rb_class_path", (RUBY_PROC*)&dll_rb_class_path},
|
||||
# ifdef USE_TYPEDDATA
|
||||
|
||||
From 9c7c407a83226bd72541fc3c080245e72d8b23e2 Mon Sep 17 00:00:00 2001
|
||||
From: EnumDev <[email protected]>
|
||||
Date: Wed, 31 Dec 2025 14:17:28 +0200
|
||||
Subject: [PATCH 2/2] Fix typo in src/if_ruby.c
|
||||
|
||||
Signed-off-by: EnumDev <[email protected]>
|
||||
---
|
||||
src/if_ruby.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/if_ruby.c b/src/if_ruby.c
|
||||
index a2dc53da8b79f0..81252102b1d489 100644
|
||||
--- a/src/if_ruby.c
|
||||
+++ b/src/if_ruby.c
|
||||
@@ -247,7 +247,7 @@ static int ruby_convert_to_vim_value(VALUE val, typval_T *rettv);
|
||||
# if RUBY_VERSION >= 40
|
||||
# define rbimpl_check_typeddata dll_rbimpl_check_typeddata
|
||||
# else
|
||||
-# define define rb_check_typeddata dll_rb_check_typeddata
|
||||
+# define rb_check_typeddata dll_rb_check_typeddata
|
||||
# endif
|
||||
# endif
|
||||
# define rb_class_path dll_rb_class_path
|
||||
@@ -6,6 +6,9 @@
|
||||
# This function is used for putting downloaded files to the correct location or applying patches
|
||||
prepare() {
|
||||
cd "$BPM_SOURCE"
|
||||
# Fix building with ruby 4.0
|
||||
patch -p1 -i "$BPM_WORKDIR"/fix-building-with-ruby-4.0.patch
|
||||
|
||||
# Define place for global vimrc file
|
||||
sed -E 's|^.*(#define SYS_.*VIMRC_FILE.*").*$|\1|g' -i src/feature.h
|
||||
sed -E 's|^.*(#define VIMRC_FILE.*").*$|\1|g' -i src/feature.h
|
||||
@@ -32,7 +35,7 @@ build() {
|
||||
--enable-netbeans \
|
||||
--enable-perlinterp=dynamic \
|
||||
--enable-python3interp=dynamic \
|
||||
--enable-rubyinterp \
|
||||
--enable-rubyinterp=dynamic \
|
||||
--enable-luainterp=dynamic \
|
||||
--enable-tclinterp=dynamic \
|
||||
--disable-canberra
|
||||
|
||||
Reference in New Issue
Block a user