Add features to Wine configuration window (winecfg)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.0 KiB

  1. #!/bin/bash
  2. # Configure test environment for Wine Configuration dialog (winecfg) test runs
  3. #
  4. # Wine must be installed.
  5. # Wine-Staging recommended (and required by the original patch file).
  6. function do_winecfg_changes {
  7. echo -e "**This script is meant to be executed only once just for setting up initial winecfg development environment**\n**You need to run it only once**\n"
  8. WORKDIR=$(pwd)
  9. local URL="source.winehq.org"
  10. PROGRAMS=(git make ping wine patch nproc)
  11. i=0
  12. for program in ${PROGRAMS[@]}; do
  13. if [ $(echo $(which $program &>/dev/null)$?) -ne 0 ]; then
  14. ERRPROGRAMS[$i]=$program
  15. let i++
  16. fi
  17. done
  18. if [ -z ERRPROGRAMS ]; then
  19. echo "Please install the following programs: ${ERRPROGRAMS[*]}"
  20. exit 1
  21. fi
  22. if [[ ! $(ping -c 3 $URL 2>&1 | grep -c "unknown host") -eq 0 ]]; then
  23. echo -e "\nCan't connect to $URL. Please check your internet connection and try again.\n"
  24. exit 1
  25. fi
  26. if [ ! -d a ]; then
  27. echo "Cloning wine into folder 'a'. This step takes a while..."
  28. git clone https://source.winehq.org/git/wine.git a
  29. fi
  30. if [ ! -d wine-staging ]; then
  31. git clone https://github.com/wine-staging/wine-staging.git
  32. fi
  33. wine-staging/patches/patchinstall.sh DESTDIR=${WORKDIR}/a \
  34. -W winecfg-Libraries winecfg-Staging winecfg-Unmounted_Devices
  35. cd a
  36. ./configure
  37. make -j$(nproc --ignore 1)
  38. cd ${WORKDIR}
  39. echo "Cloning compiled wine into folder 'b'"
  40. cp -R a b
  41. cd b/programs/winecfg
  42. make clean
  43. cd ${WORKDIR}/b
  44. patch -Np1 -i ../wine-staging_winecfg.patch
  45. cd ${WORKDIR}
  46. ln -s b/programs/winecfg winecfg_edits
  47. echo -e "\nWine source files are ready. You can find winecfg C source files in 'winecfg_edits' directory.\nChange the source code as you like and then execute '2-run-winecfg.sh' shell script.\nYou don't need to run this script anymore unless main winecfg program is updated by Wine developers.\n"
  48. }
  49. do_winecfg_changes