unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Mike Rosset <mike.rosset@gmail.com>
To: Pierre Neidhardt <mail@ambrevar.xyz>
Cc: 38148@debbugs.gnu.org
Subject: bug#38148: [PATCH 1/2] gnu: Add python-pyqtwebengine.
Date: Mon, 13 Jan 2020 16:42:47 -0800	[thread overview]
Message-ID: <87tv4yc1hb.fsf@gmail.com> (raw)
In-Reply-To: <87o8v7qw5t.fsf@ambrevar.xyz>


>> +         ;; 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"
>> +                 (("<qprinter.h>")
>> +                  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

  reply	other threads:[~2020-01-14  0:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 10:05 bug#38148: Guix packages old/broken version of qutebrowser Florian Bruhin
2019-11-09 16:49 ` Tobias Geerinckx-Rice via Bug reports for GNU Guix
2019-11-10  2:32   ` Bengt Richter
2020-01-13 10:33 ` bug#38148: [PATCH 1/2] gnu: Add python-pyqtwebengine Mike Rosset
2020-01-13 10:33   ` bug#38148: [PATCH 2/2] gnu: qutebrowser: Update to 1.9.0 Mike Rosset
2020-01-13 14:20     ` Pierre Neidhardt
2020-01-13 18:54       ` Mike Rosset
2020-01-13 19:02         ` Pierre Neidhardt
2020-01-13 10:45   ` bug#38148: [PATCH 1/2] gnu: Add python-pyqtwebengine Mike Rosset
2020-01-13 14:16   ` Pierre Neidhardt
2020-01-14  0:42     ` Mike Rosset [this message]
2020-01-14  9:42       ` Pierre Neidhardt
2020-01-14 10:25         ` Mike Rosset
2020-01-14 11:09         ` Mike Rosset
2020-01-15 15:31           ` Pierre Neidhardt
2020-01-15 17:26             ` Mike Rosset
2020-01-14  0:13   ` bug#38148: [PATCH 3/4] gnu: python-pyqt: Improved qprinter.h substitutition comment Mike Rosset
2020-01-14  0:13     ` bug#38148: [PATCH 4/4] gnu: qutebrowser: Improve comment sections Mike Rosset
2020-01-14 11:04 ` bug#38148: [PATCH 1/5] gnu: python-pyqt: Substitute the full path of <qprinter.h> Mike Rosset
2020-01-14 11:06   ` bug#38148: [PATCH 2/5] gnu: Add python-pyqtwebengine Mike Rosset
2020-01-14 11:06     ` bug#38148: [PATCH 3/5] gnu: qutebrowser: Update to 1.9.0 Mike Rosset
2020-01-14 11:06     ` bug#38148: [PATCH 4/5] gnu: python-pyqt: Improved qprinter.h substitutition comment Mike Rosset
2020-01-14 11:06     ` bug#38148: [PATCH 5/5] gnu: qutebrowser: Improve comment sections Mike Rosset
2020-01-15 20:55 ` bug#38148: Guix packages old/broken version of qutebrowser Ricardo Wurmus
2020-01-16 12:04   ` Florian Bruhin

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=87tv4yc1hb.fsf@gmail.com \
    --to=mike.rosset@gmail.com \
    --cc=38148@debbugs.gnu.org \
    --cc=mail@ambrevar.xyz \
    /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).