summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2f580cff77c85c4c170fe47ad528bc41b2f01658 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# Maintainer:
# Contributor: Benjamin Landis <bmlandis2010@gmail.com>

_gitname="mpv"
_pkgname="$_gitname-vapoursynth"
pkgname="$_pkgname-git"
pkgver=0.39.0.r436.g744cd70
pkgrel=1
pkgdesc='a free, open source, and cross-platform media player'
url='https://github.com/mpv-player/mpv'
arch=('i686' 'x86_64' 'armv6h' 'armv7h' 'aarch64')
license=('GPL-2.0-or-later')

depends=(
  'libarchive'
  'libcdio-paranoia'
  'libdvdnav'
  'libxkbcommon'
  'libxpresent'
  'libxrandr'
  'libxss'
  'luajit'
  'mujs'
  'rubberband'
  'uchardet'
  'vapoursynth'

  # ffmpeg
  'libavcodec.so'
  'libavdevice.so'
  'libavfilter.so'
  'libavformat.so'
  'libavutil.so'

  # libplacebo
  'libplacebo.so'

  ## implicit
  #alsa-lib
  #bash
  #gcc-libs
  #glibc
  #hicolor-icon-theme
  #lcms2
  #libass
  #libbluray
  #libcdio
  #libdrm
  #libglvnd
  #libjpeg-turbo
  #libpipewire
  #libpulse
  #libva
  #libvdpau
  #libx11
  #libxext
  #libxv
  #mesa
  #pipewire-jack
  #vulkan-icd-loader
  #wayland
  #zimg
  #zlib
)
makedepends=(
  'ffnvcodec-headers'
  'git'
  'ladspa'
  'meson'
  'python-docutils'
  'vulkan-headers'
  'wayland-protocols'
)

provides=("mpv=1:${pkgver%%.r*}")
conflicts=('mpv')

options=('!emptydirs')
validpgpkeys=('145077D82501AA20152CACCE8D769208D5E31419') # sfan5 <sfan5@live.de>

_pkgsrc="$_gitname"
source=("$_pkgsrc"::"git+$url.git")
sha256sums=('SKIP')

pkgver() {
  cd "$_pkgsrc"
  git describe --long --tags --abbrev=7 --exclude='*[a-zA-Z][a-zA-Z]*' \
    | sed -E 's/^v//;s/([^-]*-g)/r\1/;s/-/./g'
}

build() {
  local _meson_options=(
    --auto-features auto

    -Dlibmpv=true

    -Dcaca=disabled
    -Dcdda=enabled
    -Ddvbin=enabled
    -Ddvdnav=enabled
    -Dlibarchive=enabled

    -Dbuild-date=false
    -Dvapoursynth=enabled
  )

  arch-meson "$_pkgsrc" build "${_meson_options[@]}"

  meson compile -C build
}

check() {
  meson test -C build || true
}

package() {
  provides+=('libmpv.so')

  meson install -C build --destdir "${pkgdir:?}"

  # delete private entries only required for static linking
  sed -i -e '/Requires.private/d' -e '/Libs.private/d' "${pkgdir:?}/usr/lib/pkgconfig/mpv.pc"

  install -Dm0644 "$_pkgsrc/DOCS"/{encoding.rst,tech-overview.txt} \
    -t "${pkgdir:?}/usr/share/doc/mpv"

  install -Dm0644 "$_pkgsrc/TOOLS/lua"/* \
    -t "${pkgdir:?}/usr/share/mpv/scripts"
}