From patchwork Thu Jul 28 14:58:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomasz Jeneralczyk X-Patchwork-Id: 4100 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4E59527BBEA; Thu, 28 Jul 2022 15:59:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9CFCF27BBE9 for ; Thu, 28 Jul 2022 15:59:27 +0100 (BST) Received: from localhost ([::1]:54240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oH4z0-0007zo-LS for patchwork@mira.cbaines.net; Thu, 28 Jul 2022 10:59:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57844) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oH4ye-0007wY-N4 for guix-patches@gnu.org; Thu, 28 Jul 2022 10:59:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:41270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oH4yd-0002Nx-8B for guix-patches@gnu.org; Thu, 28 Jul 2022 10:59:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oH4yd-0000N8-4b for guix-patches@gnu.org; Thu, 28 Jul 2022 10:59:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56803] [PATCH 3/6] gnu: Add python-mpv. Resent-From: Tomasz Jeneralczyk Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Jul 2022 14:59:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56803 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 56803@debbugs.gnu.org Received: via spool by 56803-submit@debbugs.gnu.org id=B56803.16590203121347 (code B ref 56803); Thu, 28 Jul 2022 14:59:03 +0000 Received: (at 56803) by debbugs.gnu.org; 28 Jul 2022 14:58:32 +0000 Received: from localhost ([127.0.0.1]:59247 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oH4y7-0000Le-Hz for submit@debbugs.gnu.org; Thu, 28 Jul 2022 10:58:32 -0400 Received: from outgoing1.lunanode.net ([172.81.176.235]:45255) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oH4y4-0000LV-NC for 56803@debbugs.gnu.org; Thu, 28 Jul 2022 10:58:30 -0400 Received: from mail1.lunanode.net (mail1.lunanode.net [170.75.162.243]) by outgoing1.lunanode.net (Postfix) with ESMTPS id 9A7704007A; Thu, 28 Jul 2022 14:58:27 +0000 (UTC) MIME-Version: 1.0 Date: Thu, 28 Jul 2022 14:58:19 +0000 From: Tomasz Jeneralczyk In-Reply-To: <43fb4107-5ade-092c-23ef-424dfb2133c1@telenet.be> References: <8dec60b4f6d340aa63e58ef1e7628d4d8801fc0b.1658946720.git.tj@schwi.pl> <43fb4107-5ade-092c-23ef-424dfb2133c1@telenet.be> User-Agent: Roundcube Webmail/1.4.11 Message-ID: <3bdaf7497d56169b334ef85b65694fea@schwi.pl> X-Sender: tj@schwi.pl X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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?. 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