linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 7d6f9dcc0e7ec907ea0b399c33b139c2f1758e66
parent 3f21300869465f08278b0c1813bed008dc4ba066
Author: Jul <jul@9o.is>
Date:   Sat,  8 Nov 2025 01:49:08 -0500

remove all build calls in ninja functions

Diffstat:
Mconfigure | 2+-
Mninja/functions.sh | 99++++++++++++++++++++++++++++++++++++++-----------------------------------------
Mninja/rules.ninja | 16++++++----------
Mpkg/vis/gen.sh | 8++++----
4 files changed, 58 insertions(+), 67 deletions(-)

diff --git a/configure b/configure @@ -23,4 +23,4 @@ require $TARGET_PLATFORM-ar require $TARGET_PLATFORM-as require $TARGET_PLATFORM-objcopy -gen ${1-.} ${2-} +maingen ${1-.} ${2-} diff --git a/ninja/functions.sh b/ninja/functions.sh @@ -42,33 +42,28 @@ build() { printf 'build %s: %s %s\n' "$_v2" "$_v1" "$_vs" >> "$_ninja_writepath" } -copy() { - build copy $1 ${2-$1} -} - -cat() { - build cat $* -} - -touch() { - build touch "$*" -} - -gzip() { - build gzip $* -} - -awk() { - build awk $* -} - -sed() { - build sed $* -} - -cpp() { - build cpp $* -} +gen() { build gen $*; } +cc() { build cc $*; } +ar() { build ar $*; } +rsp() { build rsp $*; } +fetch_git() { build fetch_git $*; } +fetch_curl() { build fetch_curl $*; } +sha256sum() { build sha256sum $*; } +extract() { build extract $*; } +extract_decompress() { build extract_decompress $*; } +fspec() { build fspec $*; } +fspec_tar() { build fspec_tar $*; } +qubes_fspec() { build qubes_fspec $*; } +qubes_install() { build qubes_install $*; } +link() { build link $*; } +copy() { build copy $*; } +cat() { build cat $*; } +touch() { build touch $*; } +gzip() { build gzip $*; } +awk() { build awk $*; } +sed() { build sed $*; } +cpp() { build cpp $*; } +patch() { build patch $*; } cflags() { setv cflags '$cflags' "$*" @@ -84,7 +79,7 @@ bin() { _ninja_fspec /bin/$_fn reg 0755 0 0 $_out case $1 in - \$*) build copy $_out $1;; + \$*) copy $_out $1;; esac } @@ -108,7 +103,7 @@ etc() { _ninja_prefix _src $etcdir $1 _out=$outdir/_files/etc/$1 _ninja_fspec /etc/$1 ${3-reg} ${2-0644} 0 0 $_out - build copy $_out $_src + copy $_out $_src } man() { @@ -183,7 +178,7 @@ include() { case $_src in \$srcdir/*) _out=$outdir/include/${__prefix}${_src##*/} - build copy $_out $_src + copy $_out $_src ;; *) _out=$_src @@ -228,7 +223,7 @@ subgen() { _ninja_buffer_subgen="$_ninja_buffer_subgen $1" } -gen() { +maingen() { _ninja_init $1 _ninja_setv_init $1 _ninja_targets_init @@ -239,7 +234,7 @@ gen() { set -- $_ninja_queue_subgen _v1=$1; shift; _ninja_queue_subgen="$*" - gen $_v1 + maingen $_v1 fi } @@ -449,7 +444,7 @@ _ninja_compile() { _src="$_src || $_hdrs" fi - build cc $_obj $_src + cc $_obj $_src _objs="$_objs $_obj" _ninja_buffer_objs="$_ninja_buffer_objs $_obj" done @@ -471,10 +466,10 @@ _ninja_flush_exe() { awk $_rspfile $_deps '|' $basedir/ninja/rsp.awk bind expr '-f $basedir/ninja/rsp.awk' - build link $_out $_objs $_libs '|' $_rspfile + link $_out $_objs $_libs '|' $_rspfile bind ldlibs @$_rspfile elif [ "$_objs" ]; then - build link $_out $_objs $_libs + link $_out $_objs $_libs fi } @@ -489,8 +484,8 @@ _ninja_flush_lib() { _ninja_compile $* if [ "$_objs" ]; then - build ar $_out $_objs $_libs - build rsp $_out.d $outdir/$_out $_libs + ar $_out $_objs $_libs + rsp $_out.d $outdir/$_out $_libs fi } @@ -540,7 +535,7 @@ _ninja_flush_fetch() { case $1 in git) - build fetch-git $_fetchdir/fetched + fetch_git $_fetchdir/fetched ;; curl) shift @@ -549,26 +544,26 @@ _ninja_flush_fetch() { _srcs=$* _name=${_url##*/} - build fetch-curl $_fetchdir/$_name + fetch_curl $_fetchdir/$_name bind url $_url - build sha256sum $_fetchdir/checked $_fetchdir/$_name + sha256sum $_fetchdir/checked $_fetchdir/$_name bind sha256 $_sha256 case $_name in *.tar.gz|*.tgz) _archive=${_name%.t*gz}.tar _tool=gzip - _extract_rule=extract-decompress + _extract_rule=extract_decompress ;; *.tar.xz) _archive=${_name%.xz} _tool=xz - _extract_rule=extract-decompress + _extract_rule=extract_decompress ;; *.tar.bz2) _archive=${_name%.bz2} _tool=bzip2 - _extract_rule=extract-decompress + _extract_rule=extract_decompress ;; *) _archive=$_name @@ -576,7 +571,7 @@ _ninja_flush_fetch() { ;; esac - build $_extract_rule $_fetchdir/fetched $_fetchdir/$_name '|' $hostdir/pax $_fetchdir/checked ${_tool_dep-} + $_extract_rule $_fetchdir/fetched $_fetchdir/$_name '|' $hostdir/pax $_fetchdir/checked ${_tool_dep-} bind tool $_tool bind srcs $_srcs @@ -632,19 +627,19 @@ _ninja_flush_build() { fi ;; tpl) - build fspec-tar $outdir/root.tar.zstd '|' $hostdir/fspec-tar $outdir/_fspec/ALL + fspec_tar $outdir/root.tar.zstd '|' $hostdir/fspec-tar $outdir/_fspec/ALL build phony $tgtdir/build $outdir/root.tar.zstd if [ "$_ninja_template" ]; then set -- $_ninja_template if [ $# -lt 3 ]; then - build qubes-fspec $outdir/qubes-installed '|' $basedir/ninja/qubes-fspec.sh $hostdir/pax $outdir/root.tar.zstd + qubes_fspec $outdir/qubes-installed '|' $basedir/ninja/qubes-fspec.sh $hostdir/pax $outdir/root.tar.zstd bind template $1 bind path $2 bind tar $outdir/root.tar.zstd else - build qubes-install $outdir/qubes-installed '|' $basedir/ninja/qubes-install.sh $hostdir/pax $outdir/root.tar.zstd + qubes_install $outdir/qubes-installed '|' $basedir/ninja/qubes-install.sh $hostdir/pax $outdir/root.tar.zstd bind template $1 bind label $2 bind size $3 @@ -679,7 +674,7 @@ _ninja_flush_sync() { build phony $tgtdir/sync $outdir/_synced for src in $_ninja_buffer_sync; do - build copy $outdir/_sync/${src#$etcdir/} $src + copy $outdir/_sync/${src#$etcdir/} $src done if [ "$_ninja_buffer_sync" ]; then @@ -697,7 +692,7 @@ _ninja_flush_sync() { for _v in "$_ninja_dir"/patch/*.patch; do _out=$_fetchdir/${_v##*/} _in=$dir/${_v#"$_ninja_dir"/} - build patch $_out $_in '|' $_fetchdir/fetched $_patches + patch $_out $_in '|' $_fetchdir/fetched $_patches _patches="$_patches $_out" done fi @@ -745,9 +740,9 @@ _ninja_flush_fspec() { dep='| $basedir/ninja/fspec.sh $hostdir/fspec-hash' if [ $type = reg ]; then - build fspec $out $src $dep + fspec $out $src $dep else - build fspec $out $dep + fspec $out $dep fi bind path $path @@ -795,7 +790,7 @@ _ninja_flush_configure() { done build phony $gendir/configure $ninjadir/$_ninja_file $_subgens - build gen $ninjadir/$_ninja_file '|' $basedir/config.sh $basedir/ninja/functions.sh $dir/gen.sh + gen $ninjadir/$_ninja_file '|' $basedir/config.sh $basedir/ninja/functions.sh $dir/gen.sh } _ninja_flush_default() { diff --git a/ninja/rules.ninja b/ninja/rules.ninja @@ -33,10 +33,6 @@ rule copy command = ln -f $in $out description = COPY $out -rule sym - command = rm -f $out && ln -s $$(basename $in) $out - description = SYM $out - rule touch command = touch $out description = TOUCH $out @@ -63,17 +59,17 @@ rule fspec command = sh $basedir/ninja/fspec.sh $out $path $type $mode $uid $gid $in $target >/dev/null description = FSPEC $out -rule fspec-tar +rule fspec_tar command = $hostdir/fspec-tar <$outdir/_fspec/ALL | zstd >$out description = FSPEC-TAR $out -rule fetch-curl +rule fetch_curl command = rm -f $out && curl -L# -o $out $url description = FETCH CURL $out generator = 1 pool = console -rule fetch-git +rule fetch_git command = git submodule update --init --checkout $srcdir && touch $out description = FETCH GIT $gendir generator = 1 @@ -87,7 +83,7 @@ rule extract command = rm -rf $srcdir && $hostdir/pax -r -s ',^[^/]*,$srcdir,' $srcs <$in && touch $out description = EXTRACT $srcdir -rule extract-decompress +rule extract_decompress command = rm -rf $srcdir && $tool -c -d <$in | $hostdir/pax -r -s ',^[^/]*,$srcdir,' $srcs && touch $out description = EXTRACT/DECOMPRESS $srcdir @@ -99,11 +95,11 @@ rule sed command = sed $expr $in >$out description = SED $out -rule qubes-install +rule qubes_install command = sh $basedir/ninja/qubes-install.sh $template $label $size $tar && touch $out description = QUBES-INSTALL $template pool = console -rule qubes-fspec +rule qubes_fspec command = sh $basedir/ninja/qubes-fspec.sh $template $path $tar && touch $out description = QUBES-FSPEC $template diff --git a/pkg/vis/gen.sh b/pkg/vis/gen.sh @@ -71,9 +71,9 @@ exe vis " exe vis-digraph vis-digraph.c exe vis-menu vis-menu.c -copy vis-complete -copy vis-clipboard -copy vis-open +copy vis-complete vis-complete +copy vis-clipboard vis-clipboard +copy vis-open vis-open visman() { sed _man/$1 man/$1 @@ -96,7 +96,7 @@ visman vis-menu.1 visman vis-open.1 for f in $(command cat $DIR/lua.txt | xargs); do - copy lua/$f + copy lua/$f lua/$f reg $outdir/lua/$f /share/vis/$f done