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.

71 lines
2.1 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. #
  7. # Author: Pekka Helenius (~Fincer), 2018
  8. function do_winecfg_changes {
  9. 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"
  10. WORKDIR=$(pwd)
  11. local URL="source.winehq.org"
  12. PROGRAMS=(git make ping wine patch nproc)
  13. i=0
  14. for program in ${PROGRAMS[@]}; do
  15. if [ $(echo $(which $program &>/dev/null)$?) -ne 0 ]; then
  16. ERRPROGRAMS[$i]=$program
  17. let i++
  18. fi
  19. done
  20. if [ -z ERRPROGRAMS ]; then
  21. echo "Please install the following programs: ${ERRPROGRAMS[*]}"
  22. exit 1
  23. fi
  24. if [[ ! $(ping -c 3 $URL 2>&1 | grep -c "unknown host") -eq 0 ]]; then
  25. echo -e "\nCan't connect to $URL. Please check your internet connection and try again.\n"
  26. exit 1
  27. fi
  28. if [ ! -d a ]; then
  29. echo "Cloning wine into folder 'a'. This step takes a while..."
  30. git clone https://source.winehq.org/git/wine.git a
  31. fi
  32. if [ ! -d wine-staging ]; then
  33. git clone https://github.com/wine-staging/wine-staging.git
  34. fi
  35. wine-staging/patches/patchinstall.sh DESTDIR=${WORKDIR}/a \
  36. -W winecfg-Libraries winecfg-Staging winecfg-Unmounted_Devices
  37. cd a
  38. ./configure
  39. make -j$(nproc --ignore 1)
  40. cd ${WORKDIR}
  41. echo "Cloning compiled wine into folder 'b'"
  42. cp -R a b
  43. cd b/programs/winecfg
  44. make clean
  45. cd ${WORKDIR}/b
  46. patch -Np1 -i ../wine-staging_winecfg.patch
  47. cd ${WORKDIR}
  48. ln -s b/programs/winecfg winecfg_edits
  49. 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"
  50. }
  51. do_winecfg_changes