summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sequeira2015-06-09 00:48:06 -0400
committerPhilip Sequeira2015-06-09 00:48:06 -0400
commit3802573710dc1774265148ae86714973fe72ecc4 (patch)
tree1a85bfbedc9d4e39daac6883adc57f5e946c9f93
downloadaur-3802573710dc1774265148ae86714973fe72ecc4.tar.gz
inital import
-rw-r--r--.SRCINFO28
-rw-r--r--PKGBUILD81
-rwxr-xr-xfind-deps.py49
-rw-r--r--mpv.install12
4 files changed, 170 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..467dbf98ea40
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,28 @@
+pkgbase = mpv-git
+ pkgdesc = Video player based on MPlayer/mplayer2 (git version)
+ pkgver = 0.8.3_135_g9b5a724
+ pkgrel = 1
+ url = http://mpv.io
+ install = mpv.install
+ arch = i686
+ arch = x86_64
+ license = GPL
+ makedepends = git
+ makedepends = python-docutils
+ depends = ffmpeg
+ depends = desktop-file-utils
+ depends = hicolor-icon-theme
+ depends = xdg-utils
+ optdepends = youtube-dl: for --ytdl
+ provides = mpv
+ conflicts = mpv
+ options = !emptydirs
+ source = git+https://github.com/mpv-player/mpv
+ source = find-deps.py
+ md5sums = SKIP
+ md5sums = ddbaa32dbb359220e9f62b925152c015
+ sha256sums = SKIP
+ sha256sums = 9b0a338b4621c5d0d101009b0195a801e8e773811ec3a47dbf1cc339e9f16e99
+
+pkgname = mpv-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..51daa1bec86b
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,81 @@
+# Maintainer: Philip Sequeira <phsequei@gmail.com>
+# Contributor: Rudolf Polzer <divVerent@xonotic.org>
+# Contributor: Bartłomiej Piotrowski <nospam@bpiotrowski.pl>
+# Contributor: Eivind Uggedal <eivind@uggedal.com>
+
+# WARNING: The configure script will automatically enable any optional
+# features it finds support for on your system. If you want to avoid
+# linking against something you have installed, you'll have to disable
+# it in the configure below. The package() script will attempt to
+# update the dependencies based on dynamic libraries when packaging,
+# but this is currently experimental.
+
+pkgname=mpv-git
+_gitname=mpv
+pkgver=0.8.3_135_g9b5a724
+pkgrel=1
+pkgdesc='Video player based on MPlayer/mplayer2 (git version)'
+arch=('i686' 'x86_64')
+license=('GPL')
+url='http://mpv.io'
+_undetected_depends=('desktop-file-utils' 'hicolor-icon-theme' 'xdg-utils')
+depends=('ffmpeg' "${_undetected_depends[@]}")
+# depends that used to be default (a long time ago, probably out of date):
+# 'lcms2' 'libcdio-paranoia' 'libdvdnav' 'libguess' 'libxinerama'
+# 'libxrandr' 'libxss' 'libxv' 'lirc-utils' 'lua' 'mpg123' 'smbclient'
+# 'wayland' 'libxkbcommon' # Note: libxkbcommon is only needed for wayland.
+optdepends=('youtube-dl: for --ytdl')
+makedepends=('git' 'python-docutils')
+# makedepends that used to be default: 'mesa' 'ladspa'
+provides=('mpv')
+conflicts=('mpv')
+options=('!emptydirs')
+install=mpv.install
+source=('git+https://github.com/mpv-player/mpv'
+ 'find-deps.py')
+md5sums=('SKIP'
+ 'ddbaa32dbb359220e9f62b925152c015')
+sha256sums=('SKIP'
+ '9b0a338b4621c5d0d101009b0195a801e8e773811ec3a47dbf1cc339e9f16e99')
+
+pkgver() {
+ cd "$srcdir/$_gitname"
+ _curtag="$(git rev-list --tags --max-count=1)"
+ _tagver="$(git describe --tags $_curtag | sed -e 's:^v::' -e 's:-:_:g')"
+ _commits="$(git rev-list --count HEAD --since=$_tagver)"
+ _sha="$(git rev-parse --short HEAD)"
+ printf "%s_%s_g%s" $_tagver $_commits $_sha
+}
+
+prepare() {
+ cd "$srcdir/$_gitname"
+ ./bootstrap.py
+}
+
+build() {
+ cd "$srcdir/$_gitname"
+
+ CFLAGS="$CFLAGS -I/usr/include/samba-4.0"
+
+ ./waf configure --prefix=/usr \
+ --confdir=/etc/mpv \
+ --enable-zsh-comp \
+ --enable-libmpv-shared
+
+ ./waf build
+}
+
+package() {
+ cd "$srcdir/$_gitname"
+ ./waf install --destdir="$pkgdir"
+
+ install -d "$pkgdir"/usr/share/doc/mpv/examples
+ install -m644 etc/{input,example}.conf \
+ "$pkgdir"/usr/share/doc/mpv/examples
+ install -m644 DOCS/{encoding.rst,tech-overview.txt} \
+ "$pkgdir"/usr/share/doc/mpv
+
+ # Update dependencies automatically (experimental!)
+ depends=("${_undetected_depends[@]}"
+ $("$srcdir"/find-deps.py "$pkgdir"/usr/{bin/mpv,lib/libmpv.so}))
+}
diff --git a/find-deps.py b/find-deps.py
new file mode 100755
index 000000000000..809bdf9d35f8
--- /dev/null
+++ b/find-deps.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python3
+
+"""
+Usage: find-deps.py <binary> [<binary> ...]
+
+Finds (pacman/ALPM) dependencies for a binary or set of binaries based
+on dynamically linked libraries.
+
+"""
+
+import sys
+import subprocess
+import re
+
+def subprocess_get_lines(args, fail_okay=False):
+ try:
+ output = subprocess.check_output(args)
+ except subprocess.CalledProcessError as e:
+ if fail_okay:
+ output = e.output
+ else:
+ raise
+ return output.decode().splitlines()
+
+# Get the filenames of the libs we need
+ldd_output = subprocess_get_lines(['ldd'] + sys.argv[1:])
+regex = re.compile(r' => (.*) \(0x[0-9a-f]+\)$')
+libs = set(match.group(1) for match in map(regex.search, ldd_output) if match)
+
+# Figure out which packages own them
+deps = set(subprocess_get_lines(
+ ['pacman', '--query', '--owns', '--quiet'] + list(libs),
+ fail_okay=True
+))
+
+# fakeroot will be linked when building with makepkg, but isn't really needed
+deps.discard('fakeroot')
+
+# Remove redundant dependencies
+needed = set(deps)
+for pkg in deps:
+ if pkg not in needed:
+ continue # this subtree has already been pruned
+ redundant = subprocess_get_lines(
+ ['pactree', '--unique', pkg]
+ )[1:] # first line is pkg itself
+ needed.difference_update(redundant)
+
+print(' '.join(sorted(needed)))
diff --git a/mpv.install b/mpv.install
new file mode 100644
index 000000000000..5c501dc49916
--- /dev/null
+++ b/mpv.install
@@ -0,0 +1,12 @@
+post_install() {
+ xdg-icon-resource forceupdate --theme hicolor &> /dev/null
+ update-desktop-database -q
+}
+
+post_upgrade() {
+ post_install
+}
+
+post_remove() {
+ post_install
+}