Skip to content

Commit e3302d5

Browse files
committed
Update README.md
1 parent 138f241 commit e3302d5

File tree

1 file changed

+24
-57
lines changed

1 file changed

+24
-57
lines changed

README.md

Lines changed: 24 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -43,71 +43,38 @@ lightweight alternative to [pre-commit](https://pre-commit.com/)):
4343
- [REUSE](https://reuse.software/)
4444
- [jq](https://jqlang.org/) (for JSON formatting);
4545

46-
## Getting started
46+
## Building from source
4747

48-
To set up your development environment, run the following commands:
49-
50-
1. Install [Nix](https://nixos.org/download).
51-
1. Clone the repository and cd into the project directory.
52-
53-
```bash
54-
git clone https://github.com/synalice/perfect-helloworld
55-
cd perfect-helloworld
56-
```
57-
58-
1. Enter Nix `devShell` (installs the toolchain and dependencies).
59-
60-
```bash
61-
nix develop
62-
```
63-
64-
1. Setup Meson `builddir/`.
65-
66-
```bash
67-
meson setup builddir/
68-
```
69-
70-
1. Build the project.
71-
72-
```bash
73-
meson compile -C builddir/
74-
```
75-
76-
1. Run the executable.
77-
78-
```bash
79-
./builddir/src/cli/perfect-helloworld
80-
```
81-
82-
1. Install.
83-
84-
```bash
85-
meson install -C builddir/ --destdir ../installroot
86-
tree installroot/
87-
```
88-
89-
You are good to go!
90-
91-
### (Optional) Use direnv
48+
```bash
49+
git clone https://github.com/synalice/perfect-helloworld
50+
cd perfect-helloworld
51+
meson setup builddir/
52+
meson compile -C builddir/
53+
meson install -C builddir/
54+
```
9255

93-
1. Install [direnv](https://direnv.net/).
94-
1. cd into the project directory.
56+
## Building with Nix
9557

96-
```bash
97-
cd perfect-helloworld
98-
```
58+
```bash
59+
git clone https://github.com/synalice/perfect-helloworld
60+
cd perfect-helloworld
61+
nix build .#default.out
62+
nix build .#default.dev
63+
nix build .#default.doc
64+
```
9965

100-
1. Enable direnv.
66+
## Using Nix `devShell`
10167

102-
```bash
103-
direnv allow
104-
```
68+
Nix can automatically install all dependencies, toolchain and setup the whole
69+
development environment. To do that run
10570

106-
Now `nix develop` will run automatically when you cd into the project directory!
71+
```bash
72+
nix develop
73+
```
10774

10875
## Cross-compilation
10976

110-
To cross-compile the project, run this script:
77+
To cross-compile the project, run this script
11178

11279
```bash
11380
./scripts/cross-compile.sh aarch64-multiplatform out
@@ -127,7 +94,7 @@ To cross-compile the project, run this script:
12794
12895
## AddressSanitizer aka ASan aka Sanitizers
12996

130-
To build the project with AddressSanitizer configure the project like this:
97+
To build the project with AddressSanitizer configure the project like this
13198

13299
```bash
133100
meson setup --reconfigure -Db_sanitize=address,undefined,leak -Db_lundef=false builddir/

0 commit comments

Comments
 (0)