From e09449f7acf2fba16aea735ad26989d3b217b55b Mon Sep 17 00:00:00 2001 From: Pekka Helenius Date: Tue, 28 May 2019 20:34:56 +0300 Subject: [PATCH] Improve patch support --- README.md | 4 ++++ arch/0-wine-staging-git/PKGBUILD | 14 +++++++++++++- arch/updatewine_arch.sh | 10 ++++------ debian/wineroot/winebuild.sh | 15 +++++++++++++-- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d44b442..bdf7f3d 100755 --- a/README.md +++ b/README.md @@ -182,6 +182,10 @@ Folders `dxvk_disabled_patches` and `wine_disabled_patches` are just for managem Wine patches are not related to Wine Staging patchset. You can use your custom Wine patches either with Wine Staging or vanilla Wine. +### Distinguish Wine staging and non-staging patches + +By using keywords `_staging` or `_nostaging` in your patch filename, you can quickly distinguish similar patches which are targeted either to Wine staging or Wine vanilla version. + ---------------- ## Compiled packages are stored for later usage diff --git a/arch/0-wine-staging-git/PKGBUILD b/arch/0-wine-staging-git/PKGBUILD index 2b8fc19..e1e0c1a 100755 --- a/arch/0-wine-staging-git/PKGBUILD +++ b/arch/0-wine-staging-git/PKGBUILD @@ -124,7 +124,19 @@ source=( ) if [[ $(find ${PWD}/wine-patches -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$") ]]; then - cp -rf ${PWD}/wine-patches/*.{patch,diff} ./ 2>/dev/null + for file in ${PWD}/wine-patches/*.{patch,diff}; do + + if [[ $(echo ${file}) == *"_nostaging"* ]] && [[ enable_staging -eq 1 ]]; then + continue + fi + + if [[ $(echo ${file}) == *"_staging"* ]] && [[ enable_staging -eq 0 ]]; then + continue + fi + + cp ${file} . 2>/dev/null + + done p=0 for patch in $(find . -mindepth 1 -maxdepth 1 -regex ".*\.\(patch\|diff\)$"); do patches[$p]="$(basename ${patch})" diff --git a/arch/updatewine_arch.sh b/arch/updatewine_arch.sh index 882b363..49bde56 100755 --- a/arch/updatewine_arch.sh +++ b/arch/updatewine_arch.sh @@ -378,9 +378,7 @@ function set_gitOverride() { # Remove any existing pkg,src or tar.xz packages left by previous pacman commands function cleanUp() { - rm -rf ${ARCH_BUILDROOT}/*/{pkg,src,*.tar.xz} - rm -rf ${ARCH_BUILDROOT}/0-wine-staging-git/{*.patch} - rm -rf ${ARCH_BUILDROOT}/0-dxvk-git/{*.patch} + rm -rf ${ARCH_BUILDROOT}/*/{pkg,src,*.tar.xz,*.patch,*.diff} } ########################################################### @@ -511,12 +509,12 @@ checkStaging # Check whether we have ccache installed ccacheCheck -# Prepare building environment: copy patches and create timestamped folder for compiled packages -prepare_env - # Clean all previous trash we may have cleanUp +# Prepare building environment: copy patches and create timestamped folder for compiled packages +prepare_env + ######################### # Check Wine & DXVK dependencies, depending on whether these packages diff --git a/debian/wineroot/winebuild.sh b/debian/wineroot/winebuild.sh index b857911..a6ff905 100755 --- a/debian/wineroot/winebuild.sh +++ b/debian/wineroot/winebuild.sh @@ -427,7 +427,18 @@ function getWine() { ########## mkdir wine-{patches,32-build,32-install,64-build,64-install,package} - cp -r ../../../wine_custom_patches/*.{patch,diff} wine-patches/ 2>/dev/null + + for file in ../../../wine_custom_patches/*.{patch,diff}; do + if [[ $(echo "${file}") == *"_staging"* ]] && [[ -v NO_STAGING ]]; then + continue + fi + + if [[ $(echo "${file}") == *"_nostaging"* ]] && [[ ! -v NO_STAGING ]]; then + continue + fi + + cp -rf "${file}" wine-patches/ 2>/dev/null + done WINEDIR="${WINEROOT}/wine" WINEDIR_PATCHES="${WINEROOT}/wine-patches" @@ -949,7 +960,7 @@ echo -e "\nWine 64-bit build process finished.\n" # TODO If we do architecture separation in the future, add if check for i386 here # Condition would be: if i386 or amd64, then -# +# # Purge amd64 buildtime dependencies # On Debian, we can't have them with i386 at the same time #