Commit eb0ee0f7 authored by vincowl's avatar vincowl Committed by Ed Reel

Upgrade Hunspell to 1.7.0 and add french dictionary (#3595)

* Upgrade Hunspell to 1.7.0 and add french dictionary

* Simplify this package after review's first steps

* Split dictionaries installation in new packages

* Correct the Hunspell_fr package name

* Correction of dictionaries folder

* Extract the english module and solve bugs

* Simplify postinstall step

* Remove unnecessary files

* Clean packages and add spanish

* Clean packages and add spanish

* Add a menu to define the language to install by default with hunspell

* Remove unnessary lines and correct bugs

* Add a hunspell_base package to ease maintenance and default language choice

* remove unused dependency
parent eed3d1d6
......@@ -3,51 +3,38 @@ require 'package'
class Hunspell < Package
description 'Hunspell is a spell checker and morphological analyzer library'
homepage 'http://hunspell.github.io/'
version '1.6.2'
source_url 'https://github.com/hunspell/hunspell/archive/v1.6.2.tar.gz'
source_sha256 '3cd9ceb062fe5814f668e4f22b2fa6e3ba0b339b921739541ce180cac4d6f4c4'
version '1.7.0'
source_url 'https://github.com/hunspell/hunspell/archive/v1.7.0.tar.gz'
source_sha256 'bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a'
binary_url ({
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/hunspell-1.6.2-chromeos-armv7l.tar.xz',
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/hunspell-1.6.2-chromeos-armv7l.tar.xz',
i686: 'https://dl.bintray.com/chromebrew/chromebrew/hunspell-1.6.2-chromeos-i686.tar.xz',
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/hunspell-1.6.2-chromeos-x86_64.tar.xz',
})
binary_sha256 ({
aarch64: '2122527ab9f428c6d88d22ea142c134bf648b933963178f368ce5e9832d93317',
armv7l: '2122527ab9f428c6d88d22ea142c134bf648b933963178f368ce5e9832d93317',
i686: '1e7bd3254580e4a211b1b8208e548675602290e9c7a1105ba66af6d4c9cee8da',
x86_64: '76e93eec7e0cec41707fd68f0f21351e94c25e8b993431f3bf400693d3de8251',
})
depends_on 'readline'
def self.build
system 'autoreconf -vfi'
system './configure',
"--prefix=#{CREW_PREFIX}",
"--libdir=#{CREW_LIB_PREFIX}",
'--with-readline',
'--with-ui'
system "sed -i 's,/usr/share,#{CREW_PREFIX}/share,g' man/hunspell.1"
system "sed -i 's,/usr/share,#{CREW_PREFIX}/share,g' src/tools/hunspell.cxx"
system "sed -i 's,ncurses.h,#{CREW_PREFIX}/include/ncursesw/ncurses.h,' src/tools/hunspell.cxx"
system 'make'
end
if ARGV[0] == 'install'
puts
puts "Enter your preferred language:"
puts "1 = English (US)"
puts "2 = French (FR)"
puts "3 = Spanish (ANY)"
puts "0 = Cancel"
def self.install
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
system "install -Dm644 dictionaries/en/en_US.aff #{CREW_DEST_DIR}$HOME/Library/Spelling/en_US.aff"
system "install -Dm644 dictionaries/en/en_US.dic #{CREW_DEST_DIR}$HOME/Library/Spelling/en_US.dic"
system "install -Dm644 dictionaries/en/en_US.aff $HOME/Library/Spelling/en_US.aff"
system "install -Dm644 dictionaries/en/en_US.dic $HOME/Library/Spelling/en_US.dic"
while version = STDIN.gets.chomp
case version
when '1'
depends_on 'hunspell_en_us'
break
when '2'
depends_on 'hunspell_fr_fr'
break
when '3'
depends_on 'hunspell_es_any'
break
when '0'
abort
end
end
end
def self.postinstall
puts
puts "To complete the installation, execute the following:".lightblue
puts "echo 'export DICTIONARY=en_US' >> ~/.bashrc && source ~/.bashrc".lightblue
puts
end
end
require 'package'
class Hunspell_base < Package
description 'Hunspell is a spell checker and morphological analyzer library'
homepage 'http://hunspell.github.io/'
version '1.7.0'
source_url 'https://github.com/hunspell/hunspell/archive/v1.7.0.tar.gz'
source_sha256 'bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a'
binary_url ({
})
binary_sha256 ({
})
depends_on 'readline'
def self.build
system 'autoreconf -vfi'
system './configure',
"--prefix=#{CREW_PREFIX}",
"--include=#{CREW_PREFIX}/include",
"--libdir=#{CREW_LIB_PREFIX}",
'--with-ui',
'--with-readline'
system "sed -i 's,/usr/share,#{CREW_PREFIX}/share,g' man/hunspell.1"
system "sed -i 's,/usr/share,#{CREW_PREFIX}/share,g' src/tools/hunspell.cxx"
system "sed -i 's,ncurses.h,#{CREW_PREFIX}/include/ncursesw/ncurses.h,' src/tools/hunspell.cxx"
system 'make'
end
def self.install
system "make", "DESTDIR=#{CREW_DEST_DIR}", "install"
end
end
require 'package'
class Hunspell_en_us < Package
description 'Hunspell US English dictionary'
homepage 'http://hunspell.github.io/'
version '1.7.0'
source_url 'https://github.com/hunspell/hunspell/archive/v1.7.0.tar.gz'
source_sha256 'bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a'
binary_url ({
})
binary_sha256 ({
})
depends_on 'hunspell_base'
def self.install
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
system "install -Dm644 dictionaries/en/en_US.aff #{CREW_DEST_HOME}/Library/Spelling/en_US.aff"
system "install -Dm644 dictionaries/en/en_US.dic #{CREW_DEST_HOME}/Library/Spelling/en_US.dic"
end
def self.postinstall
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
FileUtils.cp 'dictionaries/en/en_US.aff', "#{HOME}/Library/Spelling/en_US.aff"
FileUtils.cp 'dictionaries/en/en_US.dic', "#{HOME}/Library/Spelling/en_US.dic"
FileUtils.rm_rf 'dictionaries/'
puts
puts "To update the dictionaries periodically, execute 'crew postinstall hunspell_en_us'.".lightblue
puts
puts "To complete the installation, execute the following:".lightblue
puts "echo 'export DICTIONARY=en_US' >> ~/.bashrc && source ~/.bashrc".lightblue
puts
end
end
require 'package'
class Hunspell_es_any < Package
description 'Hunspell Spanish dictionary'
homepage 'http://hunspell.github.io/'
version '1.7.0'
source_url 'https://github.com/hunspell/hunspell/archive/v1.7.0.tar.gz'
source_sha256 'bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a'
binary_url ({
})
binary_sha256 ({
})
depends_on 'hunspell_base'
def self.install
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
system "install -Dm644 dictionaries/es/es_ANY.aff #{CREW_DEST_HOME}/Library/Spelling/es_ANY.aff"
system "install -Dm644 dictionaries/es/es_ANY.dic #{CREW_DEST_HOME}/Library/Spelling/es_ANY.dic"
end
def self.postinstall
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
FileUtils.cp 'dictionaries/es/es_ANY.aff', "#{HOME}/Library/Spelling/es_ANY.aff"
FileUtils.cp 'dictionaries/es/es_ANY.dic', "#{HOME}/Library/Spelling/es_ANY.dic"
FileUtils.rm_rf 'dictionaries/'
puts
puts "To update the dictionaries periodically, execute 'crew postinstall hunspell_es_any'".lightblue
puts
puts "To complete the installation, execute the following:".lightblue
puts "echo 'export DICTIONARY=es_ANY' >> ~/.bashrc && source ~/.bashrc".lightblue
puts
end
end
require 'package'
class Hunspell_fr_fr < Package
description 'Hunspell French dictionary'
homepage 'http://hunspell.github.io/'
version '1.7.0'
source_url 'https://github.com/hunspell/hunspell/archive/v1.7.0.tar.gz'
source_sha256 'bb27b86eb910a8285407cf3ca33b62643a02798cf2eef468c0a74f6c3ee6bc8a'
binary_url ({
})
binary_sha256 ({
})
depends_on 'hunspell_base'
def self.install
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
system "install -Dm644 dictionaries/fr_FR/fr.aff #{CREW_DEST_HOME}/Library/Spelling/fr_FR.aff"
system "install -Dm644 dictionaries/fr_FR/fr.dic #{CREW_DEST_HOME}/Library/Spelling/fr_FR.dic"
end
def self.postinstall
system 'git clone -b libreoffice-6-1 --depth 1 git://anongit.freedesktop.org/libreoffice/dictionaries.git'
FileUtils.cp 'dictionaries/fr_FR/fr.aff', "#{HOME}/Library/Spelling/fr_FR.aff"
FileUtils.cp 'dictionaries/fr_FR/fr.dic', "#{HOME}/Library/Spelling/fr_FR.dic"
FileUtils.rm_rf 'dictionaries/'
puts
puts "To update the dictionaries periodically, execute 'crew postinstall hunspell_fr_fr'".lightblue
puts
puts "To complete the installation, execute the following:".lightblue
puts "echo 'export DICTIONARY=fr_FR' >> ~/.bashrc && source ~/.bashrc".lightblue
puts
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment