Skip to content

Instantly share code, notes, and snippets.

@artynet
Created March 10, 2018 00:57
Show Gist options
  • Save artynet/f59603c450ec3dd85b2f8dbed4450432 to your computer and use it in GitHub Desktop.
Save artynet/f59603c450ec3dd85b2f8dbed4450432 to your computer and use it in GitHub Desktop.
easy script to cross-build mpv
#!/bin/bash -x
# Add MXE binaries to $PATH
export PATH=${HOME}/MPVCROSS/mxe-trunk/usr/bin:${PATH}
# creating folder where storing archives
WRKDIR=${HOME}/MPVCROSS/mpv_release
mkdir -p ${WRKDIR}
# Build mpv. The target will be used to automatically select the name of the
# build tools involved (e.g. it will use i686-w64-mingw32.static-gcc).
# updating sources
git pull
# getting git short tag
HASH=$(git rev-parse --short HEAD | cut -c1-7)
# checking if mpv has already been built
[ -e ${WRKDIR}/mpv-win64-${HASH}.zip ] && exit 0
python ./bootstrap.py
# cleaning
./waf distclean
# 32 bit version
# DEST_OS=win32 TARGET=i686-w64-mingw32.static ./waf configure
# Or, if 64 bit version
DEST_OS=win32 TARGET=x86_64-w64-mingw32.static ./waf configure
# build mpv
./waf build
# creating the archive
pushd $PWD/build
zip mpv-win64-${HASH}.zip mpv.exe mpv.com
# moving to release dir
mv mpv-win64-${HASH}.zip ${WRKDIR}
popd
# cleaning
./waf distclean
echo "finished !"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment