Skip to content

Commit

Permalink
mpv: Update to 0.8.0
Browse files Browse the repository at this point in the history
This includes a couple of changes to the packaging:

- libjpeg-turbo and libcaca are added as an explicit dependencies.
- Several auto-detected dependencies are explicitly enabled at configure
  time, so configure will return an error if they are not found. The
  official mpv build scripts have also started to do this.
- The man page is now built and installed.
- mpv.com is now installed to the correct directory.
- encoding-profiles.conf is no longer installed to /etc, since mpv
  doesn't load config files from there on MinGW. Instead, it's installed
  next to the example config files in /share/doc/mpv.
- The x86_64 and i686 versions are built in different subdirectories, so
  waf doesn't get confused when building both versions at the same time.
- winpty is used to get key bindings working in mintty.
  • Loading branch information
rossy committed Feb 18, 2015
1 parent 102fa95 commit 6f25049
Showing 1 changed file with 48 additions and 11 deletions.
59 changes: 48 additions & 11 deletions mingw-w64-mpv/PKGBUILD
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Maintainer: Alexey Pavlov <[email protected]>
# Contributor: James Ross-Gowan <[email protected]>

_realname=mpv
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.7.2
pkgver=0.8.0
pkgrel=1
pkgdesc="Video player based on MPlayer/mplayer2 (mingw-w64)"
url="http://mpv.io"
Expand All @@ -16,34 +17,54 @@ depends=("${MINGW_PACKAGE_PREFIX}-ffmpeg"
"${MINGW_PACKAGE_PREFIX}-libguess"
"${MINGW_PACKAGE_PREFIX}-mpg123"
"${MINGW_PACKAGE_PREFIX}-lua"
"${MINGW_PACKAGE_PREFIX}-libdvdnav")
"${MINGW_PACKAGE_PREFIX}-libdvdnav"
"${MINGW_PACKAGE_PREFIX}-libjpeg-turbo"
"${MINGW_PACKAGE_PREFIX}-libcaca"
"winpty-git")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-python3-docutils"
"python"
"perl"
"pkg-config")
source=(https://github.com/mpv-player/${_realname}/archive/v$pkgver.tar.gz)
md5sums=('5081934235bf1d531364f59e5f718024')
md5sums=('b3d02a0db096e77ce38c3946dd631e58')

# strip doesn't work well with the mpv.com wrapper, so strip manually instead
options=(!strip !emptydirs)

prepare() {
cd ${_realname}-${pkgver}
/usr/bin/python3 ./bootstrap.py
[ -x ./waf ] || /usr/bin/python3 ./bootstrap.py
sed -i 's:bin/env python$:bin/env python3:' waf
}

build() {
cd "${srcdir}/${_realname}-${pkgver}"
sed -i 's:bin/env python:bin/env python3:' waf

DEST_OS=win32 \
TARGET=${MINGW_CHOST} \
PKG_CONFIG=/usr/bin/pkg-config \
CC=gcc PERL=/usr/bin/perl \
AR=${MINGW_PREFIX}/bin/ar \
WINDRES=${MINGW_PREFIX}/bin/windres \
RST2MAN=${MINGW_PREFIX}/bin/rst2man3 \
/usr/bin/python3 ./waf configure \
--prefix=${MINGW_PREFIX} \
--check-c-compiler=gcc \
--enable-libmpv-shared \
--disable-client-api-examples
--enable-libguess \
--enable-lua \
--enable-libass \
--enable-libbluray \
--enable-dvdread \
--enable-dvdnav \
--disable-cdda \
--enable-enca \
--enable-mpg123 \
--enable-lcms2 \
--enable-caca \
--enable-jpeg \
--out="${srcdir}/build-${MINGW_CHOST}"

/usr/bin/python3 ./waf build
}
Expand All @@ -53,9 +74,25 @@ package() {
export PYTHON=${MINGW_PREFIX}/bin/python3
/usr/bin/python3 ./waf install --destdir="${pkgdir}"

#rm -rf ${pkgdir}${MINGW_PREFIX}/lib
mv ${pkgdir}${MINGW_PREFIX}/bin ${pkgdir}${MINGW_PREFIX}/lib
mkdir -p ${pkgdir}${MINGW_PREFIX}/bin
mv ${pkgdir}${MINGW_PREFIX}/lib/*.exe ${pkgdir}${MINGW_PREFIX}/bin/
mv ${pkgdir}${MINGW_PREFIX}/lib/*.dll ${pkgdir}${MINGW_PREFIX}/bin/
# For some reason waf installs import libraries to /bin, so move to /lib
mkdir "${pkgdir}${MINGW_PREFIX}/lib"
mv "${pkgdir}${MINGW_PREFIX}/bin/pkgconfig" "${pkgdir}${MINGW_PREFIX}/lib/"
mv "${pkgdir}${MINGW_PREFIX}/bin/"*.a "${pkgdir}${MINGW_PREFIX}/lib/"
sed -i "s:${MINGW_PREFIX}/bin:${MINGW_PREFIX}/lib:" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/mpv.pc"

# Strip binaries manually
${MINGW_PREFIX}/bin/strip "${STRIP_BINARIES}" "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe"
${MINGW_PREFIX}/bin/strip "${STRIP_BINARIES}" "${pkgdir}${MINGW_PREFIX}/bin/mpv.com"
${MINGW_PREFIX}/bin/strip "${STRIP_SHARED}" "${pkgdir}${MINGW_PREFIX}/bin/mpv-1.dll"

# Move encoding-profiles.conf to share/doc alongside the example .conf files.
# mpv doesn't search /etc for configuration on MinGW.
mv "${pkgdir}${MINGW_PREFIX}/etc/mpv/"*.conf "${pkgdir}${MINGW_PREFIX}/share/doc/mpv/"

# mpv needs winpty for key bindings to work on the terminal
mv "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe" "${pkgdir}${MINGW_PREFIX}/bin/mpv_exe"
_exename=mpv
echo '#!/usr/bin/env bash' > "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
echo '/usr/bin/winpty "$( dirname ${BASH_SOURCE[0]} )/'${_exename}'.exe" "$@"' >> "${pkgdir}${MINGW_PREFIX}/bin/${_exename}"
mv "${pkgdir}${MINGW_PREFIX}/bin/mpv_exe" "${pkgdir}${MINGW_PREFIX}/bin/mpv.exe"
}

0 comments on commit 6f25049

Please sign in to comment.