157 lines
3.4 KiB
Groff
157 lines
3.4 KiB
Groff
.\" SPDX-FileType: DOCUMENTATION
|
|
.\" SPDX-FileCopyrightText: 2022 Anna <cyber@sysrq.in>
|
|
.\" SPDX-License-Identifier: BSD-3-Clause
|
|
.Dd July 2, 2022
|
|
.Dt NIMBUS 1
|
|
.Os
|
|
.Sh NAME
|
|
.Nm nimbus
|
|
.Nd a Nim build system
|
|
.Sh SYNOPSIS
|
|
.Nm
|
|
.Op Fl Fl debug
|
|
.Op Fl Fl binDir : Ns Ar path
|
|
.Op Fl Fl nimbleDir : Ns Ar path
|
|
.Op Fl Fl nim : Ns Ar path
|
|
.Op Fl Fl nimcache : Ns Ar path
|
|
.Op Fl Fl url : Ns Ar url
|
|
.Op nim opts...
|
|
.Ar sourceDir
|
|
.Op Ar buildDir
|
|
.Sh DESCRIPTION
|
|
The
|
|
.Nm
|
|
meta-build system generates files for the Ninja build system from Nimble projects.
|
|
.Pp
|
|
The arguments are as follows:
|
|
.Bl -tag -width Ds
|
|
.It Ar sourceDir
|
|
Source directory,
|
|
location where package's
|
|
.Sy .nimble
|
|
file is placed.
|
|
.
|
|
.It Ar buildDir
|
|
Build directory,
|
|
location where all generated files should be placed.
|
|
If this argument is omitted, the current directory is used instead.
|
|
.Pp
|
|
Note that the build directory must be different from the source directory.
|
|
.Nm
|
|
does not support building inside the source directory and attempting to do that leads to an error.
|
|
.
|
|
.It Fl Fl binDir : Ns Ar path
|
|
Set the executable directory, where project's binaries will be installed.
|
|
.
|
|
.It Fl Fl debug
|
|
Show debugging information.
|
|
.
|
|
.It Fl Fl nimbleDir : Ns Ar path
|
|
Set the Nimble directory, where project's sources will be installed.
|
|
.
|
|
.It Fl Fl nim : Ns Ar path
|
|
Set the Nim executable.
|
|
.
|
|
.It Fl Fl nimcache : Ns Ar path
|
|
Set the Nim cache base directory.
|
|
Caches for individual targets will be created there.
|
|
.
|
|
.It Fl Fl url : Ns Ar url
|
|
If this options is set,
|
|
.Nm
|
|
will generate and install a
|
|
.Pa nimblemeta.json
|
|
file.
|
|
Some packages specify their dependencies using URLs and
|
|
.Nm
|
|
is unable to find them unless such metadata file exists.
|
|
.El
|
|
.Pp
|
|
All unrecognized flags are passed to the Nim compiler.
|
|
.
|
|
.Ss NimScript tasks
|
|
.Nm
|
|
will create a ninja target for each task defined in the
|
|
.Pa .nimble
|
|
file.
|
|
.
|
|
.Ss Running tests
|
|
If no tasks named
|
|
.Qq test
|
|
exist,
|
|
.Nm
|
|
generates a tester script that can be invoked via
|
|
.Ql ninja test .
|
|
It will compile and run all Nim files in the
|
|
.Pa tests
|
|
directory beginning with
|
|
.Qq t
|
|
in their filename.
|
|
.Pp
|
|
This behavior is compatible with nimble.
|
|
.
|
|
.Ss Installing
|
|
.Nm
|
|
generates an installer script that can be invoked via
|
|
.Ql ninja install .
|
|
It installs both sources and binaries
|
|
.Pq if any .
|
|
.Pp
|
|
If any of the
|
|
.Va installDirs , installFiles , installExt
|
|
variables are present in the
|
|
.Pa .nimble
|
|
file,
|
|
.Nm
|
|
operates in the whitelist mode.
|
|
Please refer the to the nimble documentation for more information.
|
|
.Sh ENVIRONMENT
|
|
.Bl -tag -width DESTDIR
|
|
.It Ev DESTDIR
|
|
A variable prepended to each installed target file.
|
|
.El
|
|
.Sh FILES
|
|
The
|
|
.Nm
|
|
meta-build system generates the following files:
|
|
.Bl -tag -width nimblemeta.json
|
|
.It Pa build.ninja
|
|
Build file for a ninja-compatible build system.
|
|
.It Pa installer.nims
|
|
Script for installing packages.
|
|
.It Pa nimblemeta.json
|
|
Metadata file that contains package URL.
|
|
.It Pa querytool.nims
|
|
Script for extracting metadata from
|
|
.Pa .nimble
|
|
files.
|
|
.It Pa tester.nims
|
|
Script for running Nimble-style tests.
|
|
.El
|
|
.Sh EXIT STATUS
|
|
.Ex -std
|
|
.Sh EXAMPLES
|
|
Build and install a project:
|
|
.Bd -literal
|
|
mkdir build
|
|
cd build
|
|
nimbus ..
|
|
ninja
|
|
sudo ninja install
|
|
.Ed
|
|
.Sh SEE ALSO
|
|
.Xr txt2deps 1
|
|
.Bl -bullet -width 1n
|
|
.It
|
|
.Lk https://nim-lang.org/docs/nimc.html "Nim compiler user guide"
|
|
.It
|
|
.Lk https://github.com/nim-lang/nimble "Nimble package manager"
|
|
.It
|
|
.Lk https://ninja-build.org/manual.html "Ninja manual"
|
|
.El
|
|
.Sh AUTHORS
|
|
.An -split
|
|
.An Anna
|
|
.Aq Mt cyber@sysrq.in
|
|
.An Nimble Authors
|