******************************************************************************
***            Cross-compiling Avidemux on Linux for Windows               ***
***                                                                        ***
***          Description of the default build environment setup            ***
******************************************************************************


1. Install MXE (M cross environment) build dependencies as described in

    http://mxe.cc/#requirements

for your respective Linux distribution. For Fedora, at the time of writing,
this list doesn't mention the developer package for pcre (pcre-devel), needed
for a successful build of glib in MXE, see https://github.com/mxe/mxe/issues/2875
for the same omission fixed for Debian and its derivatives.

Once dependencies have been installed, run the script mxe-setup.sh from
a directory *outside of Avidemux top source directory*. This script will

  a) clone MXE git repository;

  b) create a source tarball of the latest x264 off the stable branch from
  the videolan.org x264 git mirror, generate and apply a patch for MXE;

  c) patch MXE to use more recent versions of the following codecs:
        fdk-aac: 2.0.0 --> 2.0.3
        libvpx:  1.8.2 --> 1.14.1
        opus:    1.3.1 --> 1.5.2
        x265:    2.4   --> 4.1

  d) build the 64-bit MXE target (the 32-bit target is currently untested);

  e) clone libaom git repository from googlesource.com, build and install
  the library in both MXE targets;

  d) install the sdk/11.1 branch of nv-codec-headers from the mirror at GitHub
  in the 64-bit MXE target only.

The absolute path to the "mxe" directory created during this step is referenced
below as ${MXE_ROOT}.

An example for the case that Avidemux source was cloned as ~/avidemux2:

    cd ~ && mkdir cross-build && cd cross-build && bash ../avidemux2/mxe/mxe-setup.sh --last-good

Omitting "--last-good" option will result in the latest git master of MXE
rather than the last known good revision being used, which can work, but is
untested as a rule.

##############################################################################

2. Enter the Avidemux top source directory and run

    bash bootStrapCrossMingwQt5_mxe.sh --mxe-root=${MXE_ROOT}

to cross-compile a 64-bit Avidemux version. If 32-bit MXE target has been
built, run

    bash bootStrapCrossMingwQt5_mxe.sh --mxe-root=${MXE_ROOT} --32

to cross-compile a 32-bit version. Run

    bash bootStrapCrossMingwQt5_mxe.sh -h

to see the list of all available options. It is assumed that 'zip' utility is
installed and in $PATH. Copy the 'avidemux_rYYMMDD-hhmmss_win{32,64}Qt5.zip'
file from the 'packaged_mingw_build_YYMMDD-hhmmss' directory to a Windows
partition, extract it on Windows and run 'avidemux.exe' from there.

##############################################################################

3. Issues:

Build of the mesa package in MXE was observed failing with python3 >= 3.8.
As a workaround, make sure that python2 is installed and unversioned python
command points to python2. See https://bugs.python.org/issue40350
The issue seems to be resolved at least in Fedora 40 (python3 >= 3.12.4) as
host Linux distribution.

As of this writing, twolame, aften, vapoursynth and avsproxy are not available.

2025-03-23
