[PATCH] gnu: mpv-mpris: Fix build.

  • Done
  • quality assurance status badge
Details
4 participants
  • Josselin Poiret
  • Hilton Chain
  • Zheng Junjie
  • ???
Owner
unassigned
Submitted by
Josselin Poiret
Severity
normal
J
J
Josselin Poiret wrote on 26 Dec 2023 17:38
(address . guix-patches@gnu.org)(name . Josselin Poiret)(address . dev@jpoiret.xyz)
3f2f99c174d858a58ce40b875184c46c6f4381f9.1703608723.git.dev@jpoiret.xyz
From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/packages/video.scm (mpv-mpris): Use gnu-build-system again. Include
mpv's required dependencies now that its pkg-config file requires them. Run
tests.

Change-Id: I9de4ade633388ec42ac30019feb133ca98811ad9
---
Hi everyone,

mpv-mpris doesn't build anymore, because mpv's pkg-config file now requires
almost all of its dependencies. I chose to simply add all of mpv's inputs, but
also to revert back to gnu-build-system, while making use of upstream's env vars
to make it as painless as possible. Also, tests were actually not that bad so
we can enable them.

gnu/packages/video.scm | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)

Toggle diff (54 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 6da4897a57..987bc91f4f 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -154,6 +154,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages iso-codes)
+ #:use-module (gnu packages libcanberra)
#:use-module (gnu packages libidn)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
@@ -2511,20 +2512,26 @@ (define-public mpv-mpris
(file-name (git-file-name name version))
(sha256
(base32 "1384y8n3l0xk8hbad1nsj9ljzb1h02g3ln3jysd8bd6shbl0x4mx"))))
- (build-system copy-build-system)
+ (build-system gnu-build-system)
(arguments
- '(#:install-plan
- '(("mpris.so" "lib/"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'install 'build
- (lambda _
- (setenv "CC" (which "gcc"))
- (invoke "make"))))))
+ (list
+ #:make-flags
+ #~(list (string-append "SCRIPTS_DIR=" #$output "/lib")
+ (string-append "CC=" #$(cc-for-target)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda _
+ (setenv "MPV_MPRIS_TEST_PLAY"
+ #$(file-append sound-theme-freedesktop
+ "/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"))
+ (invoke "make" "test"))))))
(native-inputs
- (list pkg-config))
+ (list pkg-config dbus jq playerctl socat xorg-server-for-tests xvfb-run))
(inputs
- (list ffmpeg glib mpv))
+ (modify-inputs (package-inputs mpv)
+ (prepend ffmpeg glib mpv)))
(home-page "https://github.com/hoyon/mpv-mpris")
(synopsis "MPRIS plugin for mpv")
(description "This package provides an @dfn{MPRIS} (Media Player Remote

base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b
--
2.41.0
?
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 68044@debbugs.gnu.org)
AE432B02-517E-46BE-9EC9-426C03BC836D@yandex.com
Toggle quote (58 lines)
> ? 2023?12?27??01:57?Josselin Poiret via Guix-patches via <guix-patches@gnu.org> ???
>
> ?From: Josselin Poiret <dev@jpoiret.xyz>
>
> * gnu/packages/video.scm (mpv-mpris): Use gnu-build-system again. Include
> mpv's required dependencies now that its pkg-config file requires them. Run
> tests.
>
> Change-Id: I9de4ade633388ec42ac30019feb133ca98811ad9
> ---
> Hi everyone,
>
> mpv-mpris doesn't build anymore, because mpv's pkg-config file now requires
> almost all of its dependencies. I chose to simply add all of mpv's inputs, but
> also to revert back to gnu-build-system, while making use of upstream's env vars
> to make it as painless as possible. Also, tests were actually not that bad so
> we can enable them.
>
> gnu/packages/video.scm | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 6da4897a57..987bc91f4f 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -154,6 +154,7 @@ (define-module (gnu packages video)
> #:use-module (gnu packages image)
> #:use-module (gnu packages imagemagick)
> #:use-module (gnu packages iso-codes)
> + #:use-module (gnu packages libcanberra)
> #:use-module (gnu packages libidn)
> #:use-module (gnu packages libusb)
> #:use-module (gnu packages linux)
> @@ -2511,20 +2512,26 @@ (define-public mpv-mpris
> (file-name (git-file-name name version))
> (sha256
> (base32 "1384y8n3l0xk8hbad1nsj9ljzb1h02g3ln3jysd8bd6shbl0x4mx"))))
> - (build-system copy-build-system)
> + (build-system gnu-build-system)
> (arguments
> - '(#:install-plan
> - '(("mpris.so" "lib/"))
> - #:phases
> - (modify-phases %standard-phases
> - (add-before 'install 'build
> - (lambda _
> - (setenv "CC" (which "gcc"))
> - (invoke "make"))))))
> + (list
> + #:make-flags
> + #~(list (string-append "SCRIPTS_DIR=" #$output "/lib")
> + (string-append "CC=" #$(cc-for-target)))
> + #:phases
> + #~(modify-phases %standard-phases
> + (delete 'configure)
> + (replace 'check


Please care “tests?”

Like

(if tests?
(do-test)
(format #t "test suite not run~%"))

Toggle quote (23 lines)
> + (lambda _
> + (setenv "MPV_MPRIS_TEST_PLAY"
> + #$(file-append sound-theme-freedesktop
> + "/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"))
> + (invoke "make" "test"))))))
> (native-inputs
> - (list pkg-config))
> + (list pkg-config dbus jq playerctl socat xorg-server-for-tests xvfb-run))
> (inputs
> - (list ffmpeg glib mpv))
> + (modify-inputs (package-inputs mpv)
> + (prepend ffmpeg glib mpv)))
> (home-page "https://github.com/hoyon/mpv-mpris")
> (synopsis "MPRIS plugin for mpv")
> (description "This package provides an @dfn{MPRIS} (Media Player Remote
>
> base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b
> --
> 2.41.0
>
>
>
>
Z
Z
Zheng Junjie wrote on 26 Dec 2023 19:33
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 68044@debbugs.gnu.org)
87frzo4xvb.fsf@iscas.ac.cn
Josselin Poiret via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (59 lines)
> From: Josselin Poiret <dev@jpoiret.xyz>
>
> * gnu/packages/video.scm (mpv-mpris): Use gnu-build-system again. Include
> mpv's required dependencies now that its pkg-config file requires them. Run
> tests.
>
> Change-Id: I9de4ade633388ec42ac30019feb133ca98811ad9
> ---
> Hi everyone,
>
> mpv-mpris doesn't build anymore, because mpv's pkg-config file now requires
> almost all of its dependencies. I chose to simply add all of mpv's inputs, but
> also to revert back to gnu-build-system, while making use of upstream's env vars
> to make it as painless as possible. Also, tests were actually not that bad so
> we can enable them.
>
> gnu/packages/video.scm | 29 ++++++++++++++++++-----------
> 1 file changed, 18 insertions(+), 11 deletions(-)
>
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index 6da4897a57..987bc91f4f 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -154,6 +154,7 @@ (define-module (gnu packages video)
> #:use-module (gnu packages image)
> #:use-module (gnu packages imagemagick)
> #:use-module (gnu packages iso-codes)
> + #:use-module (gnu packages libcanberra)
> #:use-module (gnu packages libidn)
> #:use-module (gnu packages libusb)
> #:use-module (gnu packages linux)
> @@ -2511,20 +2512,26 @@ (define-public mpv-mpris
> (file-name (git-file-name name version))
> (sha256
> (base32 "1384y8n3l0xk8hbad1nsj9ljzb1h02g3ln3jysd8bd6shbl0x4mx"))))
> - (build-system copy-build-system)
> + (build-system gnu-build-system)
> (arguments
> - '(#:install-plan
> - '(("mpris.so" "lib/"))
> - #:phases
> - (modify-phases %standard-phases
> - (add-before 'install 'build
> - (lambda _
> - (setenv "CC" (which "gcc"))
> - (invoke "make"))))))
> + (list
> + #:make-flags
> + #~(list (string-append "SCRIPTS_DIR=" #$output "/lib")
> + (string-append "CC=" #$(cc-for-target)))
> + #:phases
> + #~(modify-phases %standard-phases
> + (delete 'configure)
> + (replace 'check
> + (lambda _
> + (setenv "MPV_MPRIS_TEST_PLAY"
> + #$(file-append sound-theme-freedesktop
> + "/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"))

And don't use file-append here, should add `sound-theme-freedesktop' to
native-inputs and use `search-input-file' to find this file.

Toggle quote (13 lines)
> + (invoke "make" "test"))))))
> (native-inputs
> - (list pkg-config))
> + (list pkg-config dbus jq playerctl socat xorg-server-for-tests xvfb-run))
> (inputs
> - (list ffmpeg glib mpv))
> + (modify-inputs (package-inputs mpv)
> + (prepend ffmpeg glib mpv)))
> (home-page "https://github.com/hoyon/mpv-mpris")
> (synopsis "MPRIS plugin for mpv")
> (description "This package provides an @dfn{MPRIS} (Media Player Remote
>
> base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b
J
J
Josselin Poiret wrote on 27 Dec 2023 11:15
[PATCH v2] gnu: mpv-mpris: Fix build.
(address . 68044@debbugs.gnu.org)
82c9f77bd248c517cd059c956e8019426b0bd3e6.1703672122.git.dev@jpoiret.xyz
From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/packages/video.scm (mpv-mpris): Use gnu-build-system again. Include
mpv's required dependencies now that its pkg-config file requires them. Run
tests.

Change-Id: I9de4ade633388ec42ac30019feb133ca98811ad9
---

Hi Zheng,

Thanks for the speedy review! Good catches, seems I've been slacking off too
much… Here is an updated patch.

Best,

gnu/packages/video.scm | 41 ++++++++++++++++++++++++++++++-----------
1 file changed, 30 insertions(+), 11 deletions(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 6da4897a57..25004155f0 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -154,6 +154,7 @@ (define-module (gnu packages video)
#:use-module (gnu packages image)
#:use-module (gnu packages imagemagick)
#:use-module (gnu packages iso-codes)
+ #:use-module (gnu packages libcanberra)
#:use-module (gnu packages libidn)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
@@ -2511,20 +2512,38 @@ (define-public mpv-mpris
(file-name (git-file-name name version))
(sha256
(base32 "1384y8n3l0xk8hbad1nsj9ljzb1h02g3ln3jysd8bd6shbl0x4mx"))))
- (build-system copy-build-system)
+ (build-system gnu-build-system)
(arguments
- '(#:install-plan
- '(("mpris.so" "lib/"))
- #:phases
- (modify-phases %standard-phases
- (add-before 'install 'build
- (lambda _
- (setenv "CC" (which "gcc"))
- (invoke "make"))))))
+ (list
+ #:make-flags
+ #~(list (string-append "SCRIPTS_DIR=" #$output "/lib")
+ (string-append "CC=" #$(cc-for-target)))
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'check
+ (lambda* (#:key inputs native-inputs tests? #:allow-other-keys)
+ (if tests?
+ (begin
+ (setenv
+ "MPV_MPRIS_TEST_PLAY"
+ (search-input-file
+ (or native-inputs inputs)
+ "/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"))
+ (invoke "make" "test"))
+ (format #t "test suite not run~%")))))))
(native-inputs
- (list pkg-config))
+ (list pkg-config
+ dbus
+ jq
+ playerctl
+ socat
+ sound-theme-freedesktop
+ xorg-server-for-tests
+ xvfb-run))
(inputs
- (list ffmpeg glib mpv))
+ (modify-inputs (package-inputs mpv)
+ (prepend ffmpeg glib mpv)))
(home-page "https://github.com/hoyon/mpv-mpris")
(synopsis "MPRIS plugin for mpv")
(description "This package provides an @dfn{MPRIS} (Media Player Remote

base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b
--
2.41.0
H
H
Hilton Chain wrote on 5 Jan 06:09 +0100
Re: bug#67814: [PATCH 0/3] gnu: mpv: Update to 0.37.0.
(name . Andrew Tropin)(address . andrew@trop.in)
87sf3c5ptu.wl-hako@ultrarare.space
Hi,

On Mon, 25 Dec 2023 19:33:41 +0800,
Andrew Tropin wrote:
Toggle quote (6 lines)
>
> Hi Hilton!
>
> It seem the mpv update breaks mpv-mpris build. I didn't dive into
> issue yet, only tried to revert this patch.

It's because mpv's pkgconfig file (for libmpv) now includes all its
dependencies in Requires.private. Sorry that I didn't check all the
dependent packages.

Josselin has sent bug#68044, which adds mpv's inputs to mpv-mpris.

However there're actually other packages depend on libmpv, so I think
the proper fix is to split libmpv from the mpv package and propagate
inputs in a new package (as mpv users are likely to include mpv in
their profiles, thus these propagated inputs are usually unwanted).

I tried to add a "lib" output for mpv first but there would be cycles.
As a result, I disabled libmpv in mpv, added a libmpv package which
inherits from mpv, and sent it to bug#68250.

Thanks
H
H
Hilton Chain wrote on 1 Feb 07:30 +0100
Re: [bug#68044] [PATCH v2] gnu: mpv-mpris: Fix build.
(name . Josselin Poiret)(address . dev@jpoiret.xyz)
87jzno4ry7.wl-hako@ultrarare.space
Hi Josselin,

On Wed, 27 Dec 2023 18:15:22 +0800,
Josselin Poiret via Guix-patches via wrote:
Toggle quote (10 lines)
>
> From: Josselin Poiret <dev@jpoiret.xyz>
>
> * gnu/packages/video.scm (mpv-mpris): Use gnu-build-system again. Include
> mpv's required dependencies now that its pkg-config file requires them. Run
> tests.
>
> Change-Id: I9de4ade633388ec42ac30019feb133ca98811ad9
> ---

I have applied the build system switching part as ee20e6fa2ee7, thanks!
Closed
?