mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-10 07:57:59 -05:00
81 lines
3.1 KiB
Ruby
81 lines
3.1 KiB
Ruby
require 'package'
|
|
|
|
class Vim < Package
|
|
description 'Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient.'
|
|
homepage 'http://www.vim.org/'
|
|
version '8.2.0014'
|
|
source_url 'https://github.com/vim/vim/archive/v8.2.0014.tar.gz'
|
|
source_sha256 '5e433abdebf36855bcec38b4e195a1281d04309b72523a265a21288717061845'
|
|
|
|
if ARGV[0] == 'install'
|
|
gvim = `which gvim 2> /dev/null`.chomp
|
|
abort "gvim version #{version} already installed.".lightgreen unless "#{gvim}" == ""
|
|
end
|
|
|
|
binary_url ({
|
|
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/vim-8.2.0014-chromeos-armv7l.tar.xz',
|
|
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/vim-8.2.0014-chromeos-armv7l.tar.xz',
|
|
i686: 'https://dl.bintray.com/chromebrew/chromebrew/vim-8.2.0014-chromeos-i686.tar.xz',
|
|
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/vim-8.2.0014-chromeos-x86_64.tar.xz',
|
|
})
|
|
binary_sha256 ({
|
|
aarch64: '23e46b4456fcf8af514dd4b014db36812f041498531ab10b7cd7595b4987922b',
|
|
armv7l: '23e46b4456fcf8af514dd4b014db36812f041498531ab10b7cd7595b4987922b',
|
|
i686: '8771da6eb9bca4ed4440cd4a4318bf93ee426034e8ffe733ff56fcefb401e8f6',
|
|
x86_64: 'bbc47db5a8b8fb98c4e7430ab7d32598f827ddb12f6d378fbc7d745a8447ebc7',
|
|
})
|
|
|
|
depends_on 'python27' => :build
|
|
depends_on 'python3' => :build
|
|
depends_on 'vim_runtime'
|
|
|
|
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"
|
|
system "autoconf"
|
|
end
|
|
end
|
|
|
|
def self.build
|
|
system "./configure",
|
|
"--prefix=#{CREW_PREFIX}",
|
|
"--localstatedir=#{CREW_PREFIX}/var/lib/vim",
|
|
"--with-features=huge",
|
|
"--with-compiledby='Chromebrew'",
|
|
"--with-x=no",
|
|
"--disable-gui",
|
|
"--enable-multibyte",
|
|
"--enable-cscope",
|
|
"--enable-fontset",
|
|
"--enable-perlinterp=dynamic",
|
|
"--enable-pythoninterp=dynamic",
|
|
"--enable-python3interp=dynamic",
|
|
"--enable-rubyinterp=dynamic",
|
|
"--disable-selinux"
|
|
system "make"
|
|
end
|
|
|
|
def self.install
|
|
system "make", "DESTDIR=#{CREW_DEST_DIR}", "VIMRCLOC=#{CREW_PREFIX}/etc", "install"
|
|
|
|
# these are provided by 'vim_runtime'
|
|
FileUtils.rm_r "#{CREW_DEST_PREFIX}/share/vim"
|
|
|
|
# remove desktop and icon files for the terminal package
|
|
FileUtils.rm_r "#{CREW_DEST_PREFIX}/share/applications"
|
|
FileUtils.rm_r "#{CREW_DEST_PREFIX}/share/icons"
|
|
end
|
|
|
|
def self.postinstall
|
|
puts
|
|
puts "The config files are located in #{CREW_PREFIX}/etc.".lightblue
|
|
puts "User-specific configuration should go in ~/.vimrc.".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
|
|
puts
|
|
end
|
|
end
|