Skip to content

Instantly share code, notes, and snippets.

@Francesco149
Last active April 4, 2024 22:54
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Francesco149/b46b68aa928f4fda279792554bb4ccaf to your computer and use it in GitHub Desktop.
Save Francesco149/b46b68aa928f4fda279792554bb4ccaf to your computer and use it in GitHub Desktop.
how to build qtwebengine and qutebrowser on windows with proprietary codecs

quick n dirty notes so I don't forget

choco install -y strawberryperl gperf visualcpp-build-tools windows-sdk-10.0

add ATL/MFC on visual studio build tools from the visual studio installer

open a x64 native tools command prompt for vs 2017 (replace qt version in the commands with yours)

cd C:\Qt\5.11.2\Src\qtwebengine
C:\Qt\5.11.2\msvc2017_64\bin\qmake.exe -- -webengine-proprietary-codecs
nmake

if anything goes wrong with qmake delete config.cache in C:\Qt\5.11.2\Src\qtwebengine , fix what you gotta fix and retry. if you don't delete this it will give the same errors over and over from the cache

now install python 3.7.1 https://www.python.org/ftp/python/3.7.1/python-3.7.1-amd64.exe

building sip https://sourceforge.net/projects/pyqt/files/sip/sip-4.19.13/sip-4.19.13.zip

7z x sip-4.19.13.zip
cd sip-4.19.13

python configure.py
nmake
nmake install

C:\Python37\python configure.py --sip-module PyQt5.sip --no-tools
nmake
nmake install

building PyQt5 5.11.3 https://sourceforge.net/projects/pyqt/files/PyQt5/PyQt-5.11.3/PyQt5_gpl-5.11.3.zip

7z x PyQt5_gpl-5.11.3.zip
cd PyQt5_gpl-5.11.3

C:\Python37\python .\configure.py ^
  --qmake C:\Qt\5.11.2\msvc2017_64\bin\qmake.exe ^
  --sip-incdir ..\sip-4.19.13\siplib ^
  --disable QtNfc
nmake
nmake install

install pip https://bootstrap.pypa.io/get-pip.py

C:\Python37\python get-pip.py

install nsis

choco install nsis

add C:\Program Files (x86)\NSIS to PATH

now you can build the qutebrowser installer

git clone https://github.com/qutebrowser/qutebrowser
cd qutebrowser
copy C:\Python37\python.exe C:\Python37\python3.exe
C:\Python37\Scripts\pip install pyinstaller
C:\Qt\5.11.2\msvc2017_64\bin\qtenv2.bat
C:\Python37\Scripts\pyinstaller --clean --noconfirm .\misc\qutebrowser.spec
copy C:\Qt\5.11.2\msvc2017_64\bin\QtWebEngineProcess.exe dist\qutebrowser\PyQt5\Qt\bin
copy C:\Qt\5.11.2\msvc2017_64\bin\QtWebEngineProcess.exe dist\qutebrowser\
copy C:\Qt\5.11.2\msvc2017_64\bin\qt.conf dist\qutebrowser\PyQt5\Qt\bin
rename .\dist\qutebrowser qutebrowser-1.5.2-x64
makensis /DX64 /DVERSION=1.5.2 misc/qutebrowser.nsi

now you can delete the qt sources (especially qtwebengine which will use ~100GB after the build)

in dist/ you will find a folder with the standalone browser and the installer

help is appreciated to fix the workarounds (copying QtWebEngineProcess manually etc)

@tauruswang
Copy link

D:\qt-everywhere-src-5.11.3\qtwebengine>qmake -- -webengine-proprietary-codecs
Project ERROR: You cannot configure qtwebengine separately within a top-level build.

??

@ruverav
Copy link

ruverav commented Jan 22, 2020

I'm stuck here:

C:\Qt\5.14.0\Src\qtwebengine>..\..\msvc2017\_64\bin\qmake.exe -- -webengine-propietary-codecs

ERROR: Unknown command line option '-webengine-propietary-codecs'.

Any idea why does this happen? 🤷‍♂️

Could you at least share your compiled build with the rest of us?

@Francesco149
Copy link
Author

you typo'd proprietary

@ruverav
Copy link

ruverav commented Jan 22, 2020

Thanks, silly me. But still no luck, I have nmake telling me that I haven’t the latest Windows SDK installed when I know it isn’t that way (I even have the path to its binaries inside the PATH environment variable).

I’ll try with Visual Studio 2019 build tools next time in case it has a most recent Windows SDK as an installable package, which (I hope) fits the requirements of the compiler.

@tejasvi
Copy link

tejasvi commented Feb 9, 2020

Does the browser work in a different system after building? I can't understand what is stopping someone to publicaly post builds with codecs baked in just like Chromium.

@Rriggs95
Copy link

Is installing python2.7 a necessary step? Doesn't python 3 have backwards compatibility?

@seyedmmousavi
Copy link

@Rriggs95 yes, it's essential for QtWebEngine module at Qt < 6
Check the web engine requirements and Qt itself for the Windows OS

@Rashmi123Sharma
Copy link

I am unable to rum the command nmake it runs half way and then shows error
ninja: build stopped: subcommand failed.
NMAKE : fatal error U1077: 'call' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\Hostx86\x86\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '(' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment