unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomasz Jeneralczyk <tj@schwi.pl>
To: Maxime Devos <maximedevos@telenet.be>
Cc: 56803@debbugs.gnu.org
Subject: [bug#56803] [PATCH 3/6] gnu: Add python-mpv.
Date: Thu, 28 Jul 2022 14:58:19 +0000	[thread overview]
Message-ID: <3bdaf7497d56169b334ef85b65694fea@schwi.pl> (raw)
In-Reply-To: <43fb4107-5ade-092c-23ef-424dfb2133c1@telenet.be>

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

On 2022-07-27 22:05, Maxime Devos wrote:
> On 27-07-2022 21:00, Tomasz Jeneralczyk wrote:
> IIUC, that's for using Guile modules defined in packages -- but mpv is
> not a Guile package, so I expect that the surrounding with-extensions
> can be dropped.
You're right. I dropped it with no negative consequences.

> This sounds like something upstream should be informed about, otherwise 
> they wouldn't know there is something to fix.
I had a friend on arch linux run those tests and everything worked just 
fine, so it might have something to do with guix
itself or an incomplete package definition. In any case, I'll make sure 
to write a proper bug report in the upstream repo later.


> Look for substitute-keyword-arguments, which isn't stateful and hence
> there is less risk of accidentally modifying the arguments of the
> parent package.  Also, any reason for not adding this to the original
> package? (Possibly there is one).
Thanks, this macro is not documented in manual, but it looks much nicer 
now.
The reason I made a new package is simply because someone on irc 
recommended me to do as such. Though your question made me realize
that just adding one flag worked because all the necessary packages to 
build python buildings were in opencv package already...
maybe originally it was intended for the python bindings to be included 
in opencv? And so I added the flag to opencv and removed
my original package - it works all the same.


> Run "./pre-inst-env guix lint hydrus-network", it will have a remark
> about this.  Also, technically this is racy -- it's possible for
> python to start before Xvfb is ready though so far this doesn't seem
> to have caused trouble for other packages yet AFAIK -- I recommend
> "xvfb-run" "--" "python" "test.py" instead.
I though I missed something so I ran lint again, but it only said 
there's a new version of hydrus available.
Nevertheless I changed the invocation to what you recommended. I also 
updated hydrus to version 493.


> (I just scrolled quickly through the patches, a more full review will
> have to come later.)
Thank you for all your comments so far.
I made changes but I wont send them as patches until I fix all the 
problems or get a confirmation that there's nothing more to do.

However I'm attaching a "preview" diff of the changes I'll want to 
iclude in v2 of my patches.
I suppose I should only send v2 of the ones I changed, right?.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: wip-changes-0.diff --]
[-- Type: text/x-diff; name=wip-changes-0.diff, Size: 5343 bytes --]

diff --git a/gnu/packages/image-processing.scm b/gnu/packages/image-processing.scm
index 9496155ec7..6417233245 100644
--- a/gnu/packages/image-processing.scm
+++ b/gnu/packages/image-processing.scm
@@ -511,6 +511,8 @@ (define-public opencv
              ;; DISPATCH is the list of optional dispatches.
              "-DCPU_BASELINE=SSE2"
 
+             "-DBUILD_opencv_python3=ON"
+
              ,@(match (%current-system)
                  ("x86_64-linux"
                   '("-DCPU_DISPATCH=NEON;VFPV3;FP16;SSE;SSE2;SSE3;SSSE3;SSE4_1;SSE4_2;POPCNT;AVX;FP16;AVX2;FMA3;AVX_512F;AVX512_SKX"
@@ -658,17 +660,6 @@ (define-public opencv
     (home-page "https://opencv.org/")
     (license license:bsd-3)))
 
-(define-public opencv-with-python
-  (package
-    (inherit opencv)
-    (name "opencv-with-python")
-    (arguments
-     (let* ((args (package-arguments opencv)))
-       (assoc-set! args #:configure-flags
-                   (append (list "-DBUILD_opencv_python3=ON")
-                           (assoc-ref args #:configure-flags)))
-       args))))
-
 (define-public vips
   (package
     (name "vips")
diff --git a/gnu/packages/image-viewers.scm b/gnu/packages/image-viewers.scm
index 9574384761..4ebc891427 100644
--- a/gnu/packages/image-viewers.scm
+++ b/gnu/packages/image-viewers.scm
@@ -985,7 +985,7 @@ (define-public xzgv
 (define-public hydrus-network
   (package
     (name "hydrus-network")
-    (version "492")
+    (version "493")
     (source
      (origin
        (method git-fetch)
@@ -995,7 +995,7 @@ (define-public hydrus-network
        (file-name (git-file-name name version))
        (sha256
         (base32
-         "0cyc499is97r8wri0y86yw6kpfcvc0a1yslr8g8sk4vhlly8gnra"))))
+         "1rr2mx3cxjmkbgqdp7827yl3smpgrjs58ljmhx1k1c7pa5cac4xi"))))
     (build-system python-build-system)
     (arguments
      (list
@@ -1012,8 +1012,7 @@ (define-public hydrus-network
                   (setenv "DISPLAY" ":0")
                   (setenv "XDG_CACHE_HOME" (getcwd))
                   (setenv "HOME" (getcwd))
-                  (system "Xvfb &")
-                  (invoke "python" "test.py")))
+                  (invoke "xvfb-run" "python" "test.py")))
               (delete 'build)
               (add-before 'install 'patch-variables
                 (lambda* (#:key outputs #:allow-other-keys)
@@ -1060,10 +1059,10 @@ (define-public hydrus-network
     ;; All native-inputs are only needed for the the check phase
     (native-inputs
      (list
+      xvfb-run
       python-nose
       python-mock
-      python-httmock
-      xorg-server-for-tests))
+      python-httmock))
     ;; All python packages were taken from static/build_files/linux/requirements.txt
     (propagated-inputs
      (list
@@ -1075,7 +1074,7 @@ (define-public hydrus-network
       python-lxml
       python-lz4
       python-numpy
-      opencv-with-python ; drop-in replacement for opencv-python-headless
+      opencv                     ; drop-in replacement for opencv-python-headless
       python-pillow
       python-psutil
       python-pylzma
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 5bc40ecaea..ddfb2b12a4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -30222,22 +30222,21 @@ (define-public python-mpv
          "10w6j3n62ap45sf6q487kz8z6g58sha37i14fa2hhng794z7a8jh"))
        (modules '((guix build utils)))
        (snippet
-        (with-extensions (list mpv)
-          #~(begin
-              ;; Without an absolute path it is not able find and
-              ;; load the libmpv library.
-              (substitute* "mpv.py"
-                (("(sofile = )(.*)" _ pre post)
-                 (string-append pre "\"" #$mpv "/lib/\" + " post)))
-              ;; One of the tests never completes, so neutering it using
-              ;; early return allows other test to run without issue.
-              (substitute* "tests/test_mpv.py"
-                ;; Note the typo in "prooperty" - this was fixed later in
-                ;; upstream but has no effect on whether the tests hangs or not.
-                (("test_wait_for_prooperty_event_overflow.*" line)
-                 ;; The long whitespace between \n and return is to match the
-                 ;; identation level, which is significant in python.
-                 (string-append line "\n        return\n"))))))))
+        #~(begin
+            ;; Without an absolute path it is not able find and
+            ;; load the libmpv library.
+            (substitute* "mpv.py"
+              (("(sofile = )(.*)" _ pre post)
+               (string-append pre "\"" #$mpv "/lib/\" + " post)))
+            ;; One of the tests never completes, so neutering it using
+            ;; early return allows other test to run without issue.
+            (substitute* "tests/test_mpv.py"
+              ;; Note the typo in "prooperty" - this was fixed later in
+              ;; upstream but has no effect on whether the tests hangs or not.
+              (("test_wait_for_prooperty_event_overflow.*" line)
+               ;; The long whitespace between \n and return is to match the
+               ;; identation level, which is significant in python.
+               (string-append line "\n        return\n")))))))
     (build-system python-build-system)
     (arguments
      (list #:phases

  reply	other threads:[~2022-07-28 14:59 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 18:57 [bug#56803] [PATCH 0/6] Add hydrus network and its dependencies Tomasz Jeneralczyk
2022-07-27 19:00 ` [bug#56803] [PATCH 1/6] gnu: Add swftools Tomasz Jeneralczyk
2022-07-27 19:00 ` [bug#56803] [PATCH 2/6] gnu: Add python-xvfbwrapper Tomasz Jeneralczyk
2022-07-27 19:00 ` [bug#56803] [PATCH 3/6] gnu: Add python-mpv Tomasz Jeneralczyk
2022-07-27 22:05   ` Maxime Devos
2022-07-28 14:58     ` Tomasz Jeneralczyk [this message]
2022-08-09 15:14       ` [bug#56803] [PATCH 0/6] Add hydrus network and its dependencies Ludovic Courtès
2022-08-13 14:34         ` Tomasz Jeneralczyk
2022-08-13 21:26           ` ( via Guix-patches via
2022-08-14 10:10             ` Tomasz Jeneralczyk
2022-08-14 10:11               ` ( via Guix-patches via
2022-08-09 16:59       ` [bug#56803] [PATCH 3/6] gnu: Add python-mpv Maxime Devos
2022-07-27 22:09   ` Maxime Devos
2022-07-27 19:00 ` [bug#56803] [PATCH 4/6] gnu: Add opencv-with-python Tomasz Jeneralczyk
2022-07-27 19:00 ` [bug#56803] [PATCH 5/6] gnu: Update python-cloudscraper Tomasz Jeneralczyk
2022-07-27 19:00 ` [bug#56803] [PATCH 6/6] gnu: Add hydrus-network Tomasz Jeneralczyk
2022-08-09 15:09   ` [bug#56803] [PATCH 0/6] Add hydrus network and its dependencies Ludovic Courtès
2022-08-14 12:46 ` [bug#56803] [PATCH v2 1/6] gnu: Add swftools Tomasz Jeneralczyk
2022-08-14 12:46   ` [bug#56803] [PATCH v2 2/6] gnu: Add python-xvfbwrapper Tomasz Jeneralczyk
2022-08-14 12:46   ` [bug#56803] [PATCH v2 3/6] gnu: Add python-mpv Tomasz Jeneralczyk
2022-08-14 12:46   ` [bug#56803] [PATCH v2 4/6] gnu: Add support for python in opencv Tomasz Jeneralczyk
2022-08-14 12:46   ` [bug#56803] [PATCH v2 5/6] gnu: Update python-cloudscraper Tomasz Jeneralczyk
2022-08-14 12:46   ` [bug#56803] [PATCH v2 6/6] gnu: Add hydrus-network Tomasz Jeneralczyk
2022-08-29 22:46     ` bug#56803: [PATCH 0/6] Add hydrus network and its dependencies Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3bdaf7497d56169b334ef85b65694fea@schwi.pl \
    --to=tj@schwi.pl \
    --cc=56803@debbugs.gnu.org \
    --cc=maximedevos@telenet.be \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).