Skip to content

Commit 9937e83

Browse files
authored
More README work (#323)
* Add some explanation about how to download the built repository * Make the top how-tos section more explicit * Link fixing * WIP * More
1 parent b263256 commit 9937e83

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

README.md

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
* [All packages](https://input-output-hk.github.io/cardano-haskell-packages/all-packages/).
44
* [All package versions](https://input-output-hk.github.io/cardano-haskell-packages/all-package-versions/).
55

6-
IMPORTANT: If you're here because you need to publish a new version of your package, you
7-
probably want to read the section on [adding a package from GitHub](#-from-github).
6+
*Top How-Tos*
7+
8+
* [Adding a package from GitHub](#-from-github)
9+
* [Making a metadata revision of an already-released package version](#how-to-add-a-new-package-metadata-revision)
10+
* [Adding a patched version of a Hackage package](#how-to-add-a-patched-versions-of-a-hackage-package)
811

912
This is a Cabal package repository ("CHaP") whose purpose is to contain all the Haskell
1013
packages used by the Cardano open-source project which are not on Hackage.
@@ -227,12 +230,12 @@ CHaP supports package metadata revisions just like Hackage. These allow you to p
227230
file for a package version. The primary use of this is to tweak the dependency bounds of a package.
228231
In principle you can change other things too, but this is generally frowned upon.
229232

230-
There is a convenience script for adding a revision to CHaP:
233+
This repository contains a convenience script for adding a revision to CHaP:
231234
```
232235
$ ./scripts/add-revision.sh _repo PACKAGE_NAME PACKAGE_VERSION
233236
```
234237

235-
You need a [built package repository](#how-to-build-the-cabal-package-repository) in order to use the script.
238+
`_repo` needs to point to a [built package repository](#how-to-get-the-built-cabal-package-repository).
236239
It will add a new revision and copy the _current_ cabal file in as the revised cabal file.
237240
You can then edit that file and commit the result.
238241

@@ -275,9 +278,26 @@ For most contributors this section is not going to be necessary, and you can rel
275278

276279
However if you are making a large number of changes (e.g. many revisions), it can be useful to test your work before making a PR.
277280

278-
### How to build the Cabal package repository
281+
### How to get the built Cabal package repository
282+
283+
The Cabal package repository itself is built using the tool `foliage`.
284+
You can either fetch the latest version which is stored in git; or build it yourself locally, which can be convenient or necessary if you have local changes.
285+
286+
### ... by downloading it from Github
287+
288+
The built repository is stored in the `repo` branch of CHaP itself.
289+
You can get the contents of the `repo` branch from Github at https://github.com/input-output-hk/cardano-haskell-packages/archive/refs/heads/repo.zip .
290+
291+
Or you can check out that branch and copy the contents, e.g.
292+
```
293+
git checkout repo
294+
cp -aR . _repo
295+
git checkout -
296+
```
297+
298+
#### ... by building it locally
279299

280-
The Cabal package repository itself is built using the tool `foliage`. `foliage` is available in the Nix dev shell, which you can get into using `nix develop`.
300+
`foliage` is available in the Nix dev shell, which you can get into using `nix develop`.
281301

282302
To build the repository, run `foliage build -j 0 --write-metadata`. This will build the repository and put it in `_repo`.
283303

0 commit comments

Comments
 (0)