Files
chromebrew/packages/gvim.rb
github-actions[bot] 626a53a7a7 Update buildsystems to use buildsystem name variables, and report contents of those variables/methods during use. (#11936)
* Update buildsystems, update jq, add jq to core for arm.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Only report build options if they exist.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fix overeager sed replacement.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* workflow debugging

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add logging for build errors.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Revert to function in each package file.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update jq since it needs gcc14 to build.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add built packages for linux/386 to buildsystems

* remove deprecated gfbgraph

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix git tag for gnome_maps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update llvm20 package file.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update gnome_maps deps.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Abstract out buildsystems_methods reporting.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Keep LIBC_VERSION const from being empty.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update crew_profile_base and libxml2

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* clarify

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update libarchive

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update libavif

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add libxml2 build comment.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add build comment to libarchive.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Don't warn for missing directory during package removal.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: satmandu <satmandu@users.noreply.github.com>
2025-05-23 19:50:48 +00:00

122 lines
4.0 KiB
Ruby

require 'buildsystems/autotools'
class Gvim < Autotools
description 'Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient. (with advanced features, such as a GUI)'
homepage 'https://www.vim.org/'
version '9.1.0969'
license 'GPL-2'
compatibility 'aarch64 armv7l x86_64'
source_url 'https://github.com/vim/vim.git'
git_hashtag "v#{version}"
binary_compression 'tar.zst'
binary_sha256({
aarch64: '4081c295d676d191c32d6fb7bc65d898becfa1346c5827e5966752854fe61d24',
armv7l: '4081c295d676d191c32d6fb7bc65d898becfa1346c5827e5966752854fe61d24',
x86_64: '81ff3be59f5f414c33211f7f326705f56eb4eb21788fe019ecf8dfbecb86f579'
})
depends_on 'acl' # R
depends_on 'cairo' # R
depends_on 'gcc_lib' # R
depends_on 'gdk_pixbuf' # R
depends_on 'glibc' # R
depends_on 'glib' # R
depends_on 'gpm' # R
depends_on 'gtk3' # R
depends_on 'harfbuzz'
depends_on 'libice' # R
depends_on 'libsm' # R
depends_on 'libsodium' # R
depends_on 'libx11' # R
depends_on 'libxt' # R
depends_on 'ncurses' # R
depends_on 'pango' # R
depends_on 'vim_runtime' # R
def self.preflight
vim = `which #{CREW_PREFIX}/bin/vim 2> /dev/null`.chomp
abort "vim version #{version} already installed.".lightgreen unless vim.to_s == ''
end
def self.patch
# set the system-wide vimrc path
FileUtils.cd('src') do
system 'sed', '-i', "s|^.*#define SYS_VIMRC_FILE.*$|#define SYS_VIMRC_FILE \"#{CREW_PREFIX}/etc/vimrc\"|",
'feature.h'
system 'sed', '-i', "s|^.*#define SYS_GVIMRC_FILE.*$|#define SYS_GVIMRC_FILE \"#{CREW_PREFIX}/etc/gvimrc\"|",
'feature.h'
end
end
autotools_configure_options "--localstatedir=#{CREW_PREFIX}/var/lib/vim \
--disable-canberra \
--disable-nls \
--disable-selinux \
--enable-acl \
--enable-cscope \
--enable-gnome-check \
--enable-gpm \
--enable-gui=gtk3 \
--enable-luainterp=dynamic \
--enable-multibyte \
--enable-netbeans \
--enable-perlinterp=dynamic \
--enable-python3interp=dynamic \
--enable-pythoninterp=dynamic \
--enable-rubyinterp=dynamic \
--enable-tclinterp=dynamic \
--with-compiledby='Chromebrew' \
--with-features=huge \
--with-x=yes"
def self.install
system 'make', "VIMRCLOC=#{CREW_PREFIX}/etc", "DESTDIR=#{CREW_DEST_DIR}", 'install'
FileUtils.ln_s "#{CREW_PREFIX}/bin/vim", "#{CREW_DEST_PREFIX}/bin/vi"
# these are provided by 'vim_runtime'
FileUtils.rm_r "#{CREW_DEST_PREFIX}/share/vim"
# these are provided by 'xxd_standalone'
@deletefiles = %W[#{CREW_DEST_PREFIX}/bin/xxd #{CREW_DEST_MAN_PREFIX}/man1/xxd.1]
@deletefiles.each do |f|
FileUtils.rm_f f
end
end
def self.postinstall
puts
puts "The config files are located in #{CREW_PREFIX}/etc.".lightblue
puts 'User-specific configuration should go in ~/.vimrc and'.lightblue
puts '~/.gvimrc.'.lightblue
puts
puts 'If you are upgrading from an earlier version, edit ~/.bashrc'.orange
puts "and remove the 'export VIMRUNTIME' and 'export LC_ALL=C' lines.".orange
# Set vim to be the default vi if there is no vi or if a default
# vi does not exist.
@crew_vi = File.file?("#{CREW_PREFIX}/bin/vi")
@system_vi = File.file?('/usr/bin/vi')
@create_vi_symlink = true if !@system_vi && !@crew_vi
@create_vi_symlink_ask = true if @crew_vi || @system_vi
if @create_vi_symlink_ask
if Package.agree_default_yes('Would you like to set vim to be the default vi')
@create_vi_symlink = true
else
@create_vi_symlink = false
puts 'Default vi left unchanged.'.lightgreen
end
end
return unless @create_vi_symlink
FileUtils.ln_sf "#{CREW_PREFIX}/bin/vim", "#{CREW_PREFIX}/bin/vi"
puts 'Default vi set to vim.'.lightgreen
end
def self.postremove
# Remove vi symlink if it is to vim.
return unless File.symlink?("#{CREW_PREFIX}/bin/vi") && (File.readlink("#{CREW_PREFIX}/bin/vi") == "#{CREW_PREFIX}/bin/vim")
FileUtils.rm "#{CREW_PREFIX}/bin/vi"
end
end