Skip to content

Commit

Permalink
root: enabled research paper pipeline (srcRESEARCH)
Browse files Browse the repository at this point in the history
Since we want this library to be reliably good, we should enable
the research paper pipeline and place all our details and data in
it. That way, interested folks and code auditors can review the
materials without needing to ping-pong with the maintainers that
often.

This patch enables research paper pipeline (srcRESEARCH) in
root repository.

Co-authored-by: Shuralyov, Jean <[email protected]>
Co-authored-by: Galyna, Cory <[email protected]>
Co-authored-by: (Holloway) Chew, Kean Ho <[email protected]>
Signed-off-by: (Holloway) Chew, Kean Ho <[email protected]>
  • Loading branch information
3 people committed Jun 10, 2024
1 parent 30de314 commit 5fe183e
Show file tree
Hide file tree
Showing 6 changed files with 463 additions and 180 deletions.
13 changes: 9 additions & 4 deletions CONFIG.toml
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ PROJECT_LIBREOFFICE = ''
#
# Refer to the following mirror list for value selection:
# (1) https://download.documentfoundation.org/mirmon/allmirrors.html
PROJECT_LIBREOFFICE_MIRROR = "https://ftp.osuosl.org/pub/tdf/libreoffice"

PROJECT_LIBREOFFICE_MIRROR = "https://download.documentfoundation.org/libreoffice"

# PROJECT_LIBREOFFICE_VERSION
# This is for defining the LibreOffice version to install into the local OS.
Expand All @@ -472,7 +471,13 @@ PROJECT_LIBREOFFICE_MIRROR = "https://ftp.osuosl.org/pub/tdf/libreoffice"
# (1) https://www.libreoffice.org/download/download-libreoffice/
#
# Example: '24.2.1' for 'LibreOffice 24.2.1'
PROJECT_LIBREOFFICE_VERSION = "24.2.1"
PROJECT_LIBREOFFICE_VERSION = "24.2.3"


# PROJECT_PATH_LIBREOFFICE_ENGINE
# This is a relative pathing to PROJECT_PATH_ROOT + PROJECT_PATH_TOOLS for
# setting up localized environment.
PROJECT_PATH_LIBREOFFICE_ENGINE = "libreoffice-engine"



Expand Down Expand Up @@ -646,7 +651,7 @@ PROJECT_PYPI_README_MIME = "text/markdown"
#
# To enable it: simply supply the path (e.g. default is 'srcRESEARCH').
# To disable it: simply supply an empty path (e.g. default is '').
PROJECT_RESEARCH = ''
PROJECT_RESEARCH = 'srcRESEARCH'



Expand Down
197 changes: 112 additions & 85 deletions automataCI/services/compilers/libreoffice.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,40 @@ function LIBREOFFICE-Get {



function LIBREOFFICE-Get-Path-Local {
$___path = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TOOLS}\${env:PROJECT_PATH_LIBREOFFICE_ENGINE}\bin\soffice"

switch ("${env:PROJECT_OS}") {
"windows" {
$___path = "${___path}.exe"
} default {
# do nothing
}}


# report status
return $___path
}




function LIBREOFFICE-Get-Path {
switch ("$(OS-Get)") {
$___path = LIBREOFFICE-Get-Path-Local
if ($(FS-Is-File "${___path}") -eq 0) {
return $___path
}

switch ("${env:PROJECT_OS}") {
"darwin" {
$___path = "/Applications/LibreOffice.app/Contents/MacOS/soffice"
} "windows" {
$___path = "C:\Program Files\LibreOffice\program\soffice.exe"
$___path = "${___path}.exe"
if ($(FS-Is-File "${___path}") -ne 0) {
$___path = "C:\Program Files\LibreOffice\program\soffice.exe"
}
} default {
$___path = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TOOLS}\libreoffice\bin\libreoffice"
# do nothing
}}


Expand All @@ -68,8 +94,6 @@ function LIBREOFFICE-Get-Path {

function LIBREOFFICE-Is-Available {
# execute
$null = OS-Sync

$___process = OS-Is-Command-Available "libreoffice"
if ($___process -eq 0) {
return 0
Expand Down Expand Up @@ -110,87 +134,70 @@ function LIBREOFFICE-Setup {


# execute
if ($(OS-Get) -eq "darwin") {
$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\libreoffice\instal.dmg"
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"


## Download directly from provider
$___url = "${env:PROJECT_LIBREOFFICE_MIRROR}/stable/${env:PROJECT_LIBREOFFICE_VERSION}"
$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TOOLS}\${env:PROJECT_PATH_LIBREOFFICE_ENGINE}"
$___url = "${env:PROJECT_LIBREOFFICE_MIRROR}/stable/${env:PROJECT_LIBREOFFICE_VERSION}"
switch ("${env:PROJECT_OS}") {
"darwin" {
$___dest = "${___dest}\install.dmg"
$___url = "${___url}/mac"
if ($(OS-Get-Arch) -eq "amd64") {
switch ("${env:PROJECT_ARCH}") {
"amd64" {
$___url = "${___url}/x86_64"
$___url = "${___url}/LibreOffice_${env:PROJECT_LIBREOFFICE_VERSION}_MacOS_x86-64.dmg"
} elseif ($(OS-Get-Arch) -eq "arm64") {
} "arm64" {
$___url = "${___url}/aarch64"
$___url = "${___url}/LibreOffice_${env:PROJECT_LIBREOFFICE_VERSION}_MacOS_aarch64.dmg"
} else {
return 1
}


# download from provider
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -ne 0) {
return 1
}


## silently install
$___process = Apple-Install-DMG "${___dest}"
if ($___process -ne 0) {
return 1
}


## clean up
$null = FS-Remove-Silently "${___dest}"
} elseif ($(OS-Get) -eq "windows") {
## Attempt to use directly from the provider
$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TEMP}\libreoffice\install.msi"
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"

} default {
$___url = ""
}}

$___url = "${env:PROJECT_LIBREOFFICE_MIRROR}/stable/${env:PROJECT_LIBREOFFICE_VERSION}"
$___url = "${___url}/win"
if ($(OS-Get-Arch) -eq "amd64") {
$___url = "${___url}/x86_64"
$___url = "${___url}/LibreOffice_${env:PROJECT_LIBREOFFICE_VERSION}_Win_x86-64.msi"
} elseif ($(OS-Get-Arch) -eq "arm64") {
$___url = "${___url}/aarch64"
$___url = "${___url}/LibreOffice_${env:PROJECT_LIBREOFFICE_VERSION}_Win_aarch64.msi"
} else {
## fallback to choco as the last resort
$___process = OS-Is-Command-Available "choco"
## attempt to download from vendor directly
if ($(STRINGS-Is-Empty "${___url}") -ne 0) {
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -ne 0) {
return 1
}

$___process = OS-Exec "choco" "install libreoffice-fresh -y"
$___process = Apple-Install-DMG "${___dest}"
if ($___process -ne 0) {
return 1
}

return 0
$null = FS-Remove-Silently "${___dest}"
}
} "windows" {
switch ("${env:PROJECT_ARCH}") {
"amd64" {
$___dest = LIBREOFFICE-Get-Path-Local
$___url = "${env:PROJECT_LIBREOFFICE_MIRROR}/portable/${env:PROJECT_LIBREOFFICE_VERSION}"
$___url = "${___url}/LibreOfficePortable_${env:PROJECT_LIBREOFFICE_VERSION}_MultilingualAll.paf.exe"

$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -ne 0) {
return 1
}
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -ne 0) {
$null = FS-Remove-Silently "${___dest}"
}
} "arm64" {
$___dest = "${___dest}\install.msi"
$___url = "${___url}/win/aarch64"
$___url = "${___url}/LibreOffice_${env:PROJECT_LIBREOFFICE_VERSION}_Win_aarch64.msi"

$___process = FS-Is-File "${___dest}"
if ($___process -ne 0) {
return 1
}
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -eq 0) {
$___process = MSI-Install-Silent "${___dest}"
$null = FS-Remove-Silently "${___dest}"
}
} default {
$___url = ""
}}

$___process = MSI-Install-Silent "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$null = OS-Sync
if ($___process -ne 0) {
## fallback to choco as the last resort
## fallback to choco as the last resort
if (($(STRINGS-Is-Empty "${___url}") -eq 0) -or ($___process -ne 0)) {
$___process = OS-Is-Command-Available "choco"
if ($___process -ne 0) {
return 1
Expand All @@ -202,27 +209,47 @@ function LIBREOFFICE-Setup {
}

$null = OS-Sync
return 0
}
} else {
## check compatible platform version
$___url = "https://appimages.libreitalia.org"
switch ("$(OS-Get-Arch)") {
"amd64" {
$___url = "${___url}/LibreOffice-fresh.full-x86_64.AppImage"
} default {
return 1
}}

} "linux" {
$___process = OS-Is-Command-Available "flatpak"
if ($___process -eq 0) {
$___process = OS-Exec "flatpak" "--user install org.libreoffice.LibreOffice"
}

## download appimage portable version
$___dest = "${env:PROJECT_PATH_ROOT}\${env:PROJECT_PATH_TOOLS}\libreoffice\bin\libreoffice"
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
## download appimage as last resort
if ($___process -ne 0) {
return 1
$___dest = LIBREOFFICE-Get-Path-Local
$___url = "https://appimages.libreitalia.org"
switch ("${env:PROJECT_ARCH}") {
"amd64" {
$___url = "${___url}/LibreOffice-fresh.full-x86_64.AppImage"
} default {
return 1
}}

if ($(STRINGS-Is-Empty "${___url}") -ne 0) {
$null = FS-Make-Housing-Directory "${___dest}"
$null = FS-Remove-Silently "${___dest}"
$___process = HTTP-Download "GET" "${___url}" "${___dest}"
if ($___process -ne 0) {
return 1
}

$___process = FS-Is-File "${___dest}"
if ($___process -ne 0) {
return 1
}
}
}
} default {
return 1 # unsupported
}}


# test the output
$___process = LIBREOFFICE-Is-Available
if ($___process -ne 0) {
return 1
}


Expand Down
Loading

0 comments on commit 5fe183e

Please sign in to comment.