From 22551ecfa17f1d2aaf51e2980d82b4c4810fdb08 Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Wed, 29 Jul 2020 16:50:18 +0300 Subject: [PATCH] [Debian] Add compat files; Add 'optional' keyword for deb dependencies; glslang build depends on Python 3; Fix DXVK install dep check --- debian/dxvkroot/dxvk.debdata | 6 ++++++ debian/dxvkroot/dxvkbuild.sh | 18 +++++++++++------- debian/dxvkroot/glslang.debdata | 8 +++++++- debian/dxvkroot/meson.debdata | 6 ++++++ debian/wineroot/winebuild.sh | 18 +++++++++++++++--- 5 files changed, 45 insertions(+), 11 deletions(-) diff --git a/debian/dxvkroot/dxvk.debdata b/debian/dxvkroot/dxvk.debdata index 7767613..552796c 100755 --- a/debian/dxvkroot/dxvk.debdata +++ b/debian/dxvkroot/dxvk.debdata @@ -26,6 +26,12 @@ pkg_gitver="git describe --long | sed 's/\-[a-z].*//; s/\-/\./; s/[a-z]//g'" pkg_installfile="./debian/install" pkg_controlfile="./debian/control" pkg_rulesfile="./debian/rules" +pkg_compatfile="./debian/compat" + +######################################################## +# Debian compatibility flag + +pkg_debcompat="9" ######################################################## # Debian rules file section diff --git a/debian/dxvkroot/dxvkbuild.sh b/debian/dxvkroot/dxvkbuild.sh index e014165..fd2c3ff 100755 --- a/debian/dxvkroot/dxvkbuild.sh +++ b/debian/dxvkroot/dxvkbuild.sh @@ -344,6 +344,8 @@ function compile_and_install_deb() { local _pkg_deps_build="${13}" local _pkg_deps_runtime="${14}" local _pkg_debbuilder="${15}" + local _pkg_debcompat="${16}" + local _pkg_compatfile="${17}" ############################ # COMMON - ARRAY PARAMETER FIX @@ -379,8 +381,7 @@ function compile_and_install_deb() { ############################ function pkg_installcheck() { - RETURNVALUE=$(echo $(dpkg -s "${1}" &>/dev/null)$?) - return $RETURNVALUE + return $(echo $(dpkg -s "${1}" &>/dev/null)$?) } ############################ @@ -416,7 +417,7 @@ function compile_and_install_deb() { # Generate a list of missing dependencies local a=0 for p in ${_pkg_list[@]}; do - if [[ $(pkg_installcheck ${p}) -eq 0 ]]; then + if [[ $(pkg_installcheck ${p})$? -eq 0 ]]; then local _validlist[$a]=${p} let a++ @@ -439,7 +440,7 @@ function compile_and_install_deb() { function pkg_configure() { if [[ $(sudo dpkg-reconfigure ${1} | grep "is broken or not fully installed") ]]; then - if [[ -v ${2} ]]; then + if [[ -v ${2} ]]; then pkg_localinstall ${2} ${1} else pkg_remoteinstall ${1} @@ -457,7 +458,7 @@ function compile_and_install_deb() { altRemotepkg=$(echo ${altRemote} | awk -F ',' '{print $1}') altRemotever=$(echo ${altRemote} | awk -F ',' '{print $2}') if [[ "${_pkg_dep}" == "${altRemotepkg}" ]]; then - if [[ $(pkg_installcheck ${altRemotepkg}) -ne 0 ]]; then + if [[ $(pkg_installcheck ${altRemotepkg})$? -ne 0 ]]; then # TODO remove duplicate functionality if [[ $(apt-cache show "${altRemotepkg}" | grep -m1 -oP "(?<=^Version: )[0-9|\.]*" | sed 's/\.//g') < ${altRemotever} ]]; then @@ -481,7 +482,7 @@ function compile_and_install_deb() { done fi - if [[ $(pkg_installcheck ${_pkg_dep}) -ne 0 ]]; then + if [[ $(pkg_installcheck ${_pkg_dep})$? -ne 0 ]]; then pkg_remoteinstall "${_pkg_dep}" pkg_configure "${_pkg_dep}" fi @@ -571,6 +572,7 @@ function compile_and_install_deb() { pkg_override_debianfile "${_pkg_debinstall}" "${_pkg_installfile}" pkg_override_debianfile "${_pkg_debcontrol}" "${_pkg_controlfile}" pkg_override_debianfile "${_pkg_debrules}" "${_pkg_rulesfile}" + pkg_override_debianfile "${_pkg_debcompat}" "${_pkg_compatfile}" else echo -e "\e[1mERROR:\e[0m Error while downloading source of ${_pkg_name} package. Aborting\n" @@ -722,7 +724,9 @@ function pkg_install_main() { "${pkg_rulesfile}" \ "${pkg_deps_build}" \ "${pkg_deps_runtime}" \ - "${pkg_debbuilder}" + "${pkg_debbuilder}" \ + "${pkg_debcompat}" \ + "${pkg_compatfile}" } diff --git a/debian/dxvkroot/glslang.debdata b/debian/dxvkroot/glslang.debdata index 6f2db2d..8665694 100644 --- a/debian/dxvkroot/glslang.debdata +++ b/debian/dxvkroot/glslang.debdata @@ -23,6 +23,12 @@ pkg_gitver="git describe --long | sed 's/\-[a-z].*//; s/\-/\./; s/[a-z]//g'" pkg_installfile="./debian/install" pkg_controlfile="./debian/control" pkg_rulesfile="./debian/rules" +pkg_compatfile="./debian/compat" + +######################################################## +# Debian compatibility flag + +pkg_debcompat="9" ######################################################## # Debian rules file section @@ -92,7 +98,7 @@ empty pkg_deps_build=( #${_coredeps[*]} 'cmake' -'python2.7' +'python3' ) # Runtime dependencies diff --git a/debian/dxvkroot/meson.debdata b/debian/dxvkroot/meson.debdata index 4356579..f9fc5f3 100755 --- a/debian/dxvkroot/meson.debdata +++ b/debian/dxvkroot/meson.debdata @@ -25,6 +25,12 @@ pkg_gitver="git describe --long | sed 's/\-[a-z].*//; s/\-/\./; s/[a-z]//g'" pkg_installfile="./debian/install" pkg_controlfile="./debian/control" pkg_rulesfile="./debian/rules" +pkg_compatfile="./debian/compat" + +######################################################## +# Debian compatibility flag + +pkg_debcompat="9" ######################################################## # Debian rules file section diff --git a/debian/wineroot/winebuild.sh b/debian/wineroot/winebuild.sh index 6e5680a..30b604d 100755 --- a/debian/wineroot/winebuild.sh +++ b/debian/wineroot/winebuild.sh @@ -71,6 +71,8 @@ wine_deps_build_amd64=( 'libxi-dev:amd64' 'libxt-dev:amd64' 'libxmu-dev:amd64' +'libgl-dev:amd64' +'libglx-dev:amd64|optional' 'libx11-dev:amd64' 'libxext-dev:amd64' 'libxfixes-dev:amd64' @@ -123,6 +125,8 @@ wine_deps_build_i386=( 'libxi-dev:i386' 'libxt-dev:i386' 'libxmu-dev:i386' +'libgl-dev:i386' +'libglx-dev:i386|optional' 'libx11-dev:i386' 'libxext-dev:i386' 'libxfixes-dev:i386' @@ -621,7 +625,8 @@ function WineDeps() { # Generate a list of missing/removable dependencies, depending on the logic local a=0 for p in ${deplist[@]}; do - if [[ $(echo $(dpkg -s ${p} &>/dev/null)$?) -ne ${checkstatus} ]]; then + pf=$(printf "%s" ${p} | sed -r 's/^(.*)\|.*/\1/') + if [[ $(echo $(dpkg -s ${pf} &>/dev/null)$?) -ne ${checkstatus} ]]; then local validlist[$a]=${p} let a++ @@ -637,9 +642,16 @@ function WineDeps() { # Install missing/Remove existing dependencies, be informative local b=0 for pkgdep in ${validlist[@]}; do + + optional=0 + if [[ ${pkgdep} =~ \|optional ]]; then + pkgdep=$(printf "%s" ${pkgdep} | sed -r 's/^(.*)\|.*/\1/') + optional=1 + fi + echo -e "$(( $b + 1 ))/$(( ${#validlist[*]} )) - ${str} ${depsname} dependency ${pkgdep}" eval ${mgrcmd} ${pkgdep} &> /dev/null - if [[ $? -eq 0 ]]; then + if [[ $? -eq 0 ]] || [[ ${optional} == 1 ]]; then let b++ else echo -e "\n\e[1mERROR:\e[0m Error occured while processing ${pkgdep}. Aborting.\n" @@ -840,7 +852,7 @@ function buildDebianArchive() { dh_make --createorig -s -y -c lgpl rm debian/*.{ex,EX} printf "usr/* /usr" > debian/install - + printf "9" > debian/compat feed_debiancontrol # Start compilation process