From 56faaf140059d0f9a4b972d888cd2577607a01e5 Mon Sep 17 00:00:00 2001 From: GXTX Date: Mon, 28 Jan 2019 00:28:53 -0500 Subject: [PATCH] build.sh: Use Python 3.x for Windows --- build.sh | 4 ++-- get_deps.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index a84b2618ec..da2253997d 100755 --- a/build.sh +++ b/build.sh @@ -7,7 +7,7 @@ package_windows() { # Script to prepare the windows exe mkdir -p dist cp i386-softmmu/qemu-system-i386.exe dist/xqemu.exe cp i386-softmmu/qemu-system-i386w.exe dist/xqemuw.exe - python2 ./get_deps.py dist/xqemu.exe dist + python3 ./get_deps.py dist/xqemu.exe dist strip dist/xqemu.exe strip dist/xqemuw.exe } @@ -52,7 +52,7 @@ case "$(uname -s)" in # adjust compilation option based on platform CYGWIN*|MINGW*|MSYS*) echo 'Compiling for Windows…' sys_cflags='-Wno-error' - sys_opts='--python=python2 --disable-cocoa --disable-opengl' + sys_opts='--python=python3 --disable-cocoa --disable-opengl' postbuild='package_windows' # set the above function to be called after build ;; *) diff --git a/get_deps.py b/get_deps.py index 0fcd01abea..bd37b10db9 100755 --- a/get_deps.py +++ b/get_deps.py @@ -22,7 +22,7 @@ def main(): elif not os.path.isdir(args.dest): print('File exists with destination name') sys.exit(1) - + try: subprocess.check_output(['cygpath', '--help']) except OSError as err: @@ -30,7 +30,7 @@ def main(): print("Make sure you're using a recent version of MSYS2 and that it works correctly.") sys.exit(1) - sout = subprocess.check_output(['ldd', args.prog]) + sout = subprocess.check_output(['ldd', args.prog]).decode('utf-8') for line in sout.splitlines(): line = line.strip().split() dll_name, dll_path, dll_load_addr = line[0], line[2], line[3] @@ -39,7 +39,7 @@ def main(): continue # ldd on msys gives Unix-style paths, but mingw Python wants them Windows-style # Use cygpath to convert the paths, because both mingw and msys Python can handle them - dll_path = subprocess.check_output(['cygpath', '-w', dll_path]).strip() + dll_path = subprocess.check_output(['cygpath', '-w', dll_path]).decode('utf-8').strip() if dll_path.lower().startswith('c:\\windows'): print('Skipping system DLL %s' % dll_path) continue