[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Setting package name/version using package transformations

From: Steve George
Subject: Setting package name/version using package transformations
Date: Tue, 2 Jan 2024 21:37:54 +0000


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= --no-substitutes 

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     

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 

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 
--no-substitutes --no-grafts

    # kinda works
    guix build calcurse 
 --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 
--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
    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 
 --no-substitutes --no-grafts

    guix package --list-installed 
    calcurse-futurile       0.1     out     

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?




reply via email to

[Prev in Thread] Current Thread [Next in Thread]