diff --git a/0001-vim-anolis-build-with-ruby26.patch b/0001-vim-anolis-build-with-ruby26.patch new file mode 100644 index 0000000000000000000000000000000000000000..461134319c0802d97852da78cf47c46d45c783e1 --- /dev/null +++ b/0001-vim-anolis-build-with-ruby26.patch @@ -0,0 +1,60 @@ +From b09c684195d803137d52c34fb4d3a410be5ac10f Mon Sep 17 00:00:00 2001 +From: Bram Moolenaar +Date: Thu, 27 Dec 2018 22:11:01 +0100 +Subject: [PATCH] patch 8.1.0646: cannot build with Ruby 2.6.0 + +Problem: Cannot build with Ruby 2.6.0. +Solution: Add rb_ary_detransient(). (Ozaki Kiichi, closes #3724) +--- + src/if_ruby.c | 15 +++++++++++---- + src/version.c | 2 ++ + 2 files changed, 13 insertions(+), 4 deletions(-) + +diff --git a/src/if_ruby.c b/src/if_ruby.c +index cb9b416036f..34fc0ed1cb3 100644 +--- a/src/if_ruby.c ++++ b/src/if_ruby.c +@@ -123,6 +123,10 @@ + # define rb_gc_writebarrier_unprotect rb_gc_writebarrier_unprotect_stub + #endif + ++#if defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 26 ++# define rb_ary_detransient (*dll_rb_ary_detransient) ++#endif ++ + #include + #ifdef RUBY19_OR_LATER + # include +@@ -455,6 +459,9 @@ static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_float_new) (double); + static VALUE (*dll_rb_ary_new) (void); + static VALUE (*dll_rb_ary_push) (VALUE, VALUE); ++# if DYNAMIC_RUBY_VER >= 26 ++static void (*dll_rb_ary_detransient) (VALUE); ++# endif + # if defined(RUBY19_OR_LATER) || defined(RUBY_INIT_STACK) + # ifdef __ia64 + static void * (*dll_rb_ia64_bsp) (void); +@@ -666,6 +673,9 @@ static struct + {"rb_ary_new", (RUBY_PROC*)&dll_rb_ary_new}, + {"rb_ary_push", (RUBY_PROC*)&dll_rb_ary_push}, + # endif ++# if DYNAMIC_RUBY_VER >= 26 ++ {"rb_ary_detransient", (RUBY_PROC*)&dll_rb_ary_detransient}, ++# endif + # ifdef RUBY19_OR_LATER + {"rb_int2big", (RUBY_PROC*)&dll_rb_int2big}, + {"ruby_script", (RUBY_PROC*)&dll_ruby_script}, +@@ -966,11 +976,8 @@ static int ensure_ruby_initialized(void) + + static void error_print(int state) + { +-#ifndef DYNAMIC_RUBY +-#if !(defined(RUBY_VERSION) && RUBY_VERSION >= 19) \ +- && !(defined(DYNAMIC_RUBY_VER) && DYNAMIC_RUBY_VER >= 19) ++#if !defined(DYNAMIC_RUBY) && !defined(RUBY19_OR_LATER) + RUBYEXTERN VALUE ruby_errinfo; +-#endif + #endif + VALUE eclass; + VALUE einfo; diff --git a/vim.spec b/vim.spec index 159811dfde1d5b37bea0975be2d954e2b3523a0c..a4749f877080905a9af71318573a8f683186ac4e 100644 --- a/vim.spec +++ b/vim.spec @@ -1,3 +1,4 @@ +%define anolis_release .0.1 %define patchlevel 1763 %if %{?WITH_SELINUX:0}%{!?WITH_SELINUX:1} %define WITH_SELINUX 1 @@ -24,7 +25,7 @@ Summary: The VIM editor URL: http://www.vim.org/ Name: vim Version: %{baseversion}.%{patchlevel} -Release: 16%{?dist} +Release: 16%{anolis_release}%{?dist} License: Vim and MIT Source0: ftp://ftp.vim.org/pub/vim/unix/vim-%{baseversion}-%{patchlevel}.tar.bz2 Source1: vim.sh @@ -80,6 +81,11 @@ Patch3022: vim-cve3796.patch # 2004891 - CVE-2021-3778 vim: heap-based buffer overflow in utf_ptr2char() in mbyte.c [rhel-8.5.0] Patch3023: vim-cve3778-fix.patch +# Add by Anolis +# backport patch to fix build error with ruby +Patch10000: 0001-vim-anolis-build-with-ruby26.patch +# End + # gcc is no longer in buildroot by default BuildRequires: gcc @@ -280,6 +286,8 @@ perl -pi -e "s,bin/nawk,bin/awk,g" runtime/tools/mve.awk %patch3022 -p1 -b .cve3796 %patch3023 -p1 -b .cve3778 +%patch10000 -p1 + %build %if 0%{?rhel} > 7 export RHEL_ALLOW_PYTHON2_FOR_BUILD=1 @@ -309,8 +317,8 @@ perl -pi -e "s/vimrc/virc/" os_unix.h --disable-pythoninterp --disable-perlinterp --disable-tclinterp \ --with-tlib=ncurses --enable-gui=no --disable-gpm --exec-prefix=/ \ --enable-fips-warning \ - --with-compiledby="" \ - --with-modified-by="" + --with-compiledby="OpenAnolis Community" \ + --with-modified-by="OpenAnolis Community" make VIMRCLOC=/etc VIMRUNTIMEDIR=/usr/share/vim/%{vimdir} %{?_smp_mflags} cp vim minimal-vim @@ -328,8 +336,8 @@ mv -f ex_cmds.c.save ex_cmds.c --with-tlib=ncurses \ --enable-gtk3-check --enable-gui=gtk3 \ --enable-fips-warning \ - --with-compiledby="" --enable-cscope \ - --with-modified-by="" \ + --with-compiledby="OpenAnolis Community" --enable-cscope \ + --with-modified-by="OpenAnolis Community" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -363,10 +371,10 @@ make clean --disable-tclinterp \ --with-x=no \ --enable-gui=no --exec-prefix=%{_prefix} --enable-multibyte \ - --enable-cscope --with-modified-by="" \ + --enable-cscope --with-modified-by="OpenAnolis Community" \ --with-tlib=ncurses \ --enable-fips-warning \ - --with-compiledby="" \ + --with-compiledby="OpenAnolis Community" \ %if "%{withnetbeans}" == "1" --enable-netbeans \ %else @@ -797,6 +805,10 @@ touch %{buildroot}/%{_datadir}/%{name}/vimfiles/doc/tags %{_datadir}/icons/locolor/*/apps/* %changelog +* Wed Dec 15 2021 Mahailiang - 2:8.0.1763-16.0.1 +- Rebrand to Anolis +- Fix build issue with ruby + * Mon Sep 20 2021 Zdenek Dohnal - 2:8.0.1763-16 - 2004974 - CVE-2021-3796 vim: use-after-free in nv_replace() in normal.c [rhel-8.5.0] - 2004891 - CVE-2021-3778 vim: heap-based buffer overflow in utf_ptr2char() in mbyte.c [rhel-8.5.0]