add ubuntu support

This commit is contained in:
Maxim Slipenko 2024-04-19 16:32:09 +00:00 committed by GitHub
parent d14d3b178c
commit ae7a5e3fa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 31 additions and 17 deletions

View File

@ -16,6 +16,7 @@ jobs:
- wine - wine
baseImage: baseImage:
- mcr.microsoft.com/devcontainers/base:debian - mcr.microsoft.com/devcontainers/base:debian
- mcr.microsoft.com/devcontainers/base:ubuntu
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -36,21 +36,12 @@ update_rc_file() {
fi fi
} }
install_debian() { add_wine_repo() {
export DEBIAN_FRONTEND=noninteractive wget -nv https://dl.winehq.org/wine-builds/winehq.key -O- | apt-key add -
dpkg --add-architecture i386 echo "deb https://dl.winehq.org/wine-builds/$1 $VERSION_CODENAME main" >/etc/apt/sources.list.d/winehq.list
apt-get update }
apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
telnet \
cabextract \
gnupg2 \
wget
wget https://dl.winehq.org/wine-builds/winehq.key -O - | apt-key add -
echo "deb https://dl.winehq.org/wine-builds/debian $VERSION_CODENAME main" >/etc/apt/sources.list.d/winehq.list
set_wine_version_preference() {
if [ "${WINEVERSION}" != "latest" ]; then if [ "${WINEVERSION}" != "latest" ]; then
{ {
echo "Package: *wine* *wine*:i386" echo "Package: *wine* *wine*:i386"
@ -58,11 +49,13 @@ install_debian() {
echo "Pin-Priority: 1001" echo "Pin-Priority: 1001"
} >/etc/apt/preferences.d/winehq.pref } >/etc/apt/preferences.d/winehq.pref
fi fi
}
install_wine() {
apt-get update apt-get update
apt-get install -y --install-recommends winehq-staging apt-get install -y --install-recommends winehq-staging
wget https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O /usr/bin/winetricks wget -nv https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O /usr/bin/winetricks
chmod +rx /usr/bin/winetricks chmod +rx /usr/bin/winetricks
snippet="export WINEHOME=\"$_REMOTE_USER_HOME\" snippet="export WINEHOME=\"$_REMOTE_USER_HOME\"
@ -79,7 +72,7 @@ export WINEDEBUG=-all"
wine wineboot --init wine wineboot --init
mkdir -p "$COREFONTS_CACHE_DIR" mkdir -p "$COREFONTS_CACHE_DIR"
for filename in ${COREFONTS_FILES[@]}; do for filename in ${COREFONTS_FILES[@]}; do
wget -P "$COREFONTS_CACHE_DIR" "$COREFONTS_BASE_URL\$filename" wget -nv -P "$COREFONTS_CACHE_DIR" "$COREFONTS_BASE_URL\$filename"
done done
winetricks corefonts winetricks corefonts
EOF EOF
@ -92,7 +85,27 @@ EOF
. /etc/os-release . /etc/os-release
if [ "${ID}" = "debian" ]; then if [ "${ID}" = "ubuntu" ]; then
install_ubuntu() {
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture i386
apt-get update
apt-get install -y apt-transport-https ca-certificates telnet cabextract gnupg2 wget
add_wine_repo "ubuntu"
set_wine_version_preference
install_wine
}
install_ubuntu
elif [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
install_debian() {
export DEBIAN_FRONTEND=noninteractive
dpkg --add-architecture i386
apt-get update
apt-get install -y apt-transport-https ca-certificates telnet cabextract gnupg2 wget
add_wine_repo "debian"
set_wine_version_preference
install_wine
}
install_debian install_debian
else else
echo "Linux distro ${ID} not supported." echo "Linux distro ${ID} not supported."