unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#68250] [PATCH] gnu: Add libmpv.
@ 2024-01-05  5:06 Hilton Chain via Guix-patches via
  2024-01-06  4:23 ` [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file Hilton Chain via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-01-05  5:06 UTC (permalink / raw)
  To: 68250
  Cc: Hilton Chain, Lars-Dominik Braun, Marius Bakke, Munyoki Kilyungi,
	jgart

* gnu/packages/video.scm (libmpv): New variable.
(mpv)[arguments]<#:configure-flags>: Remove libmpv library.
(celluloid,mpv-mpris)[inputs]: Replace mpv with libmpv.
* gnu/packages/kde-plasma.scm (plasmatube)[inputs]: Likewise.
* gnu/packages/python-xyz.scm (python-mpv)[inputs]: Likewise.

Change-Id: I7c0a808f9d54f9bfd98b3d2632316c7d58b67896
---
 gnu/packages/kde-plasma.scm |  2 +-
 gnu/packages/python-xyz.scm |  2 +-
 gnu/packages/video.scm      | 24 ++++++++++++++++++++----
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/kde-plasma.scm b/gnu/packages/kde-plasma.scm
index 331ab28cd1..0527fa136a 100644
--- a/gnu/packages/kde-plasma.scm
+++ b/gnu/packages/kde-plasma.scm
@@ -1611,12 +1611,12 @@ (define-public plasmatube
      (list kconfig
            kirigami
            ki18n
+           libmpv
            qtbase-5
            qtdeclarative-5
            qtmultimedia-5
            qtquickcontrols2-5
            qtsvg-5
-           mpv
            youtube-dl))
     (home-page "https://apps.kde.org/plasmatube/")
     (synopsis "Kirigami YouTube video player")
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2afce6c667..b23eaaadfc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -33948,7 +33948,7 @@ (define-public python-mpv
                    (setenv "HOME" (getcwd)))))))
     (native-inputs
      (list python-xvfbwrapper)) ; needed for tests only
-    (inputs (list mpv))
+    (inputs (list libmpv))
     (propagated-inputs (list python-pillow)) ; for raw screenshots
     (home-page "https://github.com/jaseg/python-mpv")
     (synopsis "Python interface to the mpv media player")
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 6da4897a57..b532181225 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -867,7 +867,7 @@ (define-public celluloid
       pkg-config
       python-wrapper))             ; for generate-authors.py
     (inputs
-     (list gtk libadwaita libepoxy mpv))
+     (list gtk libadwaita libepoxy libmpv))
     (home-page "https://github.com/celluloid-player/celluloid")
     (synopsis "GTK+ frontend for the mpv media player")
     (description "Celluloid is a simple GTK+ frontend for the mpv media player.
@@ -2367,8 +2367,7 @@ (define-public mpv
               ;; Set PYTHONHASHSEED as a workaround for deterministic results.
               (setenv "PYTHONHASHSEED" "1"))))
       #:configure-flags
-      #~(list "-Dlibmpv=true"
-              "-Dcdda=enabled"
+      #~(list "-Dcdda=enabled"
               "-Ddvdnav=enabled"
               "-Dbuild-date=false")))
     (native-inputs
@@ -2422,6 +2421,23 @@ (define-public mpv
 projects while introducing many more.")
     (license license:gpl2+)))
 
+(define-public libmpv
+  (package
+    (inherit mpv)
+    (name "libmpv")
+    (arguments
+     (substitute-keyword-arguments (package-arguments mpv)
+       ((#:configure-flags flags ''())
+        #~(cons* "-Dcplayer=false"
+                 "-Dlibmpv=true"
+                 #$flags))))
+    (native-inputs
+     (modify-inputs (package-native-inputs mpv)
+       (delete "perl" "python-docutils")))
+    (propagated-inputs (package-inputs mpv))
+    (inputs '())
+    (synopsis "mpv media player client library")))
+
 (define-public smplayer
   (package
     (name "smplayer")
@@ -2524,7 +2540,7 @@ (define-public mpv-mpris
     (native-inputs
      (list pkg-config))
     (inputs
-     (list ffmpeg glib mpv))
+     (list ffmpeg glib libmpv))
     (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: be1d05c10766a979dd0720b677889ed950d3b895
-- 
2.41.0





^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-01-05  5:06 [bug#68250] [PATCH] gnu: Add libmpv Hilton Chain via Guix-patches via
@ 2024-01-06  4:23 ` Hilton Chain via Guix-patches via
  2024-01-10 18:24   ` Josselin Poiret via Guix-patches via
  2024-01-19  2:05   ` Maxim Cournoyer
  0 siblings, 2 replies; 9+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-01-06  4:23 UTC (permalink / raw)
  To: 68250
  Cc: Hilton Chain, 宋文武, Hilton Chain,
	宋文武, Lars-Dominik Braun, Marius Bakke,
	Munyoki Kilyungi, jgart, Andrew Tropin, Josselin Poiret,
	Zheng Junjie

This is a follow-up to ce7b2b57aa6da0ceace94ea5fb42392c7ff97d53.

* gnu/packages/video.scm (mpv)[arguments]<#:phases>: Add 'fix-mpv.pc.

Suggested-by: 宋文武 <iyzsong@member.fsf.org>
Change-Id: I9826d5d6c957ca3022fa326aee111edb533f05bc
---
 gnu/packages/video.scm | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index e70aa5352e..10d46db38b 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -2365,7 +2365,13 @@ (define-public mpv
               ;; 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"))))
+              (setenv "PYTHONHASHSEED" "1")))
+          ;; mpv.pc is generated by meson.  libmpv's headers don't actually
+          ;; require these dependencies so it's safe to remove these two fields.
+          (add-after 'install 'fix-mpv.pc
+            (lambda _
+              (substitute* (string-append #$output "/lib/pkgconfig/mpv.pc")
+                (("^(Requires|Libs)\\.private:.*") "")))))
       #:configure-flags
       #~(list "-Dlibmpv=true"
               "-Dcdda=enabled"

base-commit: c0e21e523d93081153a2ffc91e5a9f06afe62b91
--
2.41.0




^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-01-06  4:23 ` [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file Hilton Chain via Guix-patches via
@ 2024-01-10 18:24   ` Josselin Poiret via Guix-patches via
  2024-01-13  6:48     ` Hilton Chain via Guix-patches via
  2024-01-19  2:05   ` Maxim Cournoyer
  1 sibling, 1 reply; 9+ messages in thread
From: Josselin Poiret via Guix-patches via @ 2024-01-10 18:24 UTC (permalink / raw)
  To: Hilton Chain, 68250
  Cc: 宋文武, Munyoki Kilyungi, Zheng Junjie,
	Lars-Dominik Braun, Andrew Tropin, Hilton Chain, jgart,
	Marius Bakke

[-- Attachment #1: Type: text/plain, Size: 314 bytes --]

Hi Hilton,

Hilton Chain <hako@ultrarare.space> writes:

> This is a follow-up to ce7b2b57aa6da0ceace94ea5fb42392c7ff97d53.
>
> * gnu/packages/video.scm (mpv)[arguments]<#:phases>: Add 'fix-mpv.pc.

Does this completely replace the previous patch, instead of augmenting it?

Best,
-- 
Josselin Poiret

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 682 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-01-10 18:24   ` Josselin Poiret via Guix-patches via
@ 2024-01-13  6:48     ` Hilton Chain via Guix-patches via
  0 siblings, 0 replies; 9+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-01-13  6:48 UTC (permalink / raw)
  To: Josselin Poiret
  Cc: 宋文武, 68250, Munyoki Kilyungi, Zheng Junjie,
	Lars-Dominik Braun, Andrew Tropin, jgart, Marius Bakke

Hi Josselin,

On Thu, 11 Jan 2024 02:24:16 +0800,
Josselin Poiret wrote:
>
> [1  <text/plain (quoted-printable)>]
> Hi Hilton,
>
> Hilton Chain <hako@ultrarare.space> writes:
>
> > This is a follow-up to ce7b2b57aa6da0ceace94ea5fb42392c7ff97d53.
> >
> > * gnu/packages/video.scm (mpv)[arguments]<#:phases>: Add 'fix-mpv.pc.
>
> Does this completely replace the previous patch, instead of augmenting it?

Yes!  I should clarify this before.




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-01-06  4:23 ` [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file Hilton Chain via Guix-patches via
  2024-01-10 18:24   ` Josselin Poiret via Guix-patches via
@ 2024-01-19  2:05   ` Maxim Cournoyer
  2024-02-01  5:01     ` Hilton Chain via Guix-patches via
  1 sibling, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2024-01-19  2:05 UTC (permalink / raw)
  To: Hilton Chain
  Cc: 宋文武, 68250, Munyoki Kilyungi, Zheng Junjie,
	Lars-Dominik Braun, Josselin Poiret, Andrew Tropin, jgart,
	Marius Bakke

Hi,

Hilton Chain <hako@ultrarare.space> writes:

> This is a follow-up to ce7b2b57aa6da0ceace94ea5fb42392c7ff97d53.
>
> * gnu/packages/video.scm (mpv)[arguments]<#:phases>: Add 'fix-mpv.pc.
>
> Suggested-by: 宋文武 <iyzsong@member.fsf.org>
> Change-Id: I9826d5d6c957ca3022fa326aee111edb533f05bc
> ---
>  gnu/packages/video.scm | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> index e70aa5352e..10d46db38b 100644
> --- a/gnu/packages/video.scm
> +++ b/gnu/packages/video.scm
> @@ -2365,7 +2365,13 @@ (define-public mpv
>                ;; 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"))))
> +              (setenv "PYTHONHASHSEED" "1")))
> +          ;; mpv.pc is generated by meson.  libmpv's headers don't actually
> +          ;; require these dependencies so it's safe to remove these two fields.
> +          (add-after 'install 'fix-mpv.pc
> +            (lambda _
> +              (substitute* (string-append #$output "/lib/pkgconfig/mpv.pc")
> +                (("^(Requires|Libs)\\.private:.*") "")))))
>        #:configure-flags
>        #~(list "-Dlibmpv=true"
>                "-Dcdda=enabled"

I've just seen this, after pushing a hot fix as
f3fdb4e041cb5740ba0b38b9ad017571f8414d33, which propagates all listed
libraries in Requires.private.

I suppose that someone wanting to build something statically from mpv
would benefit from having the original mpv.pc file without
modifications.

Perhaps we can try it out for a bit, and if the propagation causes
problems, we can fall-back to this change here?

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-01-19  2:05   ` Maxim Cournoyer
@ 2024-02-01  5:01     ` Hilton Chain via Guix-patches via
  2024-02-05 19:37       ` Maxim Cournoyer
  0 siblings, 1 reply; 9+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-02-01  5:01 UTC (permalink / raw)
  To: Maxim Cournoyer
  Cc: 宋文武, 68250, Munyoki Kilyungi, Zheng Junjie,
	Lars-Dominik Braun, Josselin Poiret, Andrew Tropin, jgart,
	Marius Bakke

Hi Maxim,

On Fri, 19 Jan 2024 10:05:41 +0800,
Maxim Cournoyer wrote:
>
> Hi,
>
> Hilton Chain <hako@ultrarare.space> writes:
>
> > This is a follow-up to ce7b2b57aa6da0ceace94ea5fb42392c7ff97d53.
> >
> > * gnu/packages/video.scm (mpv)[arguments]<#:phases>: Add 'fix-mpv.pc.
> >
> > Suggested-by: 宋文武 <iyzsong@member.fsf.org>
> > Change-Id: I9826d5d6c957ca3022fa326aee111edb533f05bc
> > ---
> >  gnu/packages/video.scm | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
> > index e70aa5352e..10d46db38b 100644
> > --- a/gnu/packages/video.scm
> > +++ b/gnu/packages/video.scm
> > @@ -2365,7 +2365,13 @@ (define-public mpv
> >                ;; 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"))))
> > +              (setenv "PYTHONHASHSEED" "1")))
> > +          ;; mpv.pc is generated by meson.  libmpv's headers don't actually
> > +          ;; require these dependencies so it's safe to remove these two fields.
> > +          (add-after 'install 'fix-mpv.pc
> > +            (lambda _
> > +              (substitute* (string-append #$output "/lib/pkgconfig/mpv.pc")
> > +                (("^(Requires|Libs)\\.private:.*") "")))))
> >        #:configure-flags
> >        #~(list "-Dlibmpv=true"
> >                "-Dcdda=enabled"
>
> I've just seen this, after pushing a hot fix as
> f3fdb4e041cb5740ba0b38b9ad017571f8414d33, which propagates all listed
> libraries in Requires.private.
>
> I suppose that someone wanting to build something statically from mpv
> would benefit from having the original mpv.pc file without
> modifications.
>
> Perhaps we can try it out for a bit, and if the propagation causes
> problems, we can fall-back to this change here?


Then we should follow the approach in v1 to add libmpv as a separate package.
I'll send v3 later.

Thanks




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-02-01  5:01     ` Hilton Chain via Guix-patches via
@ 2024-02-05 19:37       ` Maxim Cournoyer
  2024-02-26 16:01         ` Maxim Cournoyer
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2024-02-05 19:37 UTC (permalink / raw)
  To: Hilton Chain
  Cc: 宋文武, 68250, Munyoki Kilyungi, Zheng Junjie,
	Lars-Dominik Braun, Josselin Poiret, Andrew Tropin, jgart,
	Marius Bakke

Hi Hilton,

[...]

>> I've just seen this, after pushing a hot fix as
>> f3fdb4e041cb5740ba0b38b9ad017571f8414d33, which propagates all listed
>> libraries in Requires.private.
>>
>> I suppose that someone wanting to build something statically from mpv
>> would benefit from having the original mpv.pc file without
>> modifications.
>>
>> Perhaps we can try it out for a bit, and if the propagation causes
>> problems, we can fall-back to this change here?
>
>
> Then we should follow the approach in v1 to add libmpv as a separate package.
> I'll send v3 later.

Actually I don't think we need to split out a library for mpv here;
there are two things we can do in the short term:

1. Build MPV strictly as a shared library (-Dbuild=shared) or something
in Meson.  Then Meson doesn't output all these Requires.private
dependencies, which are only useful for static linking, and which
pkg-config confusingly uses for its --exists check.

2. On core-updates, I've been experimenting with replacing pkg-config
with pkgconf, which seems to be designed better for avoiding the above
pkg-config's pitfall.  Currently stuck on a hard to understand cycle.

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-02-05 19:37       ` Maxim Cournoyer
@ 2024-02-26 16:01         ` Maxim Cournoyer
  2024-02-27  1:31           ` Hilton Chain via Guix-patches via
  0 siblings, 1 reply; 9+ messages in thread
From: Maxim Cournoyer @ 2024-02-26 16:01 UTC (permalink / raw)
  To: Hilton Chain
  Cc: 宋文武, 68250, Munyoki Kilyungi,
	Lars-Dominik Braun, Zheng Junjie, Josselin Poiret, Andrew Tropin,
	jgart, Marius Bakke

Hi Hilton,

Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:

> Hi Hilton,
>
> [...]
>
>>> I've just seen this, after pushing a hot fix as
>>> f3fdb4e041cb5740ba0b38b9ad017571f8414d33, which propagates all listed
>>> libraries in Requires.private.
>>>
>>> I suppose that someone wanting to build something statically from mpv
>>> would benefit from having the original mpv.pc file without
>>> modifications.
>>>
>>> Perhaps we can try it out for a bit, and if the propagation causes
>>> problems, we can fall-back to this change here?
>>
>>
>> Then we should follow the approach in v1 to add libmpv as a separate package.
>> I'll send v3 later.
>
> Actually I don't think we need to split out a library for mpv here;
> there are two things we can do in the short term:
>
> 1. Build MPV strictly as a shared library (-Dbuild=shared) or something
> in Meson.  Then Meson doesn't output all these Requires.private
> dependencies, which are only useful for static linking, and which
> pkg-config confusingly uses for its --exists check.
>
> 2. On core-updates, I've been experimenting with replacing pkg-config
> with pkgconf, which seems to be designed better for avoiding the above
> pkg-config's pitfall.  Currently stuck on a hard to understand cycle.

I've implemented 2. above; see: <https://issues.guix.gnu.org/68813>,
which removes the need to propagate pkg-config *.private fields, which
should only be needed when doing static builds.

I'm thus closing this issue.  Let me know if I've missed anything!

-- 
Thanks,
Maxim




^ permalink raw reply	[flat|nested] 9+ messages in thread

* [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file.
  2024-02-26 16:01         ` Maxim Cournoyer
@ 2024-02-27  1:31           ` Hilton Chain via Guix-patches via
  0 siblings, 0 replies; 9+ messages in thread
From: Hilton Chain via Guix-patches via @ 2024-02-27  1:31 UTC (permalink / raw)
  To: Maxim Cournoyer
  Cc: 宋文武, 68250, Munyoki Kilyungi,
	Lars-Dominik Braun, Zheng Junjie, Josselin Poiret, Andrew Tropin,
	jgart, Marius Bakke

Hi Maxim,

On Tue, 27 Feb 2024 00:01:31 +0800,
Maxim Cournoyer wrote:
>
> Hi Hilton,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> writes:
>
> > Hi Hilton,
> >
> > [...]
> >
> >>> I've just seen this, after pushing a hot fix as
> >>> f3fdb4e041cb5740ba0b38b9ad017571f8414d33, which propagates all listed
> >>> libraries in Requires.private.
> >>>
> >>> I suppose that someone wanting to build something statically from mpv
> >>> would benefit from having the original mpv.pc file without
> >>> modifications.
> >>>
> >>> Perhaps we can try it out for a bit, and if the propagation causes
> >>> problems, we can fall-back to this change here?
> >>
> >>
> >> Then we should follow the approach in v1 to add libmpv as a separate package.
> >> I'll send v3 later.
> >
> > Actually I don't think we need to split out a library for mpv here;
> > there are two things we can do in the short term:
> >
> > 1. Build MPV strictly as a shared library (-Dbuild=shared) or something
> > in Meson.  Then Meson doesn't output all these Requires.private
> > dependencies, which are only useful for static linking, and which
> > pkg-config confusingly uses for its --exists check.
> >
> > 2. On core-updates, I've been experimenting with replacing pkg-config
> > with pkgconf, which seems to be designed better for avoiding the above
> > pkg-config's pitfall.  Currently stuck on a hard to understand cycle.
>
> I've implemented 2. above; see: <https://issues.guix.gnu.org/68813>,
> which removes the need to propagate pkg-config *.private fields, which
> should only be needed when doing static builds.
>
> I'm thus closing this issue.  Let me know if I've missed anything!


Great to see!  Thank you very much!




^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-02-27  2:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-05  5:06 [bug#68250] [PATCH] gnu: Add libmpv Hilton Chain via Guix-patches via
2024-01-06  4:23 ` [bug#68250] [PATCH v2] gnu: mpv: Fix pkgconfig file Hilton Chain via Guix-patches via
2024-01-10 18:24   ` Josselin Poiret via Guix-patches via
2024-01-13  6:48     ` Hilton Chain via Guix-patches via
2024-01-19  2:05   ` Maxim Cournoyer
2024-02-01  5:01     ` Hilton Chain via Guix-patches via
2024-02-05 19:37       ` Maxim Cournoyer
2024-02-26 16:01         ` Maxim Cournoyer
2024-02-27  1:31           ` Hilton Chain via Guix-patches via

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).