opkg

statically linked package installer
git clone anongit@rnpnr.xyz:opkg.git
Log | Files | Refs | Feed | Submodules | README | LICENSE

gen.lua (1483B)


      1 set('ninja_required_version', '1.8')
      2 
      3 set('basedir', basedir)
      4 set('builddir', config.builddir)
      5 set('dir', '$basedir')
      6 set('outdir', '$builddir')
      7 
      8 set('repo', config.repo.path)
      9 set('repo_flags', config.repo.flags)
     10 set('repo_tag', config.repo.tag)
     11 set('repo_branch', config.repo.branch)
     12 
     13 include '$basedir/rules.ninja'
     14 
     15 toolchain(config.target)
     16 
     17 subgen('probe')
     18 subgen('pkg')
     19 
     20 build('awk', '$outdir/root.perms', {'$outdir/tree.fspec', '|', '$basedir/scripts/perms.awk'}, {
     21 	expr='-f $basedir/scripts/perms.awk',
     22 })
     23 gitfile('.perms', '644', '$outdir/root.perms')
     24 
     25 build('git-init', '$outdir/root.stamp')
     26 build('git-tree', '$outdir/root.tree', {'$outdir/root.index', '|', '$basedir/scripts/tree.sh', '||', '$outdir/root.stamp'})
     27 build('git-commit', '$outdir/root.commit', {'|', '$outdir/root.tree'})
     28 build('phony', 'commit', '$builddir/root.commit')
     29 
     30 build('fspec-sort', '$outdir/root.fspec', {'$outdir/tree.fspec', '|', '$builddir/pkg/devel/fspec-sync/host/fspec-sort'})
     31 build('fspec-tar', '$outdir/root.tar.zst', {'$outdir/root.fspec', '|', '$builddir/pkg/devel/fspec-sync/host/fspec-tar'})
     32 
     33 --build('awk', '$outdir/root.sqfslist', {'$outdir/root.fspec', '|', '$basedir/scripts/squashfs.awk'}, {
     34 --	expr='-f $basedir/scripts/squashfs.awk',
     35 --})
     36 --rule('gensquashfs', 'gensquashfs -F $in -D . -f -c gzip $out')
     37 --build('gensquashfs', '$outdir/root.squashfs', {'$outdir/root.sqfslist'})
     38 
     39 build('phony', 'build.ninja', 'ninja', {generator='1'})
     40 
     41 io.write('default $builddir/root.tree\n')