[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/02: website: package-channel: Update to match '.guix' convention.
From: |
Ludovic Courtès |
Subject: |
02/02: website: package-channel: Update to match '.guix' convention. |
Date: |
Mon, 5 Jun 2023 05:26:54 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix-artwork.
commit d765f1cd23cbda884224eac1e03a9cf40fef8b80
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 5 11:25:49 2023 +0200
website: package-channel: Update to match '.guix' convention.
* website/drafts/package-channel.md: Update.
---
website/drafts/package-channel.md | 32 +++++++++++++++++---------------
1 file changed, 17 insertions(+), 15 deletions(-)
diff --git a/website/drafts/package-channel.md
b/website/drafts/package-channel.md
index 2e45609..c9e2950 100644
--- a/website/drafts/package-channel.md
+++ b/website/drafts/package-channel.md
@@ -43,6 +43,7 @@ just without the `define-public` bit:
(guix build-system gnu)
((guix licenses) #:prefix license:)
(gnu packages autotools)
+ (gnu packages base)
(gnu packages bash)
(gnu packages bdw-gc)
(gnu packages compression)
@@ -232,13 +233,12 @@ we’ll start like this, keeping a top-level `guix.scm`
symlink for the
sake of `guix shell`:
```
-mkdir .guix
-mv guix.scm .guix/guile-package.scm
-ln -s .guix/guile-package.scm guix.scm
+mkdir -p .guix/modules
+mv guix.scm .guix/modules/guile-package.scm
+ln -s .guix/modules/guile-package.scm guix.scm
```
-(In Guile we actually used `build-aux/guix` instead of `.guix`, but the
-latter is probably clearer.) To make it usable as part of a channel, we
+To make it usable as part of a channel, we
need to turn our `guix.scm` file into a
[module](https://guix.gnu.org/manual/devel/en/html_node/Package-Modules.html):
we do that by changing the `use-modules` form at the top to a
@@ -273,7 +273,7 @@ so Guix knows where to look for package modules in our
repository:
(channel
(version 0)
- (directory ".guix")) ;look for package modules under .guix/
+ (directory ".guix/modules")) ;look for package modules under .guix/modules/
```
To recap, we now have these files:
@@ -281,9 +281,10 @@ To recap, we now have these files:
```
.
├── .guix-channel
-├── guix.scm → .guix/guile-package.scm
+├── guix.scm → .guix/modules/guile-package.scm
└── .guix
- └── guile-package.scm
+ └── modules
+ └── guile-package.scm
```
And that’s it: we have a channel! (We could do better and support
@@ -354,7 +355,7 @@ test as Guile developers—similar to what we did above with
transformation options. We can add them like so:
```scheme
-;; This is the ‘.guix/guile-package.scm’ file.
+;; This is the ‘.guix/modules/guile-package.scm’ file.
(define-module (guile-package)
…)
@@ -392,7 +393,7 @@ channel, or, if we have a checkout of Guile, we can run a
command like
this one from the top level:
```
-guix build -L $PWD/.guix guile-without-threads
+guix build -L $PWD/.guix/modules guile-without-threads
```
@@ -409,7 +410,7 @@ in the case of Guile, we’d have a job that runs a shell
command like
this one:
```
-guix build -L $PWD/.guix guile@3.0.99-git
+guix build -L $PWD/.guix/modules guile@3.0.99-git
```
Doing this works great and has the advantage of being easy to achieve on
@@ -474,7 +475,8 @@ The one we have for Guile has entries for the package
variants we
defined above, as well as additional variants and cross builds:
```scheme
-;; This is ‘.guix/manifest.scm’ FIXME: move modules to .guix/modules/.
+;; This is ‘.guix/manifest.scm’.
+
(use-modules (guix)
(guix profiles)
(guile-package)) ;import our own package module
@@ -554,10 +556,10 @@ This is it!
We picked Guile as the running example in this post and you can see the
result here:
- -
[`.guix-channel`](https://git.savannah.gnu.org/cgit/guile.git/tree/.guix-channel?id=36fd2b4920ae926c79b936c29e739e71a6dff2bc);
- -
[`.guix/modules/guile-package.scm`](https://git.savannah.gnu.org/cgit/guile.git/tree/build-aux/guix/guile-package.scm?id=36fd2b4920ae926c79b936c29e739e71a6dff2bc)
+ -
[`.guix-channel`](https://git.savannah.gnu.org/cgit/guile.git/tree/.guix-channel?id=cd57379b3df636198d8cd8e76c1bfbc523762e79);
+ -
[`.guix/modules/guile-package.scm`](https://git.savannah.gnu.org/cgit/guile.git/tree/.guix/modules/guile-package.scm?id=cd57379b3df636198d8cd8e76c1bfbc523762e79)
with the top-level `guix.scm` symlink;
- -
[`.guix/manifest.scm`](https://git.savannah.gnu.org/cgit/guile.git/tree/build-aux/manifest.scm?id=36fd2b4920ae926c79b936c29e739e71a6dff2bc).
+ -
[`.guix/manifest.scm`](https://git.savannah.gnu.org/cgit/guile.git/tree/.guix/manifest.scm?id=cd57379b3df636198d8cd8e76c1bfbc523762e79).
These days, repositories are commonly splattered with dot files for
various tools: `.envrc`, `.gitlab-ci.yml`, `.github/workflows`,