Add build script for the standard package manager

This commit is contained in:
Dimitri Lozeve 2022-09-11 12:24:27 +02:00
parent 971edb23ad
commit fda72624d1
4 changed files with 41 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
*\~ *\~
sncf sncf
build-deps*

View file

@ -62,11 +62,25 @@ Arguments:
** Building instructions ** Building instructions
*** Static executable using Docker
The build script will use Docker to build a fully static executable. The build script will use Docker to build a fully static executable.
The Dockerfile is based on the [[https://hub.docker.com/r/gerbil/alpine][gerbil/alpine]] image. The Dockerfile is based on the [[https://hub.docker.com/r/gerbil/alpine][gerbil/alpine]] image.
#+begin_src sh #+begin_src sh
$ ./build.sh ./build.sh
#+end_src #+end_src
This project depends on [[https://github.com/dlozeve/fancy][dlozeve/fancy]]. *** With your local [[https://cons.io/][Gerbil]] installation
This project depends on [[https://github.com/dlozeve/fancy][dlozeve/fancy]]. Install it with the package
manager:
#+begin_src sh
gxpkg install github.com/dlozeve/fancy
#+end_src
The project comes with a build script for the [[https://cons.io/guide/build.html][standard build tool]],
which installs the =sncf= executable in =$GERBIL_HOME/bin=:
#+begin_src sh
./build.ss
#+end_src

23
build.ss Executable file
View file

@ -0,0 +1,23 @@
#!/usr/bin/env gxi
(import :std/make)
;; the build specification
(def build-spec
'((exe: "sncf")))
;; the source directory anchor
(def srcdir
(path-normalize (path-directory (this-source-file))))
;; the main function of the script
(def (main . args)
(match args
;; this is the default (and, here, only) action, which builds the project
([]
(make srcdir: srcdir ; source anchor
;;bindir: srcdir ; where to place executables; default is GERBIL_PATH/bin
optimize: #t ; enable optimizations
debug: #f ; enable debugger introspection
static: #t ; don't generate static compilation artifacts
build-spec)))) ; the actual build specification

1
gerbil.pkg Normal file
View file

@ -0,0 +1 @@
(package: dlozeve)