unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Steve George <steve@futurile.net>
To: help-guix@gnu.org
Subject: Setting package name/version using package transformations
Date: Tue, 2 Jan 2024 21:37:54 +0000	[thread overview]
Message-ID: <ZZSCMrKLQ8wDnMTk@t25sg> (raw)

Hi,

I'm exploring creating 'package variants' through the 'package transformation' options to guix build [0]

I can't figure out how to build a package variant and give it a different name

The most common sort of 'package variant' I can imagine is where the user wants a different (later) version of the source than is available in Guix. An example is Calcurse where Guix's archive has 4.5.1 and upstream has 4.8.1. I can use the --with-source package transformation to build the later version from the upstream source location: 

  $ guix shell --container --nesting --network --development calcurse --no-grafts nss-certs
  [env]$ guix build calcurse --with-source=https://calcurse.org/files/calcurse-4.8.1.tar.gz --no-substitutes --no-grafts

This will create a calcurse package which I can install and it contains calcurse 4.8.1

    $ guix package --list-installed
    calcurse        4.8.1   out     /gnu/store/af4nwvbcd8rbix4vcvamblmbf3ns9wsz-calcurse-4.8.1

Maybe it's due to my previous Linux experiences, but the next thing I wanted to do was give the package a different name and/or different version number so I would know it was a local build. In Debian/Ubuntu I would have named the package <software>-futurile and probably given it a different version number so I could control when it was upgraded. I cannot figure out how to do either of these using a package transformation, rather than defining my own package file etc.

1. Can a package be given a different name with a transformation?
Manual says --with-source=package=source, I tried: 

    # nope - unknown package calcurse-futurile
    guix build calcurse-futurile --with-source=calcurse=https://calcurse.org/files/calcurse-4.8.1.tar.gz --no-substitutes --no-grafts

    # kinda works
    guix build calcurse --with-source=calcurse-futurile=https://calcurse.org/files/calcurse-4.8.1.tar.gz --no-substitutes --no-grafts

The second builds the 'calcurse' package, but it no longer uses the updated source (so I get v4.5.1). I can guess that this is because it has to be a valid package name from the archive and calcurse-futurile isn't one.

2. Can a package be given a different version number with a transformation?
I can give a package a different version number, but the field is constrained. There's no way to use characters other than hypen and dot, so you can't use tilde or full colon for example.

    # this works
    guix build calcurse --with-source=calcurse@5.4.8.1=https://calcurse.org/files/calcurse-4.8.1.tar.gz --no-substitutes --no-grafts

    # not allowed colons or tilde in the field so no 'epoch' ala Debian
    # it breaks the if you have anything other than .xx.xxx
    guix build calcurse --with-source=calcurse@5:4.8.1
    guix build calcurse --with-source=calcurse@4.8.1~futurile 

I eventually found a way to to change the package name, byt giving a name as part of the version:

    # this seems to change the package name?
    guix build calcurse --with-source=calcurse@futurile-0.1=https://calcurse.org/files/calcurse-4.8.1.tar.gz --no-substitutes --no-grafts

    guix package --list-installed 
    calcurse-futurile       0.1     out     /gnu/store/40bprd6gvwf94x42fxdlf739y55p7xip-calcurse-futurile-0.1

This seems to take the first part of the name after the @, up to a hyphen and make it part of the package name. I'm a bit confused about why this works. The manual says --with-source=package@version=source, but this seems to be package@custom_name-version=source - I guess I don't understand the formats of the --with-source field?

Maybe I have a misunderstanding of the scope of usage for 'package transformations' in the cli - am I twisting it to do something that it shouldn't be?

Thanks,

Futurile

[0] https://guix.gnu.org/manual/en/html_node/Package-Transformation-Options.html


             reply	other threads:[~2024-01-02 21:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 21:37 Steve George [this message]
2024-01-03  3:57 ` Setting package name/version using package transformations Csepp

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=ZZSCMrKLQ8wDnMTk@t25sg \
    --to=steve@futurile.net \
    --cc=help-guix@gnu.org \
    /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.
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).