From patchwork Sun Aug 14 12:46:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tomasz Jeneralczyk X-Patchwork-Id: 41664 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 E998527BBEA; Sun, 14 Aug 2022 13:48:39 +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 8FC4D27BBE9 for ; Sun, 14 Aug 2022 13:48:39 +0100 (BST) Received: from localhost ([::1]:54564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oND2k-0002YN-P6 for patchwork@mira.cbaines.net; Sun, 14 Aug 2022 08:48:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oND2B-0002Vz-PX for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46407) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oND2B-0005q4-Ga for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oND2B-0003HA-Cu for guix-patches@gnu.org; Sun, 14 Aug 2022 08:48:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56803] [PATCH v2 3/6] gnu: Add python-mpv. Resent-From: Tomasz Jeneralczyk Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Aug 2022 12:48: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: 56803@debbugs.gnu.org Cc: Tomasz Jeneralczyk Received: via spool by 56803-submit@debbugs.gnu.org id=B56803.166048124112360 (code B ref 56803); Sun, 14 Aug 2022 12:48:03 +0000 Received: (at 56803) by debbugs.gnu.org; 14 Aug 2022 12:47:21 +0000 Received: from localhost ([127.0.0.1]:36145 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oND1V-0003DH-15 for submit@debbugs.gnu.org; Sun, 14 Aug 2022 08:47:21 -0400 Received: from outgoing1.lunanode.net ([172.81.176.235]:56526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oND1Q-0003D0-FB for 56803@debbugs.gnu.org; Sun, 14 Aug 2022 08:47:18 -0400 Received: from mail1.lunanode.net (mail1.lunanode.net [170.75.162.243]) by outgoing1.lunanode.net (Postfix) with ESMTPS id 35A3C40011 for <56803@debbugs.gnu.org>; Sun, 14 Aug 2022 12:47:16 +0000 (UTC) From: Tomasz Jeneralczyk Date: Sun, 14 Aug 2022 14:46:20 +0200 Message-Id: <08140eaac786e693cc7ac33208e4080650dcfb26.1660481045.git.tj@schwi.pl> X-Mailer: git-send-email 2.37.1 In-Reply-To: <458d155cb6f630e0e8aea1793a4c97b3d76520e6.1660481045.git.tj@schwi.pl> References: <458d155cb6f630e0e8aea1793a4c97b3d76520e6.1660481045.git.tj@schwi.pl> MIME-Version: 1.0 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 Author states that the license of the library is inherited from libmpv, which can be either GPLv2 or LPGLv2.1. That's why the package's license is set to be the same as mpv's. One of the tests had to be disabled because it would neither fail or pass, blocking all other tests from running and the package from finishing its build process. I have no clue on why it happens. Rarely some tests fail without any apparent reason. This is possibly related to: https://github.com/jaseg/python-mpv/issues/209 Also add copyright. * gnu/packages/python-xyz.scm (python-mpv): Add variable. --- gnu/packages/python-xyz.scm | 63 +++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 13ab2f2c8b..51bf4d5c0b 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -127,6 +127,7 @@ ;;; Copyright © 2022 Philip McGrath ;;; Copyright © 2022 Marek Felšöci ;;; Copyright © 2022 Hilton Chain +;;; Copyright © 2022 Tomasz Jeneralczyk ;;; ;;; This file is part of GNU Guix. ;;; @@ -30388,6 +30389,68 @@ (define-public python-bsdiff4 and @code{bspatch4}.") (license license:bsd-2))) +(define-public python-mpv + (package + (name "python-mpv") + (version "v1.0.1") + (source + (origin + ;; python-mpv from pypi does not include the tests directory. + (method git-fetch) + (uri (git-reference + (url "https://github.com/jaseg/python-mpv") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "10w6j3n62ap45sf6q487kz8z6g58sha37i14fa2hhng794z7a8jh")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; 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 + #~(modify-phases %standard-phases + (add-before 'build 'patch-reference-to-mpv + (lambda* (#:key inputs #:allow-other-keys) + ;; Without an absolute path it is not able find and + ;; load the libmpv library. + (substitute* "mpv.py" + (("sofile = .*") + (string-append "sofile = \"" + (search-input-file inputs "/lib/libmpv.so") + "\"\n"))))) + (add-before 'check 'prepare-for-tests + (lambda _ + ;; Fontconfig throws errors when it has no cache dir to use. + (setenv "XDG_CACHE_HOME" (getcwd)) + ;; Some tests fail without a writable and readable HOME. + (setenv "HOME" (getcwd))))))) + (native-inputs + (list python-xvfbwrapper)) ; needed for tests only + (inputs (list mpv)) + (propagated-inputs (list python-pillow)) ; for raw screenshots + (home-page "https://github.com/jaseg/python-mpv") + (synopsis "Python interface to the mpv media player") + (description + "python-mpv is a ctypes-based python interface to the mpv media player. +It gives you more or less full control of all features of the player, just +as the lua interface does.") + ;; From the project's README: + ;; python-mpv inherits the underlying libmpv's license, which can be either + ;; GPLv2 or later (default) or LGPLv2.1 or later. For details, see the mpv + ;; copyright page. + (license (package-license mpv)))) + (define-public python-biblib (let ((upstream-version "0.1.0") (commit "ab0e857b9198fe425ec9b02fcc293b5d9fd0c406")