what about custom licenses?
hi everyone! i packed some cl libs. but they have custom (foss) licenses. how i can describe it in guix?
Re: what about custom licenses?
Hi, You can check guix/licenses.scm file. It contains how licenses are defined in Guix so you can build your own. There are projects with custom licenses there like wxwidgets. I hope this helps. Best, Ekaitz ‐‐‐ Original Message ‐‐‐ On Saturday, August 1, 2020 11:44 AM, Adam Kandur via wrote: > > > hi everyone! i packed some cl libs. but they have custom (foss) licenses. how > i can describe it in guix?
The sources with a git ref origin should also include the .git directory
Hello guix, I am in the process of writing some code, and I like the fact that the source of a guix package can have a git reference. However, when I use it, the .git directory is not present when building the source. Did I missed something? This is very inconvenient, because I use "git describe" to compute the version number, and there is nothing I can do without the .git. I could update the version number on each commit, but then it will not work when merging branches, and the tag system is generally better, so I have no version information in the sources checked in the git repository. Please note that this could benefit all the packages that use the git- veersion-gen script. For the meson build system, the .git directory is also mandatory, I think. My solution for now is to write the version to a file named ".tarball- version" at the root of the package, create an artificial commit, and use that as the source. However, it is not reproducible because re- creating the same commit (with the same date and authorship information) will lead to another commit ID. Can I do something better? Is it possible to include the ".git" directory with a git source? divoplade
Re: The sources with a git ref origin should also include the .git directory
divoplade writes: > I am in the process of writing some code, and I like the fact that the > source of a guix package can have a git reference. However, when I use > it, the .git directory is not present when building the source. That’s on purpose, because the .git directory contains files that prevent reproducibility. -- Ricardo
Re: The sources with a git ref origin should also include the .git directory
Le samedi 01 août 2020 à 15:25 +0200, Ricardo Wurmus a écrit : > That’s on purpose, because the .git directory contains files that > prevent reproducibility. > Thank you, I will try something else then. divoplade
Newbie tries to add a snippet to an origin
Hello, I am trying to add a file named ".tarball-version" containing a fixed string at the root of my source. I tried several things, the most promising (I think) being this: (define-public pomdappi-dist (dist-package pomdappi (origin (method git-fetch) (uri (git-reference (url "@REPO@") (commit "@COMMIT@"))) (sha256 (base32 "@COMMIT_BASE32@")) (snippet #~(symlink #$(plain-file ".tarball-version" "@VERSION@") ".tarball-version") However, I get "guix build: error: invalid name: `.tarball-version'" when running guix build. My idea was to create a file in the store containing the fixed string @VERSION@, and then symlink it withing the source as ".tarball- version". Could someone help me? divoplade
Re: Newbie tries to add a snippet to an origin
Hi divoplade, What build system are you using? How do you use your version number? Maybe there’s a simpler solution. - John
Re: Newbie tries to add a snippet to an origin
Hello, Le samedi 01 août 2020 à 08:26 -0700, John Soo a écrit : > What build system are you using? How do you use your version number? I am using the standard gnu build system with a git repository [1]. The version number is computed with "git describe --tags" (plus a little sed "s/^v//g"), and I wish to use it to fix configure.ac. I can also read the version number from a file in the repository (.tarball- version), but it will not be part of a commit. I have defined a guix template for two packages, "pomdappi" and "pomdappi-dist", and I use the git repository and the gitlab CI environment variables to fill in the blanks [2]. The "pomdappi-dist" package creates the release tarball for "pomdappi", with the (dist- package) constructor. The problem is that using a git source, I cannot run "git describe"; so I need to patch the git source to add the version number. divoplade [1] https://framagit.org/divoplade/pomdappi/-/tree/8-make-the-version-computation-reproducible [2] https://framagit.org/divoplade/pomdappi/-/blob/8-make-the-version-computation-reproducible/dist
Re: Newbie tries to add a snippet to an origin
I don't think this is how you are supposed to use snippet :). It's code executed from the root of the sources that changes it. Then guix repacks the modified sources and the result is the source for tge package. Look at the code in guix for more examples. Here's what I suggest: (source (origin … (modules '((guix build utils))) (snipet `(begin (with-output-to-file ".tarball-version" (lambda _ (format #t "~a~%" ,version))) #t Of course version needs to be defined in this context (usually as a field in the package definition, but I'm not sure what dist-package is). You can use any other name or the result of any scheme function, like (package-version pomdappi) if you prefer. HTH! Le 1 août 2020 11:17:36 GMT-04:00, divoplade a écrit : >Hello, > >I am trying to add a file named ".tarball-version" containing a fixed >string at the root of my source. > >I tried several things, the most promising (I think) being this: > >(define-public pomdappi-dist > (dist-package > pomdappi > (origin > (method git-fetch) > (uri (git-reference > (url "@REPO@") > (commit "@COMMIT@"))) > (sha256 > (base32 > "@COMMIT_BASE32@")) > (snippet > #~(symlink #$(plain-file ".tarball-version" "@VERSION@") > ".tarball-version") > >However, I get "guix build: error: invalid name: `.tarball-version'" >when running guix build. > >My idea was to create a file in the store containing the fixed string >@VERSION@, and then symlink it withing the source as ".tarball- >version". > >Could someone help me? > >divoplade
Re: Newbie tries to add a snippet to an origin
Hi divoplade and guix, Since you are using the gnu build system, I suggest making your version number a variable in the makefile. The good part of using a make variable is that you can use $(shell git describe ...) normally and override it when building with guix. You can use the make or configure flags arguments to override the version number with the guix package version number. Hope that helps, John
Re: Newbie tries to add a snippet to an origin
Thank you so much for your help, now I can build both packages without hassle. The filled-in module template is dynamically computed [1], so I do not need to care about passing the version number around. https://framagit.org/divoplade/pomdappi/-/jobs/1068726/artifacts/raw/public/divoplade/packages/pomdappi.scm Le samedi 01 août 2020 à 09:00 -0700, John Soo a écrit : > Since you are using the gnu build system, I suggest making your > version number a variable in the makefile. The good part of using a > make variable is that you can use $(shell git describe ...) normally > and override it when building with guix. You can use the make or > configure flags arguments to override the version number with the > guix package version number. I don't think it is wise to let the user update the version number with a simple configure switch or make variable; it could make things very confusing for debugging. Updating the version number is more of a maintainer task, so it makes sense to write it in stone during the maintainer phase (bootstrap / autoreconf). divoplade
Re: Newbie tries to add a snippet to an origin
Hi divoplade, I’m glad you figured it out. I do want to say that most guix packages define the version number in the package definition. It would not be out of the ordinary to bump the version number in the scheme file. Good luck! John