From 8650e123642d09c8d4ca5cb68fda1f096d1f18f2 Mon Sep 17 00:00:00 2001 From: arch1t3cht Date: Sun, 3 Dec 2023 21:08:18 +0100 Subject: [PATCH] Download hunspell dictionaries from GH repo Since the download from SourceForge frequently fails, the English dictionaries are now hosted in a TypesettingTools repository. --- packages/win_installer/fragment_spelling.iss | 4 ++-- tools/osx-bundle.sh | 4 ++-- tools/win-installer-setup.ps1 | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/packages/win_installer/fragment_spelling.iss b/packages/win_installer/fragment_spelling.iss index 8e4168727e..8a5bca5e15 100644 --- a/packages/win_installer/fragment_spelling.iss +++ b/packages/win_installer/fragment_spelling.iss @@ -1,5 +1,5 @@ ; This file declares all installables related to spell checking and thesaurii in Aegisub [Files] -Source: {#DEPS_DIR}\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dictionaries/en_US -Source: {#DEPS_DIR}\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: ignoreversion; Components: dictionaries/en_US +Source: {#DEPS_DIR}\dictionaries\en_US.aff; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion; Components: dictionaries/en_US +Source: {#DEPS_DIR}\dictionaries\en_US.dic; DestDir: {app}\dictionaries; Flags: skipifsourcedoesntexist ignoreversion; Components: dictionaries/en_US diff --git a/tools/osx-bundle.sh b/tools/osx-bundle.sh index 813151a555..cefa8d0c24 100755 --- a/tools/osx-bundle.sh +++ b/tools/osx-bundle.sh @@ -64,8 +64,8 @@ else mkdir -p "${BUILD_DIR}/dictionaries" if ! test -f "${BUILD_DIR}/dictionaries/en_US.aff"; then echo "Specified dictionary directory ${DICT_DIR} not found. Downloading dictionaries:" - curl -L "https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip" -o "${BUILD_DIR}/dictionaries/en_US.zip" - unzip "${BUILD_DIR}/dictionaries/en_US.zip" -d "${BUILD_DIR}/dictionaries" + curl -L "https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.aff" -o "${BUILD_DIR}/dictionaries/en_US.aff" + curl -L "https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.dic" -o "${BUILD_DIR}/dictionaries/en_US.dic" fi cp -v "${BUILD_DIR}/dictionaries/en_US.aff" "${PKG_DIR}/Contents/SharedSupport/dictionaries" cp -v "${BUILD_DIR}/dictionaries/en_US.dic" "${PKG_DIR}/Contents/SharedSupport/dictionaries" diff --git a/tools/win-installer-setup.ps1 b/tools/win-installer-setup.ps1 index ca46d88863..af9665b5bc 100644 --- a/tools/win-installer-setup.ps1 +++ b/tools/win-installer-setup.ps1 @@ -84,10 +84,8 @@ if (!(Test-Path VC_redist)) { # dictionaries if (!(Test-Path dictionaries)) { New-Item -ItemType Directory dictionaries - [Net.ServicePointManager]::SecurityProtocol = "Tls12" # Needed since otherwise downloading fails in some places like on the GitHub CI: https://stackoverflow.com/a/66614041/4730656 - Invoke-WebRequest https://downloads.sourceforge.net/project/openofficeorg.mirror/contrib/dictionaries/en_US.zip -UserAgent "Wget" -OutFile en_US.zip -UseBasicParsing - Expand-Archive -LiteralPath en_US.zip -DestinationPath dictionaries - Remove-Item en_US.zip + Invoke-WebRequest https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.aff -OutFile dictionaries/en_US.aff -UseBasicParsing + Invoke-WebRequest https://raw.githubusercontent.com/TypesettingTools/Aegisub-dictionaries/master/dicts/en_US.dic -OutFile dictionaries/en_US.dic -UseBasicParsing } # localization