diff options
author | Marc Coquand <marc@mccd.space> | 2024-05-17 15:07:04 -0500 |
---|---|---|
committer | Marc Coquand <marc@mccd.space> | 2024-05-17 15:07:04 -0500 |
commit | 1b4ed54a85c31a032fbc841c62f674c3a8f2764b (patch) | |
tree | 9544f04a8516b215104c170c3129faa75b33cfe6 | |
parent | 0f36dee9ed3225662e551fce165e30867b246656 (diff) | |
download | stitch-1b4ed54a85c31a032fbc841c62f674c3a8f2764b.tar.gz stitch-1b4ed54a85c31a032fbc841c62f674c3a8f2764b.tar.bz2 stitch-1b4ed54a85c31a032fbc841c62f674c3a8f2764b.zip |
Fix binary release
-rw-r--r-- | Dockerfile | 5 | ||||
-rw-r--r-- | README | 15 | ||||
-rw-r--r-- | bin/dune | 5 | ||||
-rw-r--r-- | lib/grep.ml | 5 |
4 files changed, 18 insertions, 12 deletions
@@ -4,7 +4,7 @@ FROM alpine:edge AS builder RUN apk add --no-cache make m4 which patch sudo wget git pkgconfig \ gcc g++ musl-dev linux-headers libffi libffi-dev pcre perl python3 \ gmp-dev pcre-dev xz-dev gmp xz coreutils \ - ocaml ocaml-compiler-libs ocaml-ocamldoc opam ocaml-findlib openssh + ocaml ocaml-compiler-libs ocaml-ocamldoc opam ocaml-findlib openssh rsync RUN chmod +s `which bwrap` RUN addgroup -g 1000 -S ocaml && adduser -u 1000 -D -S ocaml -G ocaml @@ -16,9 +16,10 @@ RUN eval `opam env --switch=4.14.2` RUN opam install --yes dune && eval `opam env --switch=4.14.2` -COPY --chown=ocaml:ocaml . /tmp/build +COPY --chown=ocaml:ocaml stitch.opam /tmp/build/ WORKDIR /tmp/build RUN git config --global --add safe.directory /tmp/build RUN opam install . --update-invariant --yes +COPY . . CMD eval `opam env` && dune build --profile release @@ -82,8 +82,8 @@ _________________ 1.5 DEVELOPMENT ~~~~~~~~~~~~~~~ - To set up the project for local development, easiest way is to just install Nix, direnv - and enable nix flakes. Then to compile: + To set up the project for local development, easiest way is to + just install Nix, direnv and enable nix flakes. Then to compile: dune build @@ -95,17 +95,20 @@ _________________ dune exec -- stitch --help=groff - To prepare for release, we need to statically link the binary, which unless you use a - musl based distro it will not do out of the box. + To prepare for release, we need to statically link the binary, which + unless you use a musl based distro it will not do out of the box. - There is a Dockerfile included that prepares the release, use it with podman: + There is a Dockerfile included that prepares the release, use it with + podman: podman pull docker.io/alpine:edge podman build . -t stitch:latest mkdir release podman run -v ./release:/tmp/build/_build:U stitch:latest - Binary will be found in ./_build/default/bin/stitch + Binary will be found in ./release/install/default/bin/stitch and + manpages in ./release/install/default/man/man1/stitch.1 + 1.6 ROADMAP @@ -16,11 +16,10 @@ ; Rule to generate a man page for stitch (rule - (target stitch.1) - (action (with-outputs-to %{target} (run stitch --help=groff))) + (target stitch.1) + (action (with-stdout-to %{target} (run stitch --help=groff))) ) -; Install the man page (install (section man) (files stitch.1) diff --git a/lib/grep.ml b/lib/grep.ml index 7ec4c95..2e55b40 100644 --- a/lib/grep.ml +++ b/lib/grep.ml @@ -1,4 +1,7 @@ -let execution_directory = Sys.getenv "STITCH_DIRECTORY" +let execution_directory = + Sys.getenv_opt "STITCH_DIRECTORY" |> Option.value ~default:"/anywhere" + + let grep_cmd = Sys.getenv_opt "STICH_GREP_CMD" |> Option.value ~default:"grep" let tag_pattern = |