From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rosset Subject: bug#38148: [PATCH 1/2] gnu: Add python-pyqtwebengine. Date: Mon, 13 Jan 2020 16:42:47 -0800 Message-ID: <87tv4yc1hb.fsf@gmail.com> References: <20191109100530.zdfrewfmengq7pud@hooch.localdomain> <20200113103304.9093-1-mike.rosset@gmail.com> <87o8v7qw5t.fsf@ambrevar.xyz> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:35993) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irAJR-0005PB-Lo for bug-guix@gnu.org; Mon, 13 Jan 2020 19:44:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irAJQ-0007M8-Gn for bug-guix@gnu.org; Mon, 13 Jan 2020 19:44:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:54481) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irAJN-0007JU-WA for bug-guix@gnu.org; Mon, 13 Jan 2020 19:44:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irAJN-0003Gc-VB for bug-guix@gnu.org; Mon, 13 Jan 2020 19:44:01 -0500 Sender: "Debbugs-submit" Resent-Message-ID: In-reply-to: <87o8v7qw5t.fsf@ambrevar.xyz> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane-mx.org@gnu.org Sender: "bug-Guix" To: Pierre Neidhardt Cc: 38148@debbugs.gnu.org >> + ;; store. >> + (add-before 'configure 'substitute-source >> + (lambda* (#:key inputs #:allow-other-keys) >> + (let* ((qtbase (assoc-ref inputs "qtbase")) >> + (qtprinter.h (string-append "\"" qtbase "/include/qt5/QtPrintSupport/qprinter.h\""))) >> + (substitute* "sip/QtPrintSupport/qprinter.sip" >> + (("") >> + qtprinter.h)) >> + #t))) >> (replace 'configure >> (lambda* (#:key inputs outputs #:allow-other-keys) >> (let* ((out (assoc-ref outputs "out")) >> @@ -1986,6 +1998,91 @@ framework. The bindings are implemented as a set of Python modules and >> contain over 620 classes.") >> (license license:gpl3))) > > Please apply the above pyqt change to a separate commit. I missed this comment with my new series. If this really needs to be done, I'll have to redo all of the commits and resend the series. Can this be avoided if possible? > + (arguments >> + `(#:modules ((srfi srfi-1) >> + ,@%gnu-build-system-modules) >> + #:phases >> + (modify-phases %standard-phases >> + (replace 'configure >> + (lambda* (#:key inputs outputs #:allow-other-keys) >> + (let* ((out (assoc-ref outputs "out")) >> + (sipdir (string-append out "/share/sip")) >> + (pyqt-sipdir (string-append >> + (assoc-ref inputs "python-pyqt") "/share/sip")) >> + (python (assoc-ref inputs "python")) >> + (python-version >> + (last (string-split python #\-))) >> + (python-major+minor >> + (string-join >> + (take (string-split python-version #\.) 2) >> + ".")) > > Use version-major+minor from (guix utils) instead? This is not an easy fix, I actually snarfed this from python-pyqt. In fact most of the python packages in this file use this method. Unfortunately version-major+minor cannot take an input, it needs to take a guix package record. This creates some scoping issues, in order to get the version for python. you would need to do something like semi pseudo code. --8<---------------cut here---------------start------------->8--- (begin (use-modules (gnu packages python)) (version-major+minor python)) --8<---------------cut here---------------end--------------->8--- This approach in theory works only when the input is python. But take the scenario were the input changes to a specific python version. Then our above code will still work but no longer produce the correct path. How python-build-system handles this. Is the same way as this let. In fact it looks like they wer copied verbatim. Unfortunately these python packages don't use python setuptools. So gnu-build-system is used instead. Even if we could use python-build-system. This would just make the code more ascetically pleasing. The underlying code would still be the same. The string parsing is not pretty, but it at least functional. If the input version changes the so probably will the path. Mike