Skip to content

Commit c94626c

Browse files
committed
Added dockerfile for xdgnj
1 parent 6b1dbdf commit c94626c

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ This will run every test in the default configuration.
2727
### Optional
2828

2929
- [glow](https://repology.org/project/glow/packages) for rendering markdown in the terminal ([bat](https://repology.org/project/bat-cat/packages), [pygmentize](https://repology.org/project/pygments/versions) or [highlight](https://repology.org/project/highlight/packages) can be used as fallback, but glow's output is clearer and therefore glow is recommended)
30-
- [cabal](https://repology.org/project/cabal/packages) for compiling the helper program for creating configurations
3130

3231
## Configuration
3332

@@ -43,13 +42,19 @@ Files in this directory can have any name, but using the name of the program is
4342

4443
### Automatically Generating Configuration
4544

46-
You need _haskell_ and _cabal_ installed. (To be clear, this is just for a tool that will help you automatically generate the config files, you still only need your shell to run the tests)
45+
You can download the _xdgnj_ executable from the releases page. Alternatively you can build it from scratch using _cabal_, _stack_, or the provided docker image in _build/_. (To be clear, this is just a tool that will help you automatically generate the config files, you still only need your shell to run the tests)
4746

48-
Run the following command:
47+
Available commands:
4948
```sh
50-
cabal run xdgnj add
49+
xdgnj add # Adds a new configuration
50+
xdgnj prev programs/FILE.json # Preview the configuration for a program
51+
xdgnj run # Mostly the same as running the shell script
5152
```
5253

54+
#### Building from scratch
55+
56+
You can use `cabal build`, `stack build`, or the provided dockerfile in _build/_.
57+
5358
### Manually
5459

5560
We're going to use _git_ as an example.

build/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
xdgnj

build/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM fpco/stack-build:lts-19.10
2+
3+
WORKDIR /usr/lib/gcc/x86_64-linux-gnu/7.5.0
4+
RUN ls
5+
RUN cp crtbeginT.o crtbeginT.o.orig
6+
RUN cp crtbeginS.o crtbeginT.o
7+
8+
RUN git clone "https://github.com/b3nj5m1n/xdg-ninja" /tmp/xdg-ninja
9+
WORKDIR /tmp/xdg-ninja
10+
RUN stack install --ghc-options '-optl-static -fPIC'

build/build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/env sh
2+
docker build -t xdgnj . || exit 1
3+
docker run --rm --volume "$(pwd):/data" xdgnj cp "/root/.local/bin/xdgnj" "/data/xdgnj" || exit 1
4+
sudo chown "$USER" xdgnj

0 commit comments

Comments
 (0)