mirror of
https://github.com/Maks1mS/devcontainers-features.git
synced 2025-04-07 09:03:44 +03:00
Compare commits
No commits in common. "main" and "feature_wine_0.0.2" have entirely different histories.
main
...
feature_wi
1
.github/workflows/test.yaml
vendored
1
.github/workflows/test.yaml
vendored
@ -16,7 +16,6 @@ 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
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ Installs Wine.
|
|||||||
|
|
||||||
| Options Id | Description | Type | Default Value |
|
| Options Id | Description | Type | Default Value |
|
||||||
|-----|-----|-----|-----|
|
|-----|-----|-----|-----|
|
||||||
| version | Version of Wine | string | latest |
|
| version | - | string | latest |
|
||||||
|
|
||||||
## OS Support
|
## OS Support
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,14 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "Wine",
|
"name": "Wine",
|
||||||
"id": "wine",
|
"id": "wine",
|
||||||
"version": "0.0.5",
|
"version": "0.0.2",
|
||||||
"description": "Installs Wine.",
|
"description": "Installs Wine.",
|
||||||
"documentationURL": "https://github.com/Maks1mS/devcontainers-features/tree/main/src/wine",
|
|
||||||
"options": {
|
"options": {
|
||||||
"version": {
|
"version": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"default": "latest",
|
"default": "latest"
|
||||||
"description": "Version of Wine"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"installsAfter": [
|
"installsAfter": [
|
||||||
|
@ -5,25 +5,8 @@ WINEVERSION="${VERSION:-"latest"}"
|
|||||||
|
|
||||||
WINEHOME=$_REMOTE_USER_HOME
|
WINEHOME=$_REMOTE_USER_HOME
|
||||||
WINEPREFIX="$WINEHOME/.wine32"
|
WINEPREFIX="$WINEHOME/.wine32"
|
||||||
# WINEARCH="win32"
|
WINEARCH="win32"
|
||||||
# WINEDEBUG="-all"
|
WINEDEBUG="-all"
|
||||||
|
|
||||||
COREFONTS_BASE_URL="https://raw.githubusercontent.com/Maks1mS/devcontainers-features/main/src/wine/corefonts/"
|
|
||||||
COREFONTS_FILES=(
|
|
||||||
"andale32.exe"
|
|
||||||
"arial32.exe"
|
|
||||||
"arialb32.exe"
|
|
||||||
"courie32.exe"
|
|
||||||
"georgi32.exe"
|
|
||||||
"impact32.exe"
|
|
||||||
"times32.exe"
|
|
||||||
"trebuc32.exe"
|
|
||||||
"verdan32.exe"
|
|
||||||
"wd97vwr32.exe"
|
|
||||||
"webdin32.exe"
|
|
||||||
"comic32.exe"
|
|
||||||
)
|
|
||||||
COREFONTS_CACHE_DIR="\$HOME/.cache/winetricks/corefonts/"
|
|
||||||
|
|
||||||
update_rc_file() {
|
update_rc_file() {
|
||||||
# see if folder containing file exists
|
# see if folder containing file exists
|
||||||
@ -36,12 +19,21 @@ update_rc_file() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
add_wine_repo() {
|
install_debian() {
|
||||||
wget -nv https://dl.winehq.org/wine-builds/winehq.key -O- | apt-key add -
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
echo "deb https://dl.winehq.org/wine-builds/$1 $VERSION_CODENAME main" >/etc/apt/sources.list.d/winehq.list
|
dpkg --add-architecture i386
|
||||||
}
|
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"
|
||||||
@ -49,13 +41,11 @@ set_wine_version_preference() {
|
|||||||
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 --no-install-recommends winehq-staging
|
||||||
|
|
||||||
wget -nv https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks -O /usr/bin/winetricks
|
wget 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\"
|
||||||
@ -67,15 +57,7 @@ export WINEDEBUG=-all"
|
|||||||
update_rc_file "$_REMOTE_USER_HOME/.profile" "${snippet}"
|
update_rc_file "$_REMOTE_USER_HOME/.profile" "${snippet}"
|
||||||
update_rc_file "$_REMOTE_USER_HOME/.bashrc" "${snippet}"
|
update_rc_file "$_REMOTE_USER_HOME/.bashrc" "${snippet}"
|
||||||
|
|
||||||
su -l $_REMOTE_USER <<EOF
|
su -l "$_REMOTE_USER" -c "mkdir -p $WINEPREFIX && wine wineboot --init"
|
||||||
mkdir -p "\$WINEPREFIX"
|
|
||||||
wine wineboot --init
|
|
||||||
mkdir -p "$COREFONTS_CACHE_DIR"
|
|
||||||
for filename in ${COREFONTS_FILES[@]}; do
|
|
||||||
wget -nv -P "$COREFONTS_CACHE_DIR" "$COREFONTS_BASE_URL\$filename"
|
|
||||||
done
|
|
||||||
winetricks corefonts
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
apt purge --auto-remove -y
|
apt purge --auto-remove -y
|
||||||
@ -85,27 +67,7 @@ EOF
|
|||||||
|
|
||||||
. /etc/os-release
|
. /etc/os-release
|
||||||
|
|
||||||
if [ "${ID}" = "ubuntu" ]; then
|
if [ "${ID}" = "debian" ]; 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."
|
||||||
|
@ -3,7 +3,6 @@ set -e
|
|||||||
|
|
||||||
source dev-container-features-test-lib
|
source dev-container-features-test-lib
|
||||||
|
|
||||||
check "wine exists" bash -c "wine --version"
|
|
||||||
check "wine version is same" bash -c "[[ "$(wine --version | tr -d -c 0-9.)" == *"8.5"* ]]"
|
check "wine version is same" bash -c "[[ "$(wine --version | tr -d -c 0-9.)" == *"8.5"* ]]"
|
||||||
|
|
||||||
reportResults
|
reportResults
|
Loading…
Reference in New Issue
Block a user