From b78f584264a566b8d5b881649db8585e504b7487 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 4 Sep 2019 07:46:00 +0530 Subject: [PATCH] Add mesa DLL to windows build for machines without OpenGL such as VMs --- bypy/windows.conf | 4 ++++ bypy/windows/__main__.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/bypy/windows.conf b/bypy/windows.conf index e96b1f2486..b41d912d95 100644 --- a/bypy/windows.conf +++ b/bypy/windows.conf @@ -2,9 +2,13 @@ # git.exe must be in PATH. Must have ~100GB available disk space and 8GB RAM # Install certifi in python 3 with: # py.exe -m pip install certifi +# Copy opengl32sw.dll from +# https://download.qt.io/development_releases/prebuilt/llvmpipe/windows/ +# to C:/mesa/32 and C:/mesa/64 vm_name 'calibre-windows-build' root 'C:/r' python 'py.exe' perl 'C:/Strawberry/perl/bin/perl.exe' ruby 'C:/Ruby26-x64/bin/ruby.exe' +mesa 'C:/mesa' diff --git a/bypy/windows/__main__.py b/bypy/windows/__main__.py index 766230ca5d..5a92e87600 100644 --- a/bypy/windows/__main__.py +++ b/bypy/windows/__main__.py @@ -667,6 +667,9 @@ def copy_crt_and_d3d(env): worker_env['WINDOWSSDKDIR'], 'Redist', 'D3D', plat) if not os.path.exists(d3d_path): raise SystemExit('Windows 10 D3D redistributable not found at: %r' % d3d_path) + mesa_path = os.path.join(os.environ['MESA'], ('64' if is64bit else '32'), 'opengl32sw.dll') + if not os.path.exists(mesa_path): + raise SystemExit('Mesa DLLs (opengl32sw.dll) not found at: %r' % mesa_path) def copy_dll(dll): shutil.copy2(dll, env.dll_dir) @@ -675,6 +678,7 @@ def copy_crt_and_d3d(env): for dll in glob.glob(os.path.join(d3d_path, '*.dll')): if os.path.basename(dll).lower().startswith('d3dcompiler_'): copy_dll(dll) + copy_dll(mesa_path) for dll in glob.glob(os.path.join(sdk_path, '*.dll')): copy_dll(dll) for dll in glob.glob(os.path.join(vc_path, '*.dll')):