unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#55139: package-location is wrong for transformed packages
@ 2022-04-27  1:48 Maxim Cournoyer
  2022-04-27 12:23 ` Liliana Marie Prikler
  2022-05-02 20:57 ` Ludovic Courtès
  0 siblings, 2 replies; 6+ messages in thread
From: Maxim Cournoyer @ 2022-04-27  1:48 UTC (permalink / raw)
  To: 55139

Hi Guix!

--8<---------------cut here---------------start------------->8---
> ,import (gnu packages) (guix packages)
> (car (find-packages-by-name "python2-pyalsaaudio"))
$1 = #<package python2-pyalsaaudio@0.8.4 gnu/packages/audio.scm:4327 7f2b76fab160>
> (package-definition-location-code package $1)
$2 = #f
> (package-definition-location $2)
$3 = #<<location> file: "gnu/packages/audio.scm" line: 4327 column: 2>
--8<---------------cut here---------------end--------------->8---

This is wrong though, and gives the location of the parent package (the
one it inherited from).  This seems to be made on purpose (?) given the
code in (gnu build-system python):

--8<---------------cut here---------------start------------->8---
(package/inherit p
        (location (package-location p))

        ^ Here, we explicitly set the location to that of its parent.
        
        (name (let ((name (package-name p)))
                (string-append new-prefix
                               (if (string-prefix? old-prefix name)
                                   (substring name
                                              (string-length old-prefix))
                                   name))))
        (arguments
         (let ((python (if (promise? python)
                           (force python)
                           python)))
           (ensure-keyword-arguments (package-arguments p)
                                     `(#:python ,python)))))
--8<---------------cut here---------------end--------------->8---

Another related issue for package-with-python2 packages:

--8<---------------cut here---------------start------------->8---
> (package-definition-location-code $1)
$4 = #f
--8<---------------cut here---------------end--------------->8---

I was expecting to use this to get rid of all leaf Python 2 packages,
but it seems that may not work (as easily as I'd hoped).

Thanks,

Maxim




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-06-08 21:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-27  1:48 bug#55139: package-location is wrong for transformed packages Maxim Cournoyer
2022-04-27 12:23 ` Liliana Marie Prikler
2022-05-02 20:57 ` Ludovic Courtès
2022-05-22  5:16   ` Maxim Cournoyer
2022-05-23 13:28     ` Ludovic Courtès
2022-06-08 21:29       ` Maxim Cournoyer

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).