From 51985e3dd630a5fc212f643781b4a0ca7f590782 Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Sun, 1 Oct 2017 20:34:06 +1100 Subject: DOCS/compile-windows.md: update for changes to mpv and MSYS2 - Don't recommend libdvdnav, since DVD support isn't compiled by default anymore. - Take advantage of the new $MINGW_PACKAGE_PREFIX and $MSYSTEM_PREFIX variables to make the build commands independent from the mingw-w64 build environment being used. - Invoke /usr/bin/python3 directly, since I've heard some packages have started to depend on mingw-w64 versions of Python, but our build scripts only work with the MSYS2 version. - Reword the MSYS2 install instructions to try to prevent common errors. --- DOCS/compile-windows.md | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/DOCS/compile-windows.md b/DOCS/compile-windows.md index 48895f5428..08d4564474 100644 --- a/DOCS/compile-windows.md +++ b/DOCS/compile-windows.md @@ -101,11 +101,14 @@ Installing MSYS2 1. Download an installer from https://msys2.github.io/ - It doesn't matter whether the i686 or the x86_64 version is used. Both can - build 32-bit and 64-bit binaries when running on a 64-bit version of Windows. + Both the i686 and the x86_64 version of MSYS2 can build 32-bit and 64-bit + mpv binaries when running on a 64-bit version of Windows, but the x86_64 + version is preferred since the larger address space makes it less prone to + fork() errors. -2. Start a MinGW-w64 shell (``mingw64.exe``). Note that this is different - from the MSYS2 shell that is started from the final installation dialog. +2. Start a MinGW-w64 shell (``mingw64.exe``). **Note:** This is different from + the MSYS2 shell that is started from the final installation dialog. You must + close that shell and open a new one. For a 32-bit build, use ``mingw32.exe``. @@ -129,42 +132,37 @@ Installing mpv dependencies ```bash # Install MSYS2 build dependencies and a MinGW-w64 compiler -pacman -S git mingw-w64-x86_64-pkg-config python mingw-w64-x86_64-gcc +pacman -S git python $MINGW_PACKAGE_PREFIX-{pkg-config,gcc} -# Install the most important MinGW-w64 dependencies. libass, libbluray and -# lcms2 are also pulled in as dependencies of ffmpeg. -pacman -S mingw-w64-x86_64-ffmpeg mingw-w64-x86_64-libjpeg-turbo mingw-w64-x86_64-lua51 - -# Install additional (optional) dependencies -pacman -S mingw-w64-x86_64-libdvdnav mingw-w64-x86_64-libguess mingw-w64-x86_64-angleproject-git +# Install the most important MinGW-w64 dependencies. libass and lcms2 are also +# pulled in as dependencies of ffmpeg. +pacman -S $MINGW_PACKAGE_PREFIX-{ffmpeg,libjpeg-turbo,lua51,angleproject-git} ``` -For a 32-bit build, install ``mingw-w64-i686-*`` packages instead. - Building mpv ------------ -Clone the latest mpv from git and install waf: +Clone the latest mpv from git and install waf. **Note:** ``/usr/bin/python3`` +is invoked directly here, since an MSYS2 version of Python is required. ```bash git clone https://github.com/mpv-player/mpv.git && cd mpv -./bootstrap.py +/usr/bin/python3 bootstrap.py ``` Finally, compile and install mpv. Binaries will be installed to -``/mingw64/bin``. +``/mingw64/bin`` or ``/mingw32/bin``. ```bash -# For a 32-bit build, use --prefix=/mingw32 instead -./waf configure CC=gcc.exe --check-c-compiler=gcc --prefix=/mingw64 -./waf install +/usr/bin/python3 waf configure CC=gcc.exe --check-c-compiler=gcc --prefix=$MSYSTEM_PREFIX +/usr/bin/python3 waf install ``` Or, compile and install both libmpv and mpv: ```bash -./waf configure CC=gcc.exe --check-c-compiler=gcc --enable-libmpv-shared --prefix=/mingw64 -./waf install +/usr/bin/python3 waf configure CC=gcc.exe --check-c-compiler=gcc --enable-libmpv-shared --prefix=$MSYSTEM_PREFIX +/usr/bin/python3 waf install ``` Linking libmpv with MSVC programs -- cgit v1.2.3