summaryrefslogtreecommitdiff
path: root/px/packages/video.scm
blob: 917d75370e69321c1d562a980fd7693aa39e2c5b (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

(define-module (px packages video)
  #:use-module ((guix licenses)
                #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix gexp)
  #:use-module (guix git-download)
  #:use-module (guix build-system waf)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages cdrom)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages image)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages lua)
  #:use-module (gnu packages mp3)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages video)
  #:use-module (gnu packages vulkan)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xorg))

(define-public mpv-0.34
  (package
    (name "mpv")
    (version "0.34.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/mpv-player/mpv")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "12qxwm1ww5vhjddl8yvj1xa0n1fi9z3lmzwhaiday2v59ca0qgsk"))))
    (build-system waf-build-system)
    (arguments
     (list
      #:phases #~(modify-phases %standard-phases
                   (add-after 'unpack 'patch-file-names
                     (lambda* (#:key inputs #:allow-other-keys)
                       (substitute* "player/lua/ytdl_hook.lua"
                         (("\"yt-dlp\",")
                          (string-append "\""
                                         (search-input-file inputs
                                                            "bin/yt-dlp")
                                         "\",")))))
                   (add-before 'configure 'build-reproducibly
                     (lambda _
                       ;; Somewhere in the build system library dependencies are enumerated
                       ;; and passed as linker flags, but the order in which they are added
                       ;; varies.  See <https://github.com/mpv-player/mpv/issues/7855>.
                       ;; Set PYTHONHASHSEED as a workaround for deterministic results.
                       (setenv "PYTHONHASHSEED" "1")))
                   (add-before 'configure 'set-up-waf
                     (lambda* (#:key inputs #:allow-other-keys)
                       (copy-file (search-input-file inputs "bin/waf") "waf")
                       (setenv "CC"
                               #$(cc-for-target)))))
      #:configure-flags #~(list "--enable-libmpv-shared" "--enable-cdda"
                                "--enable-dvdnav" "--disable-build-date")
      ;; No check function defined.
      #:tests? #f))
    (native-inputs (list perl ;for zsh completion file
                         pkg-config python-docutils))
    ;; Missing features: libguess, V4L2.
    (inputs (list alsa-lib
                  enca
                  ffmpeg-5
                  jack-1
                  ladspa
                  lcms
                  libass
                  libbluray
                  libcaca
                  libbs2b
                  libcdio-paranoia
                  libdvdread
                  libdvdnav
                  libjpeg-turbo
                  libva
                  libvdpau
                  libx11
                  libxext
                  libxkbcommon
                  libxinerama
                  libxrandr
                  libxscrnsaver
                  libxv
                  ;; XXX: lua > 5.2 is not currently supported; see
                  ;; waftools/checks/custom.py
                  lua-5.2
                  mesa
                  mpg123
                  pulseaudio
                  python-waf
                  rsound
                  shaderc
                  vulkan-headers
                  vulkan-loader
                  wayland
                  wayland-protocols
                  yt-dlp
                  zlib))
    (home-page "https://mpv.io/")
    (synopsis "Audio and video player")
    (description
     "MPV is a general-purpose audio and video player.  It is a
fork of mplayer2 and MPlayer.  It shares some features with the former
projects while introducing many more.")
    (license license:gpl2+)))