logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git
commit: 003dbc74886944c98f6ed5bd696bee7e7130c348
parent ce46e7b5099b98406dd7b6013d1ab50aa23de676
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 24 Oct 2017 01:28:38 -0700

Move defaults to config.def.lua

Diffstat:

M.travis.yml11++++++++++-
Mconfig.def.lua31+++++++++++++++++++++++++++++++
Mgen.lua26+++++++++++++-------------
Mpkg/openssh/gen.lua2+-
4 files changed, 55 insertions(+), 15 deletions(-)

diff --git a/.travis.yml b/.travis.yml @@ -17,7 +17,16 @@ install: script: - git submodule update --init pkg/samurai/src - make -C pkg/samurai/src -- echo 'return { fs={exclude={}}, tls="libressl", video_drivers={intel=true, nouveau=true} }' > config.lua +- | + echo 'return { + builddir="out", + fs={exclude={}}, + target={toolchain="x86_64-linux-musl", cflags="-O2 -pipe", cxxflags="$target_cflags", ldflags="-s -static"}, + host={toolchain="default", cflags="-pipe", cxxflags="$host_cflags", ldflags=""}, + repo={path="$builddir/root.git", flags="--bare", tag="tree", branch="master"}, + tls="libressl", + video_drivers={intel=true, nouveau=true} + }' > config.lua - lua setup.lua - ./pkg/samurai/src/samu out/pkg/openbsd/pax out/pkg/mc/bin/6m out/pkg/mc/bin/muse out/pkg/file/file out/pkg/texi2mdoc/texi2mdoc - mkdir /tmp/bin diff --git a/config.def.lua b/config.def.lua @@ -1,10 +1,41 @@ local sets = dofile 'sets.lua' return { + -- build output directory + builddir='out', + + -- package/file selection fs={ + -- Each entry contains a list of packages, a list of patterns to + -- include, and a list of patterns to exclude. If no patterns + -- are specified, all files from the package are included. {sets.core, exclude={'^include/', '^lib/.*%.a$'}}, }, + -- target toolchain and flags + target={ + toolchain='x86_64-linux-musl', + cflags='-O2 -pipe', + cxxflags='$target_cflags', + ldflags='-s -static', + }, + + -- host toolchain and flags + host={ + toolchain='default', + cflags='-pipe', + cxxflags='$host_cflags', + ldflags='', + }, + + -- output git repository + repo={ + path='$builddir/root.git', + flags='--bare', + tag='tree', + branch='master', + }, + -- TLS implementation (possible_values: libressl bearssl) tls='libressl', diff --git a/gen.lua b/gen.lua @@ -1,20 +1,20 @@ -set('builddir', config.builddir or 'out') +set('builddir', config.builddir) set('outdir', '$builddir') -set('target_toolchain', config.target_toolchain or 'x86_64-linux-musl') -set('target_cflags', config.target_cflags or '-O2 -pipe') -set('target_cxxflags', config.target_cxxflags or '$target_cflags') -set('target_ldflags', config.target_ldflags or '-s -static') +set('target_toolchain', config.target.toolchain) +set('target_cflags', config.target.cflags) +set('target_cxxflags', config.target.cxxflags) +set('target_ldflags', config.target.ldflags) -set('host_toolchain', config.host_toolchain or 'default') -set('host_cflags', config.host_cflags or '-pipe') -set('host_cxxflags', config.host_cxxflags or '$host_cflags') -set('host_ldflags', config.host_ldflags or '') +set('host_toolchain', config.host.toolchain) +set('host_cflags', config.host.cflags) +set('host_cxxflags', config.host.cxxflags) +set('host_ldflags', config.host.ldflags) -set('repo', config.repo or '$builddir/root.git') -set('repo_flags', config.repo_flags or '--bare') -set('repo_tag', config.repo_tag or 'tree') -set('repo_branch', config.repo_branch or 'master') +set('repo', config.repo.path) +set('repo_flags', config.repo.flags) +set('repo_tag', config.repo.tag) +set('repo_branch', config.repo.branch) include 'rules.ninja' diff --git a/pkg/openssh/gen.lua b/pkg/openssh/gen.lua @@ -1,4 +1,4 @@ -local arch = config.target_toolchain:match('[^-]*') +local arch = config.target.toolchain:match('[^-]*') cflags{ '-D _XOPEN_SOURCE=600', '-D _DEFAULT_SOURCE',