Browse Source

Improved buildtime deps removal integration; other improvements

master
Fincer 6 years ago
parent
commit
f895c34a0a
7 changed files with 287 additions and 73 deletions
  1. +1
    -1
      arch/updatewine_arch.sh
  2. +95
    -28
      debian/dxvkroot/dxvkbuild.sh
  3. +57
    -16
      debian/updatewine_debian.sh
  4. +122
    -24
      debian/wineroot/winebuild.sh
  5. +3
    -1
      debian_cleanup_devpkgs.sh
  6. +7
    -3
      debian_install_nvidia.sh
  7. +2
    -0
      updatewine.sh

+ 1
- 1
arch/updatewine_arch.sh View File

@ -286,7 +286,7 @@ function updatePOL() {
if [[ ! -v NO_POL ]]; then if [[ ! -v NO_POL ]]; then
# Check existence of PoL default folder in user's homedir # Check existence of PoL default folder in user's homedir
if [[ ! -d "$HOME/.PlayOnLinux" ]]; then if [[ ! -d "$HOME/.PlayOnLinux" ]]; then
echo -e "Warning: Couldn't find PoL directories in $USER's homedir.\n"
echo -e "\e[1mWARNING:\e[0m Couldn't find PoL directories in $USER's homedir.\n"
return 0 return 0
fi fi
fi fi


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

@ -47,7 +47,10 @@ for check in ${args[@]}; do
NO_INSTALL= NO_INSTALL=
;; ;;
--updateoverride) --updateoverride)
updateoverride=
UPDATE_OVERRIDE=
;;
--buildpkg-rm)
BUILDPKG_RM=
;; ;;
esac esac
@ -55,13 +58,40 @@ done
########################################################### ###########################################################
# Some version of Wine must be found in the system
# Warn the user
# Check presence of Wine. Some version of Wine should
# be found in the system in order to install DXVK.
function wineCheck() { function wineCheck() {
if [[ ! $(which wine 2>/dev/null) ]]; then
echo -e "Warning: You must have Wine installed before DXVK can be compiled.\n"
# Known Wine package names to check on Debian
local known_wines=(
'wine'
'wine32'
'wine64'
'wine-git'
'wine-staging-git'
'libwine:amd64'
'libwine:i386'
)
# Check if any of these Wine packages are present on the system
i=0
for winepkg in ${known_wines[@]}; do
if [[ $(echo $(dpkg -s ${winepkg} &>/dev/null)$?) -eq 0 ]]; then
winelist[$i]=${winepkg}
let i++
fi
done
if [[ -z ${winelist[*]} ]] && [[ ! -v NO_INSTALL ]] ; then
echo -e "\e[1mWARNING:\e[0m Not installing DXVK because Wine is missing on your system.\n\
Wine should be installed in order to use DXVK. Just compiling DXVK for later use.\n"
# Force --no-install switch
NO_INSTALL=
fi fi
} }
wineCheck wineCheck
@ -86,9 +116,9 @@ function INFO_SEP() { printf '%*s\n' "${COLUMNS:-$(tput cols)}" '' | tr ' ' - ;
################################## ##################################
# Update all packages if updateoverride given
# Update all packages if UPDATE_OVERRIDE given
if [[ -v updateoverride ]]; then
if [[ -v UPDATE_OVERRIDE ]]; then
echo -en "Updating all packages" && \ echo -en "Updating all packages" && \
if [[ $(printf $(sudo -n uptime &>/dev/null)$?) -ne 0 ]]; then printf " Please provide your sudo password.\n"; else printf "\n\n"; fi if [[ $(printf $(sudo -n uptime &>/dev/null)$?) -ne 0 ]]; then printf " Please provide your sudo password.\n"; else printf "\n\n"; fi
sudo apt update && sudo apt upgrade -y sudo apt update && sudo apt upgrade -y
@ -104,7 +134,7 @@ function pkgcompilecheck() {
local pkg=${1} local pkg=${1}
local install_function=${2} local install_function=${2}
if [[ $(echo $(dpkg -s ${coredep} &>/dev/null)$?) -ne 0 ]] || [[ -v updateoverride ]]; then
if [[ $(echo $(dpkg -s ${pkg} &>/dev/null)$?) -ne 0 ]] || [[ -v UPDATE_OVERRIDE ]]; then
${install_function} ${install_function}
fi fi
@ -112,35 +142,48 @@ function pkgcompilecheck() {
################################################### ###################################################
function preparepackage() {
# Global variable to track buildtime dependencies
z=0
echo -e "Starting compilation (& installation) of ${1}\n"
function preparepackage() {
# Set local variables # Set local variables
local _pkgname=${1} local _pkgname=${1}
local _pkgdeps=${2}
local _pkgdeps_build=${2}
local _pkgurl=${3} local _pkgurl=${3}
local _pkgver=${4} local _pkgver=${4}
echo -e "Starting compilation$(if [[ ! -v NO_INSTALL ]] || [[ ${_pkgname} =~ ^meson|glslang$ ]]; then printf " & installation"; fi) of ${1}\n"
# Optional variable for runtime dependencies array # Optional variable for runtime dependencies array
if [[ -n ${5} ]]; then local _pkgdeps_runtime=${5}; fi if [[ -n ${5} ]]; then local _pkgdeps_runtime=${5}; fi
# 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 pkglist="${1}"
local pkgtype="${2}"
# Generate a list of missing dependencies # Generate a list of missing dependencies
local a=0 local a=0
for p in ${@}; do
for p in ${pkglist[@]}; do
if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne 0 ]]; then if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne 0 ]]; then
local list[$a]=${p}
local validlist[$a]=${p}
let a++ let a++
# Global array to track installed build dependencies
if [[ ${pkgtype} == "buildtime" ]]; then
buildpkglist[$z]=${p}
let z++
fi
fi fi
done done
# Install missing dependencies, be informative # Install missing dependencies, be informative
local b=0 local b=0
for pkgdep in ${list[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#list[*]} )) - Installing ${_pkgname} dependency ${pkgdep}"
for pkgdep in ${validlist[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - Installing ${_pkgname} dependency ${pkgdep}"
sudo apt install -y ${pkgdep} &> /dev/null sudo apt install -y ${pkgdep} &> /dev/null
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
let b++ let b++
@ -149,6 +192,10 @@ function preparepackage() {
exit 1 exit 1
fi fi
done done
if [[ -n ${validlist[*]} ]]; then
# Add empty newline
echo ""
fi
} }
# Get git-based version in order to rename the package main folder # Get git-based version in order to rename the package main folder
@ -190,8 +237,8 @@ function preparepackage() {
} }
# Execute above functions # Execute above functions
pkgdependencies ${_pkgdeps[*]} && \
if [[ -v _pkgdeps_runtime ]]; then pkgdependencies ${_pkgdeps_runtime[*]}; fi
pkgdependencies "${_pkgdeps_build[*]}" buildtime && \
if [[ -v _pkgdeps_runtime ]]; then pkgdependencies "${_pkgdeps_runtime[*]}" runtime ; fi
pkgfoldername pkgfoldername
unset _pkgver unset _pkgver
@ -254,10 +301,10 @@ function meson_install_main() {
sed -ir '/rm \-rf \$\$(pwd)\/debian\/meson\/usr\/lib\/python3/d' debian/rules sed -ir '/rm \-rf \$\$(pwd)\/debian\/meson\/usr\/lib\/python3/d' debian/rules
# Remove deprecated, downloaded patch files # Remove deprecated, downloaded patch files
rm -r debian/patches
rm -rf debian/patches
# Remove irrelevant sample files # Remove irrelevant sample files
rm -r debian/*.{ex,EX}
rm -rf debian/*.{ex,EX}
# Start deb builder. Do not build either debug symbols or doc files # Start deb builder. Do not build either debug symbols or doc files
DEB_BUILD_OPTIONS="strip nodocs noddebs nocheck" dpkg-buildpackage -rfakeroot -b -us -uc DEB_BUILD_OPTIONS="strip nodocs noddebs nocheck" dpkg-buildpackage -rfakeroot -b -us -uc
@ -315,7 +362,7 @@ function glslang_install_main() {
printf 'override_dh_usrlocal:' | tee -a debian/rules printf 'override_dh_usrlocal:' | tee -a debian/rules
# Remove irrelevant sample files # Remove irrelevant sample files
rm -r debian/*.{ex,EX}
rm -rf debian/*.{ex,EX}
# Start deb builder. Do not build either debug symbols or doc files # Start deb builder. Do not build either debug symbols or doc files
DEB_BUILD_OPTIONS="strip nodocs noddebs" dpkg-buildpackage -rfakeroot -b -us -uc DEB_BUILD_OPTIONS="strip nodocs noddebs" dpkg-buildpackage -rfakeroot -b -us -uc
@ -402,19 +449,19 @@ function dxvk_install_main() {
# Check if the following folder exists, and proceed. # Check if the following folder exists, and proceed.
if [[ -d ${DXVKROOT}/../../dxvk_custom_patches ]]; then if [[ -d ${DXVKROOT}/../../dxvk_custom_patches ]]; then
cp -r ${DXVKROOT}/../../dxvk_custom_patches/*.{patch,diff} ${DXVKROOT}/${pkgname}/
cp -r ${DXVKROOT}/../../dxvk_custom_patches/*.{patch,diff} ${DXVKROOT}/${pkgname}/ 2>/dev/null
local dxvk_builddir=$(ls ${DXVKROOT}/${pkgname}/)
local dxvk_builddir_name=$(ls ${DXVKROOT}/${pkgname}/)
# Expecting just one folder here. This method doesn't work with multiple dirs present
if [[ $(echo ${dxvk_builddir} | wc -l) -gt 1 ]]; then
echo "Error: Multiple dxvk build directories detected. Can't decide which one to use. Aborting\n"
# 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
echo "Error: Multiple entries in dxvk build directory detected. Can't decide which one to use. Aborting\n"
exit 1 exit 1
fi fi
local dxvk_buildpath=$(readlink -f ${dxvk_builddir})
local dxvk_builddir_path="${DXVKROOT}/${pkgname}/${dxvk_builddir_name}"
cd ${dxvk_buildpath}
cd "${dxvk_builddir_path}"
for pfile in ../*.{patch,diff}; do for pfile in ../*.{patch,diff}; do
if [[ -f ${pfile} ]]; then if [[ -f ${pfile} ]]; then
echo -e "Applying DXVK patch: ${pfile}\n" echo -e "Applying DXVK patch: ${pfile}\n"
@ -455,7 +502,7 @@ function dxvk_install_main() {
printf "\n${dxvx_relative_builddir}/bin/* usr/bin/" >> debian/install printf "\n${dxvx_relative_builddir}/bin/* usr/bin/" >> debian/install
# Remove irrelevant sample files # Remove irrelevant sample files
rm -r debian/*.{ex,EX}
rm -rf debian/*.{ex,EX}
# Overwrite debian/rules file with the following contents # Overwrite debian/rules file with the following contents
cat << 'DXVK-DEBIANRULES' > debian/rules cat << 'DXVK-DEBIANRULES' > debian/rules
@ -526,3 +573,23 @@ DXVK-DEBIANRULES
pkgcompilecheck meson meson_install_main pkgcompilecheck meson meson_install_main
pkgcompilecheck glslang glslang_install_main pkgcompilecheck glslang glslang_install_main
dxvk_install_main dxvk_install_main
##########################
# Build time dependencies which were installed but no longer needed
if [[ -v buildpkglist ]]; then
if [[ -v BUILDPKG_RM ]]; then
sudo apt purge --remove -y "${buildpkglist[*]}"
# In some cases, glslang or meson may still be present on the system. Remove them
for extrapkg in glslang meson; do
if [[ $(echo $(dpkg -s ${extrapkg} &>/dev/null)$?) -eq 0 ]]; then
sudo apt purge --remove -y ${extrapkg}
fi
done
else
echo -e "The following build time dependencies were installed and no longer needed:\n\n$(for l in ${buildpkglist[*]}; do echo -e ${l}; done)\n"
fi
fi

+ 57
- 16
debian/updatewine_debian.sh View File

@ -55,6 +55,9 @@ for check in ${args[@]}; do
--no-wine) --no-wine)
NO_WINE= NO_WINE=
;; ;;
--no-staging)
NO_STAGING=
;;
--no-dxvk) --no-dxvk)
NO_DXVK= NO_DXVK=
;; ;;
@ -62,6 +65,7 @@ for check in ${args[@]}; do
NO_POL= NO_POL=
;; ;;
--no-install) --no-install)
NO_INSTALL=
# If this option is given, do not check PoL wineprefixes # If this option is given, do not check PoL wineprefixes
NO_POL= NO_POL=
;; ;;
@ -93,8 +97,8 @@ trap "Deb_intCleanup" INT
# Check existence of ccache package # Check existence of ccache package
function ccacheCheck() { function ccacheCheck() {
if [[ $(echo $(dpkg -s ccache &>/dev/null)$?) -eq 0 ]]; then
echo -e "NOTE: Please consider using 'ccache' for faster compilation times.\nInstall it by typing 'sudo apt install ccache'\n"
if [[ $(echo $(dpkg -s ccache &>/dev/null)$?) -ne 0 ]]; then
echo -e "NOTE: Please consider installation of 'ccache' for faster compilation times if you compile repetitively.\nInstall it by typing 'sudo apt install ccache'\n"
fi fi
} }
@ -106,7 +110,7 @@ ccacheCheck
function wine_install_main() { function wine_install_main() {
echo -e "Starting compilation & installation of Wine\n\n\
echo -e "Starting compilation & installation of Wine$(if [[ ! -v NO_STAGING ]]; then printf " Staging"; fi)\n\n\
This can take up to 0.5-2 hours depending on the available CPU cores.\n\n\ This can take up to 0.5-2 hours depending on the available CPU cores.\n\n\
Using $(nproc --ignore 1) of $(nproc) available CPU cores for Wine source code compilation. Using $(nproc --ignore 1) of $(nproc) available CPU cores for Wine source code compilation.
" "
@ -117,6 +121,22 @@ Using $(nproc --ignore 1) of $(nproc) available CPU cores for Wine source code c
######################################################## ########################################################
# Call DXVK compilation & installation subscript in the following function
function dxvk_install_main() {
echo -e "Starting compilation & installation of DXVK\n\n\
This can take up to 10-20 minutes depending on the available CPU cores\n\
& how many dependencies we need to build.\n\n\
Using $(nproc --ignore 1) of $(nproc) available CPU cores for Wine source code compilation.
"
bash -c "cd ${ROOTDIR}/dxvkroot && bash dxvkbuild.sh \"${datedir}\" \"${args[*]}\""
}
########################################################
function mainQuestions() { function mainQuestions() {
# General function for question responses # General function for question responses
@ -136,11 +156,10 @@ function mainQuestions() {
################################## ##################################
INFO_SEP INFO_SEP
echo -e "\e[1mINFO:\e[0m About installation\n\nThe installation may take long time because many development dependencies may be \ echo -e "\e[1mINFO:\e[0m About installation\n\nThe installation may take long time because many development dependencies may be \
installed and the following packages will be compiled from source (depending on your choise):\n\n\
installed and the following packages may be compiled from source (depending on your choises):\n\n\
\t- Wine/Wine Staging (latest git version)\n\ \t- Wine/Wine Staging (latest git version)\n\
\t- DXVK (latest git version)\n\ \t- DXVK (latest git version)\n\
\t- meson & glslang (latest git versions; these are build time dependencies for DXVK)\n\n\ \t- meson & glslang (latest git versions; these are build time dependencies for DXVK)\n\n\
@ -153,6 +172,18 @@ Do you want to continue? [Y/n]"
exit 1 exit 1
fi fi
####################
INFO_SEP
echo -e "\e[1mQUESTION:\e[0m Do you want to remove unneeded build time dependencies after package build process? [Y/n]"
questionresponse
if [[ $? -eq 0 ]]; then
args+=('--buildpkg-rm')
fi
#################### ####################
AVAIL_SPACE=$(df -h -B MB --output=avail . | sed '1d; s/[A-Z]*//g') AVAIL_SPACE=$(df -h -B MB --output=avail . | sed '1d; s/[A-Z]*//g')
@ -179,21 +210,24 @@ Do you really want to continue? [Y/n]"
#################### ####################
INFO_SEP
# This question is relevant only if DXVK stuff is compiled
if [[ ! -v NO_DXVK ]]; then
INFO_SEP
echo -e "\e[1mINFO:\e[0m Update existing dependencies?\n\nIn a case you have old build time dependencies on your system, do you want to update them?\n\
echo -e "\e[1mQUESTION:\e[0m Update existing dependencies?\n\nIn a case you have old build time dependencies on your system, do you want to update them?\n\
If you answer 'yes', then those dependencies are updated if needed. Otherwise, already installed\n\ If you answer 'yes', then those dependencies are updated if needed. Otherwise, already installed\n\
build time dependencies are not updated. If you don't have 'meson' or 'glslang' installed on your system, they will be compiled, anyway.\n\ build time dependencies are not updated. If you don't have 'meson' or 'glslang' installed on your system, they will be compiled, anyway.\n\
Be aware, that updating these packages may increase total run time used by this script.\n\n\ Be aware, that updating these packages may increase total run time used by this script.\n\n\
Update dependency packages & other system packages? [Y/n]" Update dependency packages & other system packages? [Y/n]"
questionresponse
questionresponse
if [[ $? -eq 0 ]]; then
args+=('--updateoverride')
fi
if [[ $? -eq 0 ]]; then
args+=('--updateoverride')
fi
INFO_SEP
INFO_SEP
fi
} }
@ -220,7 +254,7 @@ function coredeps_check() {
######################################################## ########################################################
# If either Wine or DXVK is to be installed
# If either Wine or DXVK is to be compiled
if [[ ! -v NO_WINE ]] || [[ ! -v NO_DXVK ]]; then if [[ ! -v NO_WINE ]] || [[ ! -v NO_DXVK ]]; then
mainQuestions mainQuestions
coredeps_check coredeps_check
@ -228,18 +262,25 @@ fi
#################### ####################
# If Wine is going to be compiled, then
if [[ ! -v NO_WINE ]]; then if [[ ! -v NO_WINE ]]; then
wine_install_main wine_install_main
else else
echo -e "Skipping Wine build & installation process.\n"
echo -e "Skipping Wine build$(if [[ ! -v NO_INSTALL ]]; then printf " & installation"; fi) process.\n"
fi fi
##########
# If DXVK is going to be installed, then
if [[ ! -v NO_DXVK ]]; then if [[ ! -v NO_DXVK ]]; then
bash -c "cd ${ROOTDIR}/dxvkroot && bash dxvkbuild.sh \"${datedir}\" \"${args[*]}\""
dxvk_install_main
else else
echo -e "Skipping DXVK build & installation process.\n"
echo -e "Skipping DXVK build$(if [[ ! -v NO_INSTALL ]]; then printf " & installation"; fi) process.\n"
fi fi
##########
# If PlayOnLinux Wine prefixes are going to be updated, then
if [[ ! -v NO_POL ]]; then if [[ ! -v NO_POL ]]; then
bash -c "cd ${ROOTDIR} && bash playonlinux_prefixupdate.sh" bash -c "cd ${ROOTDIR} && bash playonlinux_prefixupdate.sh"
fi fi


+ 122
- 24
debian/wineroot/winebuild.sh View File

@ -157,12 +157,13 @@ wine_deps_build_i386=(
'libfontconfig1-dev:i386' 'libfontconfig1-dev:i386'
'ocl-icd-opencl-dev:i386' 'ocl-icd-opencl-dev:i386'
'libvulkan-dev:i386' 'libvulkan-dev:i386'
'libxslt1-dev:i386'
'libxml2-dev:i386'
'libicu-dev:i386' 'libicu-dev:i386'
'libxml2-dev:i386'
'libxslt1-dev:i386'
'libtiff-dev:i386' 'libtiff-dev:i386'
'libcups2-dev:i386' 'libcups2-dev:i386'
'libgnutls28-dev:i386' 'libgnutls28-dev:i386'
'gir1.2-gstreamer-1.0:i386' #required by libgstreamer1.0-dev:i386 (Mint)
'libgstreamer1.0-dev:i386' 'libgstreamer1.0-dev:i386'
'libgstreamer-plugins-base1.0-dev:i386' 'libgstreamer-plugins-base1.0-dev:i386'
) )
@ -306,6 +307,9 @@ for check in ${args[@]}; do
--no-install) --no-install)
NO_INSTALL= NO_INSTALL=
;; ;;
--buildpkg-rm)
BUILDPKG_RM=
;;
esac esac
done done
@ -326,7 +330,7 @@ trap "Wine_intCleanup" INT
######################################################## ########################################################
# This is specifically for Debian # This is specifically for Debian
# Must be done to install Wine buildtime dependencies on amd64 environment
# Must be done in order to install Wine i386 buildtime dependencies on amd64 environment
# #
if [[ $(dpkg --print-foreign-architectures | grep i386 | wc -w) -eq 0 ]]; then if [[ $(dpkg --print-foreign-architectures | grep i386 | wc -w) -eq 0 ]]; then
sudo dpkg --add-architecture i386 sudo dpkg --add-architecture i386
@ -335,6 +339,20 @@ fi
######################################################## ########################################################
# If user has gstreamer girl (amd64) package installed on the system
# before Wine compilation, then reinstall it after the compilation process
#
function girl_check() {
girlpkg="gir1.2-gstreamer-1.0:amd64"
if [[ $(echo $(dpkg -s ${girlpkg} &>/dev/null)$?) -eq 0 ]]; then
GIRL_CHECK=
fi
}
########################################################
function getWine() { function getWine() {
local wine_url="git://source.winehq.org/git/wine.git" local wine_url="git://source.winehq.org/git/wine.git"
@ -394,12 +412,15 @@ function getDebianFiles() {
# Wine dependencies removal/installation # Wine dependencies removal/installation
# Global variable to track buildtime dependencies
z=0
function WineDeps() { function WineDeps() {
local a=0
local method=${1} local method=${1}
local deps="${2}" local deps="${2}"
local depsname=${3} local depsname=${3}
local pkgtype=${4}
case ${method} in case ${method} in
install) install)
@ -420,29 +441,40 @@ 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}"
# 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
local checkstatus=0 local checkstatus=0
;; ;;
remove) remove)
# Package is installed, remove it
local checkstatus=1 local 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 local a=0
for p in ${@}; do
for p in ${deplist[@]}; do
if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne ${checkstatus} ]]; then if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne ${checkstatus} ]]; then
local list[$a]=${p}
local validlist[$a]=${p}
let a++ let a++
# Global array to track installed build dependencies
if [[ ${method} == "install" ]] && [[ ${pkgtype} == "buildtime" ]]; then
buildpkglist[$z]=${p}
let z++
fi
fi fi
done done
# Install missing/Remove existing dependencies, be informative # Install missing/Remove existing dependencies, be informative
local b=0 local b=0
for pkgdep in ${list[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#list[*]} )) - ${str} ${depsname} dependency ${pkgdep}"
for pkgdep in ${validlist[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - ${str} ${depsname} dependency ${pkgdep}"
eval ${mgrcmd} ${pkgdep} &> /dev/null eval ${mgrcmd} ${pkgdep} &> /dev/null
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
let b++ let b++
@ -451,6 +483,10 @@ function WineDeps() {
exit 1 exit 1
fi fi
done done
if [[ -n ${validlist[*]} ]]; then
# Add empty newline
echo ""
fi
} }
pkgdependencies "${deps[*]}" pkgdependencies "${deps[*]}"
@ -585,6 +621,8 @@ function wine32Build() {
######################################################## ########################################################
# Merge compiled files, build Debian archive
function mergeWineBuilds() { function mergeWineBuilds() {
cp -r "${WINEDIR_INSTALL_64}"/* "${WINEDIR_PACKAGE}"/ cp -r "${WINEDIR_INSTALL_64}"/* "${WINEDIR_PACKAGE}"/
@ -636,7 +674,7 @@ DEBIANCONTROL
function installDebianArchive() { function installDebianArchive() {
cd "${WINEROOT}" cd "${WINEROOT}"
# TODO Although the package name ends with 'amd64', this contains both 32 and 64 bit Wine versions # TODO Although the package name ends with 'amd64', this contains both 32 and 64 bit Wine versions
echo -e "\nInstalling Wine.\n"
echo -e "\nInstalling Wine$(if [[ -v ! NO_STAGING ]]; then printf " Staging"; fi).\n"
sudo dpkg -i ${PKGNAME}_${wine_version}-1_amd64.deb sudo dpkg -i ${PKGNAME}_${wine_version}-1_amd64.deb
} }
@ -651,8 +689,41 @@ function cleanTree() {
rm -rf "${WINEROOT}" rm -rf "${WINEROOT}"
} }
###########################################################
# Check presence of Wine if compiled deb is going to be installed
# This function is not relevant if --no-install switch is used
function wineCheck() {
# Known Wine package names to check on Debian
local known_wines=(
'wine'
'wine32'
'wine64'
'wine-git'
'wine-staging-git'
'libwine:amd64'
'libwine:i386'
'fonts-wine'
)
# Check if any of these Wine packages are present on the system
for winepkg in ${known_wines[@]}; do
if [[ $(echo $(dpkg -s ${winepkg} &>/dev/null)$?) -eq 0 ]]; then
sudo apt purge --remove -y ${winepkg}
fi
done
}
######################################################## ########################################################
# Check existence of gstreamer girl package before further operations
girl_check
##########################
# Get Wine (& Wine-Staging) sources # Get Wine (& Wine-Staging) sources
getWine getWine
@ -680,50 +751,77 @@ getWineVersion
########################## ##########################
# Install Wine common buildtime dependencies # Install Wine common buildtime dependencies
WineDeps install "${wine_deps_build_common[*]}" "Wine common build time"
# Install Wine common runtime dependencies
WineDeps install "${wine_deps_runtime_common[*]}" "Wine common runtime"
WineDeps install "${wine_deps_build_common[*]}" "Wine common build time" buildtime
########################## ##########################
# TODO If we do architecture separation in the future, add if check for amd64 here # TODO If we do architecture separation in the future, add if check for amd64 here
# Condition would be: if amd64, then # Condition would be: if amd64, then
# #
# Purge amd64 buildtime dependencies
# Purge i386 buildtime dependencies
# On Debian, we can't have them with i386 at the same time # On Debian, we can't have them with i386 at the same time
# i386/amd64 runtime dependencies have been tested and they are able to co-exist on Debian system
# #
echo -e "Preparing system environment for 64-bit Wine compilation.\n" echo -e "Preparing system environment for 64-bit Wine compilation.\n"
WineDeps remove "${wine_deps_build_i386[*]}" "Wine build time (32-bit)"
WineDeps remove "${wine_deps_build_i386[*]}" "Wine build time (32-bit)" buildtime
WineDeps install "${wine_deps_build_amd64[*]}" "Wine build time (64-bit)"
WineDeps install "${wine_deps_runtime_amd64[*]}" "Wine runtime (64-bit)"
WineDeps install "${wine_deps_build_amd64[*]}" "Wine build time (64-bit)" buildtime
wine64Build && \ wine64Build && \
echo -e "\nWine 64-bit build process finished.\n" echo -e "\nWine 64-bit build process finished.\n"
########################## ##########################
# TODO if i386 / amd64
# TODO If we do architecture separation in the future, add if check for i386 here # TODO If we do architecture separation in the future, add if check for i386 here
# Condition would be: if i386 or amd64, then # Condition would be: if i386 or amd64, then
# #
# Purge amd64 buildtime dependencies # Purge amd64 buildtime dependencies
# On Debian, we can't have them with i386 at the same time # On Debian, we can't have them with i386 at the same time
# i386/amd64 runtime dependencies have been tested and they are able to co-exist on Debian system
# #
echo -e "Preparing system environment for 32-bit Wine compilation.\n" echo -e "Preparing system environment for 32-bit Wine compilation.\n"
WineDeps remove "${wine_deps_build_amd64[*]}" "Wine build time (64-bit)"
WineDeps remove "${wine_deps_build_amd64[*]}" "Wine build time (64-bit)" buildtime
WineDeps install "${wine_deps_build_i386[*]}" "Wine build time (32-bit)"
WineDeps install "${wine_deps_runtime_i386[*]}" "Wine runtime (32-bit)"
WineDeps install "${wine_deps_build_i386[*]}" "Wine build time (32-bit)" buildtime
wine32Build && wine32Build &&
echo -e "\nWine 32-bit build process finished.\n" echo -e "\nWine 32-bit build process finished.\n"
########################## ##########################
# Remove i386 buildtime dependencies after successful compilation process # Remove i386 buildtime dependencies after successful compilation process
WineDeps remove "${wine_deps_build_i386[*]}" "Wine build time (64-bit)"
WineDeps remove "${wine_deps_build_i386[*]}" "Wine build time (32-bit)" buildtime
##########################
# i386/amd64 runtime dependencies have been tested and they are able to co-exist on Debian system
if [[ ! -v NO_INSTALL ]]; then
# Install Wine common runtime dependencies
WineDeps install "${wine_deps_runtime_common[*]}" "Wine common runtime" runtime
# Install architecture-dependent Wine runtime dependencies
WineDeps install "${wine_deps_runtime_amd64[*]}" "Wine runtime (64-bit)" runtime
WineDeps install "${wine_deps_runtime_i386[*]}" "Wine runtime (32-bit)" runtime
# Check presence of already installed Wine packages and remove them
wineCheck
fi
##########################
# Build time dependencies which were installed but no longer needed
if [[ -v buildpkglist ]]; then
if [[ -v BUILDPKG_RM ]]; then
sudo apt purge --remove -y "${buildpkglist[*]}"
else
echo -e "The following build time dependencies were installed and no longer needed:\n\n$(for l in ${buildpkglist[*]}; do echo -e ${l}; done)\n"
fi
fi
##########################
if [[ -v GIRL_CHECK ]]; then
sudo apt install -y ${girlpkg}
fi
######################################################## ########################################################


debian_devpkgremoval.sh → debian_cleanup_devpkgs.sh View File

@ -172,6 +172,8 @@ core_deps_noremove=(
removals_name=('Meson' 'Wine Staging' 'DXVK') removals_name=('Meson' 'Wine Staging' 'DXVK')
removals=('${meson_deps[*]}' '${wine_deps[*]}' '${dxvk_deps[*]}') removals=('${meson_deps[*]}' '${wine_deps[*]}' '${dxvk_deps[*]}')
echo -e "This script removes any development/build time dependencies related to Wine & DXVK\n"
i=0 i=0
for k in ${removals[*]}; do for k in ${removals[*]}; do
echo -e "\nRemoving ${removals_name[$i]} buildtime dependencies\n" echo -e "\nRemoving ${removals_name[$i]} buildtime dependencies\n"
@ -183,7 +185,7 @@ echo -e "\nThe following Wine Staging buildtime dependencies were not removed:\n
echo -e "\nThe following core buildtime dependencies were not removed:\n$(for o in ${core_deps_noremove[*]}; do echo ${o}; done)\n" echo -e "\nThe following core buildtime dependencies were not removed:\n$(for o in ${core_deps_noremove[*]}; do echo ${o}; done)\n"
read -r -p "Auto remove packages which are no longer needed? [Y/n] " question
read -r -p "Show list of auto removable packages which are no longer needed? [Y/n] " question
if [[ $(echo $question | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then if [[ $(echo $question | sed 's/ //g') =~ ^([yY][eE][sS]|[yY])$ ]]; then
sudo apt-get purge --autoremove sudo apt-get purge --autoremove

+ 7
- 3
debian_install_nvidia.sh View File

@ -315,7 +315,7 @@ function pkgdependencies() {
local a=0 local a=0
for p in ${@}; do for p in ${@}; do
if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne 0 ]]; then if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne 0 ]]; then
list[$a]=${p}
validlist[$a]=${p}
let a++ let a++
fi fi
done done
@ -334,8 +334,8 @@ function pkgdependencies() {
# Install missing dependencies, be informative # Install missing dependencies, be informative
local b=0 local b=0
for pkgdep in ${list[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#list[*]} )) - Installing ${_pkgname} dependency ${pkgdep}"
for pkgdep in ${validlist[@]}; do
echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - Installing ${_pkgname} dependency ${pkgdep}"
sudo apt install -y ${pkgdep} &> /dev/null sudo apt install -y ${pkgdep} &> /dev/null
if [[ $? -eq 0 ]]; then if [[ $? -eq 0 ]]; then
let b++ let b++
@ -344,6 +344,10 @@ function pkgdependencies() {
exit 1 exit 1
fi fi
done done
if [[ -n ${validlist[*]} ]]; then
# Add empty newline
echo ""
fi
} }
######################################################## ########################################################


+ 2
- 0
updatewine.sh View File

@ -45,10 +45,12 @@ trap "exit" INT
COMMANDS=( COMMANDS=(
date date
df
find find
git git
grep grep
groups groups
nproc
patch patch
readlink readlink
sudo sudo


Loading…
Cancel
Save