mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-06 22:24:12 -05:00
* update neovim Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Modify neovim deps Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust tree_sitter and neovim builds. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Refactor tree_sitter build Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update utf8proc Signed-off-by: Satadru Pramanik <satadru@gmail.com> * update unibilium Signed-off-by: Satadru Pramanik <satadru@gmail.com> * update luajit Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update libuv Signed-off-by: Satadru Pramanik <satadru@gmail.com> * update neovim build Signed-off-by: Satadru Pramanik <satadru@gmail.com> * update libluv Signed-off-by: Satadru Pramanik <satadru@gmail.com> * hash updates, fix crew logic Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update luajit_[bitop,lpeg,mpack] Signed-off-by: Satadru Pramanik <satadru@gmail.com> * neovim: disable lto Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Adjust no_lto cmake options Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add built packages for linux/386 to branch updates. * Add neovim hashes, update updter logic Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Update requires Signed-off-by: Satadru Pramanik <satadru@gmail.com> * suggested changes 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>
88 lines
3.3 KiB
Ruby
88 lines
3.3 KiB
Ruby
require 'buildsystems/cmake'
|
|
|
|
class Neovim < CMake
|
|
description 'Neovim is a refactor, and sometimes redactor, in the tradition of Vim (which itself derives from Stevie).'
|
|
homepage 'https://neovim.io/'
|
|
version '0.11.3'
|
|
license 'Apache-2.0 and vim'
|
|
compatibility 'all'
|
|
source_url 'https://github.com/neovim/neovim.git'
|
|
git_hashtag "v#{version}"
|
|
binary_compression 'tar.zst'
|
|
|
|
binary_sha256({
|
|
aarch64: '405560ae5b698ef74d4d80d42a41fdd8d72d66f2d6497845108e1e3a2421822c',
|
|
armv7l: '405560ae5b698ef74d4d80d42a41fdd8d72d66f2d6497845108e1e3a2421822c',
|
|
i686: '4b9a085bf06fb07e56b3918ebb6977c5ede3260af304d2b9243d664a5a254c59',
|
|
x86_64: '8c7d53547c79c770ff39f1430db9182f8bb4d10c38f44c5df1daae40ca801967'
|
|
})
|
|
|
|
depends_on 'gcc_lib' # R
|
|
depends_on 'glibc' # R
|
|
depends_on 'libluv' # R
|
|
depends_on 'libuv' => :build
|
|
depends_on 'luajit' => :build
|
|
depends_on 'luajit_bitop' => :build
|
|
depends_on 'luajit_lpeg' # R
|
|
depends_on 'luajit_mpack' => :build
|
|
# depends_on 'perl_app_cpanminus' # L
|
|
depends_on 'tree_sitter' => :build
|
|
depends_on 'unibilium' => :build
|
|
depends_on 'utf8proc' # R
|
|
depends_on 'xdg_base' # L
|
|
|
|
no_lto
|
|
|
|
def self.postinstall
|
|
# Set nvim 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
|
|
print "\nWould you like to set nvim to be the default vi [y/N] "
|
|
case $stdin.gets.chomp.downcase
|
|
when 'y', 'yes'
|
|
@create_vi_symlink = true
|
|
else
|
|
@create_vi_symlink = false
|
|
puts 'Default vi left unchanged.'.lightgreen
|
|
end
|
|
end
|
|
if @create_vi_symlink
|
|
FileUtils.ln_sf "#{CREW_PREFIX}/bin/nvim", "#{CREW_PREFIX}/bin/vi"
|
|
puts 'Default vi set to nvim.'.lightgreen
|
|
end
|
|
|
|
@ruby_gem_name = name
|
|
system "gem uninstall -Dx --force --abort-on-dependent #{@ruby_gem_name}", exception: false
|
|
puts 'Installing neovim gem.'.lightblue
|
|
system "gem install -N #{@ruby_gem_name}", exception: false
|
|
puts 'Installing neovim python module. This may take a while...'.lightblue
|
|
system 'pip install neovim', exception: false
|
|
# cpanm install breaks due to failure to install Archive::zip.
|
|
# puts 'Installing neovim perl module. This may take a while...'.lightblue
|
|
# system 'cpanm Neovim::Ext'
|
|
end
|
|
|
|
def self.postremove
|
|
@ruby_gem_name = name
|
|
@gems_deps = `gem dependency ^#{@ruby_gem_name}\$ | awk '{print \$1}'`.chomp
|
|
# Delete the first line and convert to an array.
|
|
@gems = @gems_deps.split("\n").drop(1).append(@ruby_gem_name)
|
|
# bundler never gets uninstalled, though gem dependency lists it for
|
|
# every package, so delete it from the list.
|
|
@gems.delete('bundler')
|
|
@gems.each do |gem|
|
|
system "gem uninstall -Dx --force --abort-on-dependent #{gem}", exception: false
|
|
end
|
|
system 'pip uninstall neovim -y', exception: false
|
|
# system 'cpanm --uninstall Neovim::Ext'
|
|
# Remove vi symlink if it is to nvim.
|
|
return unless File.symlink?("#{CREW_PREFIX}/bin/vi") && (File.readlink("#{CREW_PREFIX}/bin/vi") == "#{CREW_PREFIX}/bin/nvim")
|
|
|
|
FileUtils.rm "#{CREW_PREFIX}/bin/vi"
|
|
end
|
|
end
|