7 Commits

6 changed files with 274 additions and 142 deletions
Unified View
  1. +84
    -59
      arch/updatewine_arch.sh
  2. +66
    -28
      debian/dxvkroot/dxvkbuild.sh
  3. +3
    -1
      debian/updatewine_debian.sh
  4. +53
    -25
      debian/wineroot/winebuild.sh
  5. +35
    -14
      debian_install_nvidia.sh
  6. +33
    -15
      updatewine.sh

+ 84
- 59
arch/updatewine_arch.sh View File

@ -101,18 +101,15 @@ function INFO_SEP() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - ;
########################################################### ###########################################################
# If the script is interrupted (Ctrl+C/SIGINT), do the following
# TODO Shall we remove git folders or keep them?
dxvk_wine_cleanlist=('*.patch' '*.diff' 'pkg' 'src' '*-patches' '*.tar.xz' '*.sig')
function Arch_intCleanup() {
rm -rf ${ARCH_BUILDROOT}/{0-wine-staging-git/{wine-patches,*.tar.xz,*.sig},0-dxvk-git/{dxvk-git,*.tar.xz,*.sig}}
exit 0
function cleanUp() {
rm -rf ${ARCH_BUILDROOT}/*/{$(echo "${dxvk_wine_cleanlist[@]}" | tr ' ' ',')}
} }
# Allow interruption of the script at any time (Ctrl + C) # Allow interruption of the script at any time (Ctrl + C)
trap "Arch_intCleanup" INT
# Error event
#trap "Arch_intCleanup" ERR
trap "cleanUp" SIGINT SIGTERM SIGQUIT
########################################################### ###########################################################
@ -130,14 +127,21 @@ function ccacheCheck() {
function checkFiles() { function checkFiles() {
local wine_files=('30-win32-aliases.conf' 'PKGBUILD')
local dxvk_files=('PKGBUILD')
local wine_files
local dxvk_files
wine_files=('30-win32-aliases.conf' 'PKGBUILD')
dxvk_files=('PKGBUILD')
function validatefiles() { function validatefiles() {
local list=${1}
local name=${2}
local path=${3}
local list
local name
local path
list=${1}
name=${2}
path=${3}
for file in ${list[@]}; do for file in ${list[@]}; do
if [[ ! -f "${path}/${file}" ]]; then if [[ ! -f "${path}/${file}" ]]; then
@ -184,44 +188,51 @@ function checkStaging() {
# annoying situations which could occur later while the script # annoying situations which could occur later while the script
# is already running. # is already running.
# Just for "packages which are not found" array <=> ERRPKGS
# Just for "packages which are not found" array <=> errpkgs
# We need to set it outside of checkDepends function # We need to set it outside of checkDepends function
# because it is a global variable for all checked packages # because it is a global variable for all checked packages
l=0 l=0
function checkDepends() { function checkDepends() {
# The first and the second argument
local packagedir=${1}
local package=${2}
local packagedir
local package
local file
local file_vars
local field
local i
local pkgs
packagedir=${1}
package=${2}
# We get necessary variables to check from this file # We get necessary variables to check from this file
local file="./${packagedir}/PKGBUILD"
file="./${packagedir}/PKGBUILD"
# All but the (zero), the first and the second argument # All but the (zero), the first and the second argument
# We check the value of these file variables # We check the value of these file variables
local file_vars=${@:3}
file_vars=${@:3}
for var in ${file_vars[*]}; do for var in ${file_vars[*]}; do
# Get the variable and set it as a new variable in the current shell # Get the variable and set it as a new variable in the current shell
# This is applicable only to variable arrays! Do not use if the variable is not an array. # This is applicable only to variable arrays! Do not use if the variable is not an array.
local field=$(awk "/^${var}/,/)/" ${file} | sed -r "s/^${var}=|[)|(|']//g")
field=$(awk "/^${var}/,/)/" ${file} | sed -r "s/^${var}=|[)|(|']//g")
local i=0
i=0
for parse in ${field[*]}; do for parse in ${field[*]}; do
if [[ ! $parse =~ ^# ]]; then if [[ ! $parse =~ ^# ]]; then
local PKGS[$i]=$(printf '%s' $parse | sed 's/[=|>|<].*$//')
pkgs[$i]=$(printf '%s' $parse | sed 's/[=|>|<].*$//')
let i++ let i++
fi fi
done done
# Sort list and delete duplicate index values # Sort list and delete duplicate index values
local PKGS=($(sort -u <<< "${PKGS[*]}"))
pkgs=($(sort -u <<< "${pkgs[*]}"))
for pkg in ${PKGS[*]}; do
for pkg in ${pkgs[*]}; do
if [[ $(printf $(pacman -Q ${pkg} &>/dev/null)$?) -ne 0 ]]; then if [[ $(printf $(pacman -Q ${pkg} &>/dev/null)$?) -ne 0 ]]; then
ERRPKGS[$l]=${pkg}
errpkgs[$l]=${pkg}
echo -e "\e[91mERROR:\e[0m Dependency '${pkg}' not found, required by '${package}' (${file} => ${var})" echo -e "\e[91mERROR:\e[0m Dependency '${pkg}' not found, required by '${package}' (${file} => ${var})"
let l++ let l++
fi fi
@ -235,9 +246,9 @@ function checkDepends() {
function check_alldeps() { function check_alldeps() {
if [[ -v ERRPKGS ]]; then
if [[ -v errpkgs ]]; then
echo -e "\e[1mERROR:\e[0m The following dependencies are missing:\n\e[91m\ echo -e "\e[1mERROR:\e[0m The following dependencies are missing:\n\e[91m\
$(for o in ${ERRPKGS[@]}; do printf '%s\n' ${o}; done)\
$(for o in ${errpkgs[@]}; do printf '%s\n' ${o}; done)\
\e[0m\n" \e[0m\n"
echo -e "Please install them and try again.\n" echo -e "Please install them and try again.\n"
@ -252,9 +263,21 @@ $(for o in ${ERRPKGS[@]}; do printf '%s\n' ${o}; done)\
function prepare_env() { function prepare_env() {
# Copy Wine & DXVK patch files
cp -rf ${ARCH_BUILDROOT}/../wine_custom_patches ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches
cp -rf ${ARCH_BUILDROOT}/../dxvk_custom_patches ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches
# Remove old Wine & DXVK patch files
rm -rf ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches
rm -rf ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches
mkdir -p ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches
mkdir -p ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches
# Copy new Wine & DXVK patch files
find ${ARCH_BUILDROOT}/../wine_custom_patches \
-mindepth 1 -maxdepth 1 -type f \( -iname "*.patch" -or -iname "*.diff" \) \
-exec cp {} ${ARCH_BUILDROOT}/0-wine-staging-git/wine-patches/ \;
find ${ARCH_BUILDROOT}/../dxvk_custom_patches \
-mindepth 1 -maxdepth 1 -type f \( -iname "*.patch" -or -iname "*.diff" \) \
-exec cp {} ${ARCH_BUILDROOT}/0-dxvk-git/dxvk-patches \;
# Create identifiable directory for this build # Create identifiable directory for this build
mkdir -p ${ARCH_BUILDROOT}/compiled_pkg/"${datedir}" mkdir -p ${ARCH_BUILDROOT}/compiled_pkg/"${datedir}"
@ -280,6 +303,10 @@ function check_gitOverride_wine() {
function form_commit_array() { function form_commit_array() {
local array_name
local commits_raw
local i
cd "${commit_dir}" cd "${commit_dir}"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@ -287,10 +314,10 @@ function check_gitOverride_wine() {
exit 1 exit 1
fi fi
local array_name=${1}
local commits_raw=$(eval ${2})
array_name=${1}
commits_raw=$(eval ${2})
local i=0
i=0
for commit in ${commits_raw[*]}; do for commit in ${commits_raw[*]}; do
eval ${array_name}[$i]="${commit}" eval ${array_name}[$i]="${commit}"
let i++ let i++
@ -307,13 +334,20 @@ function check_gitOverride_wine() {
function staging_change_freeze_commit() { function staging_change_freeze_commit() {
local wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '"
local wine_commits_raw
local staging_refcommits_raw
local staging_rebasecommits_raw
local i
local k
local wine_dropcommits
wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '"
# TODO this check may break quite easily # TODO this check may break quite easily
# It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...) # It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...)
# Length and order of these two "array" variables MUST MATCH! # Length and order of these two "array" variables MUST MATCH!
local staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'"
local staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '"
staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'"
staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '"
# Syntax: <function> <array_name> <raw_commit_list> # Syntax: <function> <array_name> <raw_commit_list>
commit_dir="${ARCH_BUILDROOT}/0-wine-staging-git/wine-git" commit_dir="${ARCH_BUILDROOT}/0-wine-staging-git/wine-git"
@ -331,12 +365,12 @@ function check_gitOverride_wine() {
# Filter all newer than defined in 'git_commithash_wine' # Filter all newer than defined in 'git_commithash_wine'
# #
echo -e "Determining valid Wine Staging git commit. This takes a while.\n" echo -e "Determining valid Wine Staging git commit. This takes a while.\n"
local i=0
i=0
for dropcommit in ${wine_commits[@]}; do for dropcommit in ${wine_commits[@]}; do
if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then
break break
else else
local wine_dropcommits[$i]="${dropcommit}"
wine_dropcommits[$i]="${dropcommit}"
let i++ let i++
fi fi
done done
@ -345,7 +379,7 @@ function check_gitOverride_wine() {
# For the filtered array list, iterate through 'staging_rebasecommits' array list until # For the filtered array list, iterate through 'staging_rebasecommits' array list until
# we get a match # we get a match
for vanilla_commit in ${wine_commits[@]}; do for vanilla_commit in ${wine_commits[@]}; do
local k=0
k=0
for rebase_commit in ${staging_rebasecommits[@]}; do for rebase_commit in ${staging_rebasecommits[@]}; do
if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then
# This is the commit we use for vanilla Wine # This is the commit we use for vanilla Wine
@ -370,22 +404,20 @@ function check_gitOverride_wine() {
########################################################### ###########################################################
# Remove any existing pkg,src or tar.xz packages left by previous pacman commands
function cleanUp() {
rm -rf ${ARCH_BUILDROOT}/*/{pkg,src,*.tar.xz,*.patch,*.diff,*.sig}
}
###########################################################
# Build & install package # Build & install package
function build_pkg() { function build_pkg() {
local pkgname=${1}
local pkgname_friendly=${2}
local pkgdir=${3}
local cleanlist=${4}
local pkgname
local pkgname_friendly
local pkgdir
local cleanlist
local pkgbuild_file
pkgname=${1}
pkgname_friendly=${2}
pkgdir=${3}
cleanlist=${4}
# Create package and install it to the system # Create package and install it to the system
# We need to download git sources beforehand in order # We need to download git sources beforehand in order
@ -393,7 +425,7 @@ function build_pkg() {
cd "${ARCH_BUILDROOT}"/${pkgdir} cd "${ARCH_BUILDROOT}"/${pkgdir}
bash -c "updpkgsums && makepkg -o" bash -c "updpkgsums && makepkg -o"
local pkgbuild_file="${ARCH_BUILDROOT}/${pkgdir}/PKGBUILD"
pkgbuild_file="${ARCH_BUILDROOT}/${pkgdir}/PKGBUILD"
# Check git commit hashes # Check git commit hashes
if [[ $? -eq 0 ]] && \ if [[ $? -eq 0 ]] && \
@ -492,13 +524,6 @@ function updatePOL() {
########################################################## ##########################################################
# Clean these temporary folders & files
# TODO Shall we remove git folders or keep them?
dxvk_wine_cleanlist=('*.patch' '*.diff' 'pkg' 'src' '*-patches' '*.tar.xz' '*.sig')
##########################################################
# Validate all buildtime files # Validate all buildtime files
checkFiles checkFiles


+ 66
- 28
debian/dxvkroot/dxvkbuild.sh View File

@ -228,16 +228,20 @@ tempLinks=(
function runtimeCheck() { function runtimeCheck() {
local pkgreq_name
local known_pkgs
local pkglist
# Friendly name for this package # Friendly name for this package
local pkgreq_name=${1}
pkgreq_name=${1}
# Known package names to check on Debian # Known package names to check on Debian
local known_pkgs=${2}
known_pkgs=${2}
# Check if any of these Wine packages are present on the system # Check if any of these Wine packages are present on the system
i=0 i=0
for pkg in ${known_pkgs[@]}; do for pkg in ${known_pkgs[@]}; do
if [[ $(echo $(dpkg -s ${pkg} &>/dev/null)$?) -eq 0 ]]; then if [[ $(echo $(dpkg -s ${pkg} &>/dev/null)$?) -eq 0 ]]; then
local pkglist[$i]=${pkg}
pkglist[$i]=${pkg}
let i++ let i++
fi fi
done done
@ -293,9 +297,13 @@ fi
function pkgcompilecheck() { function pkgcompilecheck() {
local install_function=${1}
local pkg=${2}
local pkg_data=${3}
local install_function
local pkg
local pkg_data
install_function=${1}
pkg=${2}
pkg_data=${3}
if [[ $(echo $(dpkg -s ${pkg} &>/dev/null)$?) -ne 0 ]] || [[ -v UPDATE_OVERRIDE ]]; then if [[ $(echo $(dpkg -s ${pkg} &>/dev/null)$?) -ne 0 ]] || [[ -v UPDATE_OVERRIDE ]]; then
${install_function} ${pkg_data} ${install_function} ${pkg_data}
@ -312,7 +320,9 @@ function pkgcompilecheck() {
function dxvk_install_custom() { function dxvk_install_custom() {
local PATCHDIR="${1}"
local PATCHDIR
PATCHDIR="${1}"
# Use posix alternates for MinGW binaries # Use posix alternates for MinGW binaries
function dxvk_posixpkgs() { function dxvk_posixpkgs() {
@ -346,15 +356,19 @@ function dxvk_install_custom() {
# Add and apply custom DXVK patches # Add and apply custom DXVK patches
function dxvk_custompatches() { function dxvk_custompatches() {
local CURDIR
local dxvk_builddir_name
local dxvk_builddir_path
# Get our current directory, since we will change it during patching process below # Get our current directory, since we will change it during patching process below
# We want to go back here after having applied the patches # We want to go back here after having applied the patches
local CURDIR="${PWD}"
CURDIR="${PWD}"
# Check if the following folder exists, and proceed. # Check if the following folder exists, and proceed.
if [[ -d "${DXVKROOT}/../../${PATCHDIR}" ]]; then if [[ -d "${DXVKROOT}/../../${PATCHDIR}" ]]; then
cp -r "${DXVKROOT}/../../${PATCHDIR}/"*.{patch,diff} "${DXVKROOT}/${pkg_name}/" 2>/dev/null cp -r "${DXVKROOT}/../../${PATCHDIR}/"*.{patch,diff} "${DXVKROOT}/${pkg_name}/" 2>/dev/null
local dxvk_builddir_name=$(ls -l "${DXVKROOT}/${pkg_name}" | grep ^d | awk '{print $NF}')
dxvk_builddir_name=$(ls -l "${DXVKROOT}/${pkg_name}" | grep ^d | awk '{print $NF}')
# TODO Expecting just one folder here. This method doesn't work with multiple dirs present # TODO Expecting just one folder here. This method doesn't work with multiple dirs present
if [[ $(echo ${dxvk_builddir_name} | wc -l) -gt 1 ]]; then if [[ $(echo ${dxvk_builddir_name} | wc -l) -gt 1 ]]; then
@ -362,7 +376,7 @@ function dxvk_install_custom() {
exit 1 exit 1
fi fi
local dxvk_builddir_path="${DXVKROOT}/${pkg_name}/${dxvk_builddir_name}"
dxvk_builddir_path="${DXVKROOT}/${pkg_name}/${dxvk_builddir_name}"
cd "${dxvk_builddir_path}" cd "${dxvk_builddir_path}"
for pfile in ../*.{patch,diff}; do for pfile in ../*.{patch,diff}; do
@ -433,16 +447,21 @@ function compile_and_install_deb() {
function arrayparser_reverse() { function arrayparser_reverse() {
local arrays=(
local arrays
local s
local IFS
local y
arrays=(
'_pkg_deps_build' '_pkg_deps_build'
'_pkg_deps_runtime' '_pkg_deps_runtime'
) )
for w in ${arrays[@]}; do for w in ${arrays[@]}; do
local s=\${${w}}
s=\${${w}}
local IFS='|'
local y=0
IFS='|'
y=0
for t in $(eval printf '%s\|' ${s}); do for t in $(eval printf '%s\|' ${s}); do
eval ${w}[$y]=\"${t}\" eval ${w}[$y]=\"${t}\"
@ -472,18 +491,27 @@ function compile_and_install_deb() {
function pkg_dependencies() { function pkg_dependencies() {
local _pkg_list="${1}"
local _pkg_type="${2}"
local IFS=$'\n'
local _pkg_list
local _pkg_type
local _pkg_type_str
local a
local b
local _validlist
local IFS
_pkg_list="${1}"
_pkg_type="${2}"
IFS=$'\n'
_pkg_list=$(echo "${_pkg_list}" | sed 's/([^)]*)//g') _pkg_list=$(echo "${_pkg_list}" | sed 's/([^)]*)//g')
unset IFS unset IFS
case ${_pkg_type} in case ${_pkg_type} in
buildtime) buildtime)
local _pkg_type_str="build time"
_pkg_type_str="build time"
;; ;;
runtime) runtime)
local _pkg_type_str="runtime"
_pkg_type_str="runtime"
;; ;;
esac esac
@ -492,10 +520,10 @@ function compile_and_install_deb() {
fi fi
# Generate a list of missing dependencies # Generate a list of missing dependencies
local a=0
a=0
for p in ${_pkg_list[@]}; do for p in ${_pkg_list[@]}; do
if [[ $(pkg_installcheck ${p})$? -eq 0 ]]; then if [[ $(pkg_installcheck ${p})$? -eq 0 ]]; then
local _validlist[$a]=${p}
_validlist[$a]=${p}
let a++ let a++
# Global array to track installed build dependencies # Global array to track installed build dependencies
@ -526,7 +554,7 @@ function compile_and_install_deb() {
} }
# Install missing dependencies, be informative # Install missing dependencies, be informative
local b=0
b=0
for _pkg_dep in ${_validlist[@]}; do for _pkg_dep in ${_validlist[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#_validlist[*]} )) - Installing ${_pkg_name} ${_pkg_type_str} dependency ${_pkg_dep}" echo -e "$(( $b + 1 ))/$(( ${#_validlist[*]} )) - Installing ${_pkg_name} ${_pkg_type_str} dependency ${_pkg_dep}"
@ -610,8 +638,11 @@ function compile_and_install_deb() {
function pkg_override_debianfile() { function pkg_override_debianfile() {
local contents=${1}
local targetfile=${2}
local contents
local targetfile
contents=${1}
targetfile=${2}
if [[ ${contents} != "empty" ]]; then if [[ ${contents} != "empty" ]]; then
echo "${contents}" > "${targetfile}" echo "${contents}" > "${targetfile}"
@ -749,8 +780,10 @@ function buildpkg_removal() {
function pkg_install_main() { function pkg_install_main() {
local pkg_datafile
# Read necessary variables from debdata file # Read necessary variables from debdata file
local pkg_datafile=${1}
pkg_datafile=${1}
if [[ -f ${pkg_datafile} ]]; then if [[ -f ${pkg_datafile} ]]; then
source ${pkg_datafile} source ${pkg_datafile}
@ -765,7 +798,12 @@ function pkg_install_main() {
# Separate each array index with | in these arrays # Separate each array index with | in these arrays
function pkg_arrayparser() { function pkg_arrayparser() {
local pkg_arrays=(
local pkg_arrays
local IFS
local s
local t
pkg_arrays=(
'pkg_deps_build' 'pkg_deps_build'
'pkg_deps_runtime' 'pkg_deps_runtime'
) )
@ -774,8 +812,8 @@ function pkg_install_main() {
for w in ${pkg_arrays[@]}; do for w in ${pkg_arrays[@]}; do
local s=\${${w}[@]}
local t=$(eval printf '%s\|' ${s})
s=\${${w}[@]}
t=$(eval printf '%s\|' ${s})
unset ${w} unset ${w}
eval ${w}=\"${t}\" eval ${w}=\"${t}\"


+ 3
- 1
debian/updatewine_debian.sh View File

@ -153,7 +153,9 @@ function mainQuestions() {
# TODO: remove duplicate functionality. This function is defined in updatewine.sh # TODO: remove duplicate functionality. This function is defined in updatewine.sh
function questionresponse() { function questionresponse() {
local response=${1}
local response
response=${1}
read -r -p "" response read -r -p "" response
if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then


+ 53
- 25
debian/wineroot/winebuild.sh View File

@ -406,8 +406,11 @@ function girl_check() {
function getWine() { function getWine() {
local winesrc_url="${git_source_wine}"
local winestagingsrc_url="${git_source_winestaging}"
local winesrc_url
local winestagingsrc_url
winesrc_url="${git_source_wine}"
winestagingsrc_url="${git_source_winestaging}"
function cleanOldBuilds() { function cleanOldBuilds() {
if [[ $(find "${BUILDROOT}" -type d -name "winebuild_*" | wc -l) -ne 0 ]]; then if [[ $(find "${BUILDROOT}" -type d -name "winebuild_*" | wc -l) -ne 0 ]]; then
@ -462,7 +465,9 @@ function getWine() {
function getDebianFiles() { function getDebianFiles() {
local debian_archive=wine_3.0-1ubuntu1.debian.tar.xz
local debian_archive
debian_archive=wine_3.0-1ubuntu1.debian.tar.xz
cd "${WINEDIR}" cd "${WINEDIR}"
wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wine/${debian_archive} wget http://archive.ubuntu.com/ubuntu/pool/universe/w/wine/${debian_archive}
@ -490,6 +495,9 @@ function check_gitOverride() {
function form_commit_array() { function form_commit_array() {
local array_name
local commits_raw
cd "${commit_dir}" cd "${commit_dir}"
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@ -497,8 +505,8 @@ function check_gitOverride() {
exit 1 exit 1
fi fi
local array_name=${1}
local commits_raw=$(eval ${2})
array_name=${1}
commits_raw=$(eval ${2})
local i=0 local i=0
for commit in ${commits_raw[*]}; do for commit in ${commits_raw[*]}; do
@ -517,13 +525,20 @@ function check_gitOverride() {
function staging_change_freeze_commit() { function staging_change_freeze_commit() {
local wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '"
local wine_commits_raw
local staging_refcommits_raw
local staging_rebasecommits_raw
local i
local k
local wine_dropcommits
wine_commits_raw="git log --pretty=oneline | awk '{print \$1}' | tr '\n' ' '"
# TODO this check may break quite easily # TODO this check may break quite easily
# It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...) # It depends on the exact comment syntax Wine Staging developers are using (Rebase against ...)
# Length and order of these two "array" variables MUST MATCH! # Length and order of these two "array" variables MUST MATCH!
local staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'"
local staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '"
staging_refcommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print \$1; }'"
staging_rebasecommits_raw="git log --pretty=oneline | awk '{ if ((length(\$NF)==40 || length(\$NF)==41) && \$(NF-1)==\"against\") print substr(\$NF,1,40); }' | tr '\n' ' '"
# Syntax: <function> <array_name> <raw_commit_list> # Syntax: <function> <array_name> <raw_commit_list>
commit_dir="${WINEDIR}" commit_dir="${WINEDIR}"
@ -541,12 +556,12 @@ function check_gitOverride() {
# Filter all newer than defined in 'git_commithash_wine' # Filter all newer than defined in 'git_commithash_wine'
# #
echo -e "Determining valid Wine Staging git commit. This takes a while.\n" echo -e "Determining valid Wine Staging git commit. This takes a while.\n"
local i=0
i=0
for dropcommit in ${wine_commits[@]}; do for dropcommit in ${wine_commits[@]}; do
if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then if [[ "${dropcommit}" == "${git_commithash_wine}" ]]; then
break break
else else
local wine_dropcommits[$i]="${dropcommit}"
wine_dropcommits[$i]="${dropcommit}"
let i++ let i++
fi fi
done done
@ -555,7 +570,7 @@ function check_gitOverride() {
# For the filtered array list, iterate through 'staging_rebasecommits' array list until # For the filtered array list, iterate through 'staging_rebasecommits' array list until
# we get a match # we get a match
for vanilla_commit in ${wine_commits[@]}; do for vanilla_commit in ${wine_commits[@]}; do
local k=0
k=0
for rebase_commit in ${staging_rebasecommits[@]}; do for rebase_commit in ${staging_rebasecommits[@]}; do
if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then if [[ "${vanilla_commit}" == "${rebase_commit}" ]]; then
# This is the commit we use for vanilla Wine # This is the commit we use for vanilla Wine
@ -587,19 +602,26 @@ z=0
function WineDeps() { function WineDeps() {
local method=${1}
local deps="${2}"
local depsname=${3}
local pkgtype=${4}
local method
local deps
local depsname
local pkgtype
local str
local mgrcmd
method=${1}
deps="${2}"
depsname=${3}
pkgtype=${4}
case ${method} in case ${method} in
install) install)
local str="Installing"
local mgrcmd="sudo apt install -y"
str="Installing"
mgrcmd="sudo apt install -y"
;; ;;
remove) remove)
local str="Removing"
local mgrcmd="sudo apt purge --remove -y"
str="Removing"
mgrcmd="sudo apt purge --remove -y"
;; ;;
*) *)
echo -e "\e[1mERROR:\e[0m Unknown package management input method. Aborting\n" echo -e "\e[1mERROR:\e[0m Unknown package management input method. Aborting\n"
@ -611,26 +633,32 @@ function WineDeps() {
# Check and install/remove package related dependencies if they are missing/installed # Check and install/remove package related dependencies if they are missing/installed
function pkgdependencies() { function pkgdependencies() {
local deplist="${1}"
local deplist
local checkstatus
local a
local b
local validlist
deplist="${1}"
# Get a valid logic for generating 'list' array below # Get a valid logic for generating 'list' array below
case ${method} in case ${method} in
install) install)
# Package is not installed, install it # Package is not installed, install it
local checkstatus=0
checkstatus=0
;; ;;
remove) remove)
# Package is installed, remove it # Package is installed, remove it
local checkstatus=1
checkstatus=1
;; ;;
esac esac
# Generate a list of missing/removable dependencies, depending on the logic # Generate a list of missing/removable dependencies, depending on the logic
local a=0
a=0
for p in ${deplist[@]}; do for p in ${deplist[@]}; do
pf=$(printf "%s" ${p} | sed -r 's/^(.*)\|.*/\1/') pf=$(printf "%s" ${p} | sed -r 's/^(.*)\|.*/\1/')
if [[ $(echo $(dpkg -s ${pf} &>/dev/null)$?) -ne ${checkstatus} ]]; then if [[ $(echo $(dpkg -s ${pf} &>/dev/null)$?) -ne ${checkstatus} ]]; then
local validlist[$a]=${p}
validlist[$a]=${p}
let a++ let a++
# Global array to track installed build dependencies # Global array to track installed build dependencies
@ -643,7 +671,7 @@ function WineDeps() {
done done
# Install missing/Remove existing dependencies, be informative # Install missing/Remove existing dependencies, be informative
local b=0
b=0
for pkgdep in ${validlist[@]}; do for pkgdep in ${validlist[@]}; do
optional=0 optional=0


+ 35
- 14
debian_install_nvidia.sh View File

@ -214,11 +214,14 @@ COMMANDS=(
function checkCommands() { function checkCommands() {
local COMMANDS_NOTFOUND
local a
if [[ $(which --help 2>/dev/null) ]] && [[ $(echo --help 2>/dev/null) ]]; then if [[ $(which --help 2>/dev/null) ]] && [[ $(echo --help 2>/dev/null) ]]; then
local a=0
a=0
for command in ${@}; do for command in ${@}; do
if [[ ! $(which $command 2>/dev/null) ]]; then if [[ ! $(which $command 2>/dev/null) ]]; then
local COMMANDS_NOTFOUND[$a]=${command}
COMMANDS_NOTFOUND[$a]=${command}
let a++ let a++
fi fi
done done
@ -240,7 +243,9 @@ checkCommands "${COMMANDS[*]}"
function questionresponse() { function questionresponse() {
local response=${1}
local response
response=${1}
read -r -p "" response read -r -p "" response
if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $(echo $response | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then
@ -318,8 +323,11 @@ function pkg_installcheck() {
# Check and install package related dependencies if they are missing # Check and install package related dependencies if they are missing
function pkgdependencies() { function pkgdependencies() {
local a
local b
# Generate a list of missing dependencies # Generate a list of missing dependencies
local a=0
a=0
for p in ${@}; do for p in ${@}; do
if [[ $(pkg_installcheck ${p}) -ne 0 ]]; then if [[ $(pkg_installcheck ${p}) -ne 0 ]]; then
validlist[$a]=${p} validlist[$a]=${p}
@ -340,7 +348,7 @@ function pkgdependencies() {
fi fi
# Install missing dependencies, be informative # Install missing dependencies, be informative
local b=0
b=0
for pkgdep in ${validlist[@]}; do for pkgdep in ${validlist[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - Installing ${_pkgname} dependency ${pkgdep}" echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - Installing ${_pkgname} dependency ${pkgdep}"
sudo apt install -y ${pkgdep} &> /dev/null sudo apt install -y ${pkgdep} &> /dev/null
@ -383,6 +391,11 @@ function download_files() {
function prepare_deb_sources() { function prepare_deb_sources() {
local oldlib_sed
local lib_sed
local oldlib_files
local i
# Extract debian control files # Extract debian control files
cd ${WORKDIR}/${pkgdir}/ cd ${WORKDIR}/${pkgdir}/
tar xf ${filebases[0]} tar xf ${filebases[0]}
@ -394,17 +407,17 @@ function prepare_deb_sources() {
for oldlib in ${!library_fixes[@]}; do for oldlib in ${!library_fixes[@]}; do
# sed-friendly name # sed-friendly name
local oldlib_sed=$(printf '%s' ${oldlib} | sed 's/\./\\\./g')
oldlib_sed=$(printf '%s' ${oldlib} | sed 's/\./\\\./g')
for lib in ${library_fixes[$oldlib]}; do for lib in ${library_fixes[$oldlib]}; do
# sed-friendly name # sed-friendly name
local lib_sed=$(printf '%s' ${lib} | sed 's/\./\\\./g')
lib_sed=$(printf '%s' ${lib} | sed 's/\./\\\./g')
# Files which have old library files mentioned # Files which have old library files mentioned
local i=0
i=0
for oldlib_file in $(grep -rl "${oldlib}" debian/ | tr '\n' ' '); do for oldlib_file in $(grep -rl "${oldlib}" debian/ | tr '\n' ' '); do
local oldlib_files[$i]=${oldlib_file}
oldlib_files[$i]=${oldlib_file}
let i++ let i++
done done
@ -418,6 +431,9 @@ function prepare_deb_sources() {
function rename_deb_files() { function rename_deb_files() {
local n_new
local IFS
# Remove this suffix # Remove this suffix
sed -i 's/\-no\-compat32//' debian/rules.defs sed -i 's/\-no\-compat32//' debian/rules.defs
@ -431,7 +447,7 @@ function prepare_deb_sources() {
sed -i "s/384/${pkgver_major}/g" debian/templates/control.in sed -i "s/384/${pkgver_major}/g" debian/templates/control.in
############ ############
local IFS=$'\n'
IFS=$'\n'
for n in $(ls debian/ -w 1); do for n in $(ls debian/ -w 1); do
# IMPORTANT! KEEP THIS IF STATEMENT ORDER BELOW!! # IMPORTANT! KEEP THIS IF STATEMENT ORDER BELOW!!
@ -445,7 +461,7 @@ function prepare_deb_sources() {
fi fi
if [[ $(printf '%s' ${n} | grep ${oldver_major}) ]]; then if [[ $(printf '%s' ${n} | grep ${oldver_major}) ]]; then
local n_new=$(printf '%s' ${n} | sed "s/${oldver_major}/${pkgver_major}/")
n_new=$(printf '%s' ${n} | sed "s/${oldver_major}/${pkgver_major}/")
mv debian/${n} debian/${n_new} mv debian/${n} debian/${n_new}
if [[ $? -ne 0 ]]; then if [[ $? -ne 0 ]]; then
@ -512,6 +528,9 @@ function compile_nvidia() {
function install_nvidia() { function install_nvidia() {
local oldpkg
local oldpkg_check
for syspkg in ${nvidia_required_packages[@]}; do for syspkg in ${nvidia_required_packages[@]}; do
if [[ $(echo $(dpkg -s ${syspkg} &>/dev/null)$?) -ne 0 ]]; then if [[ $(echo $(dpkg -s ${syspkg} &>/dev/null)$?) -ne 0 ]]; then
echo -e "Installing missing dependency ${syspkg}\n" echo -e "Installing missing dependency ${syspkg}\n"
@ -526,8 +545,8 @@ function install_nvidia() {
cd ${WORKDIR}/compiled_deb cd ${WORKDIR}/compiled_deb
for pkg in ${nvidia_install_packages[@]}; do for pkg in ${nvidia_install_packages[@]}; do
local oldpkg=$(printf '%s' ${pkg} | sed 's/\-[0-9]*$//')
local oldpkg_check=$(dpkg --get-selections | grep ${oldpkg} | awk '{print $1}')
oldpkg=$(printf '%s' ${pkg} | sed 's/\-[0-9]*$//')
oldpkg_check=$(dpkg --get-selections | grep ${oldpkg} | awk '{print $1}')
if [[ $(echo ${oldpkg_check} | wc -w) -eq 1 ]]; then if [[ $(echo ${oldpkg_check} | wc -w) -eq 1 ]]; then
if [[ ! ${oldpkg_check} =~ ^*${pkgver_major}$ ]]; then if [[ ! ${oldpkg_check} =~ ^*${pkgver_major}$ ]]; then
@ -553,9 +572,11 @@ function install_nvidia() {
function install_vulkan() { function install_vulkan() {
local syspkg
# Vulkan loader # Vulkan loader
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
local syspkg=libvulkan1
syspkg=libvulkan1
if [[ $(echo $(dpkg -s ${syspkg} &>/dev/null)$?) -ne 0 ]]; then if [[ $(echo $(dpkg -s ${syspkg} &>/dev/null)$?) -ne 0 ]]; then
sudo apt update && sudo apt install -y ${syspkg} sudo apt update && sudo apt install -y ${syspkg}
fi fi


+ 33
- 15
updatewine.sh View File

@ -72,12 +72,15 @@ SUDO_GROUPS=(
function checkCommands() { function checkCommands() {
local COMMANDS_NOTFOUND
local a
if [[ $(which --help 2>/dev/null) ]] && [[ $(echo --help 2>/dev/null) ]]; then if [[ $(which --help 2>/dev/null) ]] && [[ $(echo --help 2>/dev/null) ]]; then
local a=0
a=0
for command in ${@}; do for command in ${@}; do
if [[ ! $(which $command 2>/dev/null) ]]; then if [[ ! $(which $command 2>/dev/null) ]]; then
local COMMANDS_NOTFOUND[$a]=${command}
COMMANDS_NOTFOUND[$a]=${command}
let a++ let a++
fi fi
done done
@ -244,17 +247,24 @@ function questionresponse() {
function reqsCheck() { function reqsCheck() {
local AVAIL_SPACE=$(df -h -B MB --output=avail . | sed '1d; s/[A-Z]*//g')
local REC_SPACE=8000
local MSG_SPACE="\e[1mWARNING:\e[0m Not sufficient storage space\n\nYou will possibly run out of space while compiling software.\n\
local AVAIL_SPACE
local REC_SPACE
local MSG_SPACE
local AVAIL_RAM
local REC_RAM
local MSG_RAM
AVAIL_SPACE=$(df -h -B MB --output=avail . | sed '1d; s/[A-Z]*//g')
REC_SPACE=8000
MSG_SPACE="\e[1mWARNING:\e[0m Not sufficient storage space\n\nYou will possibly run out of space while compiling software.\n\
The script strongly recommends ~\e[1m$((${REC_SPACE} / 1000)) GB\e[0m at least to compile software successfully but you have only\n\ The script strongly recommends ~\e[1m$((${REC_SPACE} / 1000)) GB\e[0m at least to compile software successfully but you have only\n\
\e[1m${AVAIL_SPACE} MB\e[0m left on the filesystem the script is currently placed at.\n\n\ \e[1m${AVAIL_SPACE} MB\e[0m left on the filesystem the script is currently placed at.\n\n\
Be aware that the script process may fail because of this, especially while compiling Wine Staging.\n\n\ Be aware that the script process may fail because of this, especially while compiling Wine Staging.\n\n\
Do you really want to continue? [Y/n]" Do you really want to continue? [Y/n]"
local AVAIL_RAM=$(( $(grep -oP "(?<=^MemFree:).*[0-9]" /proc/meminfo | sed 's/ //g') / 1024 ))
local REC_RAM=4096
local MSG_RAM="\e[1mWARNING:\e[0m Not sufficient RAM available\n\nCompilation processes will likely fail.\n\
AVAIL_RAM=$(( $(grep -oP "(?<=^MemFree:).*[0-9]" /proc/meminfo | sed 's/ //g') / 1024 ))
REC_RAM=4096
MSG_RAM="\e[1mWARNING:\e[0m Not sufficient RAM available\n\nCompilation processes will likely fail.\n\
The script strongly recommends ~\e[1m${REC_RAM} MB\e[0m at least to compile software successfully but you have only\n\ The script strongly recommends ~\e[1m${REC_RAM} MB\e[0m at least to compile software successfully but you have only\n\
\e[1m${AVAIL_RAM} MB\e[0m left on the computer the script is currently placed at.\n\n\ \e[1m${AVAIL_RAM} MB\e[0m left on the computer the script is currently placed at.\n\n\
Be aware that the script process may fail because of this, especially while compiling DXVK.\n\n\ Be aware that the script process may fail because of this, especially while compiling DXVK.\n\n\
@ -262,19 +272,27 @@ Do you really want to continue? [Y/n]"
function reqs_property() { function reqs_property() {
local avail_prop="${1}"
local req_prop="${2}"
local req_message="${3}"
local req_installtargets="${4}"
local avail_prop
local req_prop
local req_message
local req_installtargets
local req_targetconditions
local fullcondition
local i
avail_prop="${1}"
req_prop="${2}"
req_message="${3}"
req_installtargets="${4}"
local i=0
i=0
for req_installtarget in ${req_installtargets}; do for req_installtarget in ${req_installtargets}; do
req_targetconditions[$i]=$(echo "[[ ! -v ${req_installtarget} ]] ||") req_targetconditions[$i]=$(echo "[[ ! -v ${req_installtarget} ]] ||")
let i++ let i++
done done
local req_targetconditions=($(echo ${req_targetconditions[@]} | sed 's/\(.*\) ||/\1 /'))
local fullcondition="[[ "${avail_prop}" -lt "${req_prop}" ]] && ($(echo ${req_targetconditions[@]}))"
req_targetconditions=($(echo ${req_targetconditions[@]} | sed 's/\(.*\) ||/\1 /'))
fullcondition="[[ "${avail_prop}" -lt "${req_prop}" ]] && ($(echo ${req_targetconditions[@]}))"
if $(eval ${fullcondition}); then if $(eval ${fullcondition}); then
INFO_SEP INFO_SEP


Loading…
Cancel
Save