mirror of
				https://github.com/Maks1mS/devcontainers-features.git
				synced 2025-11-04 07:51:22 +03:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
			ecf388f7c9
			...
			main
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| b427477a17 | |||
| ae7a5e3fa6 | |||
| d14d3b178c | |||
| 53721cc2ba | |||
| 83b1e774b0 | |||
| e6b8f06415 | |||
| 1ee909955c | |||
| 81cd078b31 | 
							
								
								
									
										1
									
								
								.github/workflows/test.yaml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.github/workflows/test.yaml
									
									
									
									
										vendored
									
									
								
							@@ -16,6 +16,7 @@ jobs:
 | 
			
		||||
          - wine
 | 
			
		||||
        baseImage:
 | 
			
		||||
          - mcr.microsoft.com/devcontainers/base:debian
 | 
			
		||||
          - mcr.microsoft.com/devcontainers/base:ubuntu
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v3
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/andale32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/andale32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/arial32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/arial32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/arialb32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/arialb32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/comic32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/comic32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/courie32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/courie32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/georgi32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/georgi32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/impact32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/impact32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/times32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/times32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/trebuc32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/trebuc32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/verdan32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/verdan32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/wd97vwr32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/wd97vwr32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/wine/corefonts/webdin32.exe
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/wine/corefonts/webdin32.exe
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@@ -1,7 +1,7 @@
 | 
			
		||||
{
 | 
			
		||||
    "name": "Wine",
 | 
			
		||||
    "id": "wine",
 | 
			
		||||
    "version": "0.0.3",
 | 
			
		||||
    "version": "0.0.5",
 | 
			
		||||
    "description": "Installs Wine.",
 | 
			
		||||
    "documentationURL": "https://github.com/Maks1mS/devcontainers-features/tree/main/src/wine",
 | 
			
		||||
    "options": {
 | 
			
		||||
@@ -14,4 +14,4 @@
 | 
			
		||||
    "installsAfter": [
 | 
			
		||||
        "ghcr.io/devcontainers/features/common-utils"
 | 
			
		||||
    ]
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
@@ -5,8 +5,25 @@ WINEVERSION="${VERSION:-"latest"}"
 | 
			
		||||
 | 
			
		||||
WINEHOME=$_REMOTE_USER_HOME
 | 
			
		||||
WINEPREFIX="$WINEHOME/.wine32"
 | 
			
		||||
WINEARCH="win32"
 | 
			
		||||
WINEDEBUG="-all"
 | 
			
		||||
# WINEARCH="win32"
 | 
			
		||||
# 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() {
 | 
			
		||||
  # see if folder containing file exists
 | 
			
		||||
@@ -19,21 +36,12 @@ update_rc_file() {
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
install_debian() {
 | 
			
		||||
  export DEBIAN_FRONTEND=noninteractive
 | 
			
		||||
  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
 | 
			
		||||
add_wine_repo() {
 | 
			
		||||
  wget -nv https://dl.winehq.org/wine-builds/winehq.key -O- | apt-key add -
 | 
			
		||||
  echo "deb https://dl.winehq.org/wine-builds/$1 $VERSION_CODENAME main" >/etc/apt/sources.list.d/winehq.list
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
set_wine_version_preference() {
 | 
			
		||||
  if [ "${WINEVERSION}" != "latest" ]; then
 | 
			
		||||
    {
 | 
			
		||||
      echo "Package: *wine* *wine*:i386"
 | 
			
		||||
@@ -41,11 +49,13 @@ install_debian() {
 | 
			
		||||
      echo "Pin-Priority: 1001"
 | 
			
		||||
    } >/etc/apt/preferences.d/winehq.pref
 | 
			
		||||
  fi
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
install_wine() {
 | 
			
		||||
  apt-get update
 | 
			
		||||
  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
 | 
			
		||||
 | 
			
		||||
  snippet="export WINEHOME=\"$_REMOTE_USER_HOME\"
 | 
			
		||||
@@ -57,10 +67,15 @@ export WINEDEBUG=-all"
 | 
			
		||||
  update_rc_file "$_REMOTE_USER_HOME/.profile" "${snippet}"
 | 
			
		||||
  update_rc_file "$_REMOTE_USER_HOME/.bashrc" "${snippet}"
 | 
			
		||||
 | 
			
		||||
  su -l "$_REMOTE_USER" -c "mkdir -p $WINEPREFIX && wine wineboot --init"
 | 
			
		||||
  su -l "$_REMOTE_USER" -c "echo \"check-certificate = off\" >> ~/.wgetrc"
 | 
			
		||||
  su -l "$_REMOTE_USER" -c "echo \"check_certificate = off\" >> ~/.wgetrc"
 | 
			
		||||
  su -l "$_REMOTE_USER" -c "winetricks corefonts"
 | 
			
		||||
  su -l $_REMOTE_USER <<EOF
 | 
			
		||||
    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
 | 
			
		||||
  apt purge --auto-remove -y
 | 
			
		||||
@@ -70,7 +85,27 @@ export WINEDEBUG=-all"
 | 
			
		||||
 | 
			
		||||
. /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
 | 
			
		||||
else
 | 
			
		||||
  echo "Linux distro ${ID} not supported."
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,7 @@ set -e
 | 
			
		||||
 | 
			
		||||
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"* ]]"
 | 
			
		||||
 | 
			
		||||
reportResults
 | 
			
		||||
reportResults
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user