opkg

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

gen.lua (2565B)


      1 cflags{
      2 	'-std=c99', '-Wall', '-Wpedantic', '-Wno-maybe-uninitialized', '-Wno-parentheses',
      3 	'-D _DEFAULT_SOURCE',
      4 	'-D _BSD_SOURCE',
      5 	'-D _XOPEN_SOURCE=700',
      6 	'-I $outdir',
      7 }
      8 
      9 lib('libutil.a', [[libutil/(
     10 	concat.c
     11 	cp.c
     12 	crypt.c
     13 	confirm.c
     14 	ealloc.c
     15 	enmasse.c
     16 	eprintf.c
     17 	eregcomp.c
     18 	estrtod.c
     19 	fnck.c
     20 	fshut.c
     21 	getlines.c
     22 	human.c
     23 	linecmp.c
     24 	md5.c
     25 	memmem.c
     26 	mkdirp.c
     27 	mode.c
     28 	parseoffset.c
     29 	putword.c
     30 	reallocarray.c
     31 	recurse.c
     32 	rm.c
     33 	sha1.c
     34 	sha224.c
     35 	sha256.c
     36 	sha384.c
     37 	sha512.c
     38 	sha512-224.c
     39 	sha512-256.c
     40 	strcasestr.c
     41 	strlcat.c
     42 	strlcpy.c
     43 	strnsubst.c
     44 	strsep.c
     45 	strtonum.c
     46 	unescape.c
     47 	writeall.c
     48 )]])
     49 lib('libutf.a', [[libutf/(
     50 	fgetrune.c
     51 	fputrune.c
     52 	isalnumrune.c
     53 	isalpharune.c
     54 	isblankrune.c
     55 	iscntrlrune.c
     56 	isdigitrune.c
     57 	isgraphrune.c
     58 	isprintrune.c
     59 	ispunctrune.c
     60 	isspacerune.c
     61 	istitlerune.c
     62 	isxdigitrune.c
     63 	lowerrune.c
     64 	rune.c
     65 	runetype.c
     66 	upperrune.c
     67 	utf.c
     68 	utftorunestr.c
     69 )]])
     70 
     71 rule('getconf', '$srcdir/scripts/getconf.sh >$out')
     72 build('getconf', '$outdir/getconf.h', {'|', '$srcdir/scripts/getconf.sh'})
     73 
     74 local cmds = {
     75 	'basename',
     76 	'cal',
     77 	'cat',
     78 	'chgrp',
     79 	'chmod',
     80 	'chown',
     81 	'chroot',
     82 	'cksum',
     83 	'cmp',
     84 	'cols',
     85 	'comm',
     86 	'cp',
     87 	'cron',
     88 	'cut',
     89 	'date',
     90 	'dd',
     91 	'dirname',
     92 	'du',
     93 	'echo',
     94 	'ed',
     95 	'env',
     96 	'expand',
     97 	'expr',
     98 	'false',
     99 	'find',
    100 	'flock',
    101 	'fold',
    102 	'getconf',
    103 	'grep',
    104 	'head',
    105 	'hostname',
    106 	'install',
    107 	'join',
    108 	'kill',
    109 	'link',
    110 	'ln',
    111 	'logger',
    112 	'logname',
    113 	'ls',
    114 	'md5sum',
    115 	'mkdir',
    116 	'mkfifo',
    117 	'mknod',
    118 	'mktemp',
    119 	'mv',
    120 	'nice',
    121 	'nl',
    122 	'nohup',
    123 	'od',
    124 	'paste',
    125 	'pathchk',
    126 	'printenv',
    127 	'printf',
    128 	'pwd',
    129 	'readlink',
    130 	'renice',
    131 	'rev',
    132 	'rm',
    133 	'rmdir',
    134 	'sed',
    135 	'seq',
    136 	'setsid',
    137 	'sha1sum',
    138 	'sha224sum',
    139 	'sha256sum',
    140 	'sha384sum',
    141 	'sha512-224sum',
    142 	'sha512-256sum',
    143 	'sha512sum',
    144 	'sleep',
    145 	'sort',
    146 	'split',
    147 	'sponge',
    148 	-- use strings from binutils
    149 	'sync',
    150 	'tail',
    151 	-- use tar from OpenBSD
    152 	'tee',
    153 	'test',
    154 	'tftp',
    155 	'time',
    156 	'touch',
    157 	'tr',
    158 	'true',
    159 	'tsort',
    160 	'tty',
    161 	'uname',
    162 	'unexpand',
    163 	'uniq',
    164 	'unlink',
    165 	'uudecode',
    166 	'uuencode',
    167 	'wc',
    168 	'which',
    169 	'whoami',
    170 	'yes',
    171 }
    172 for _, cmd in ipairs(cmds) do
    173 	local src = cmd
    174 	if src == 'install' then
    175 		src = 'xinstall'
    176 	end
    177 	local deps
    178 	if cmd == 'getconf' then
    179 		deps = {'$outdir/getconf.h'}
    180 	end
    181 	file('bin/'..cmd, '755', exe(cmd, {src..'.c', 'libutil.a', 'libutf.a'}, deps))
    182 	local out = '$srcdir/'..src..'.1'
    183 	file('share/man/man1/'..cmd..'.1', '644', out)
    184 end
    185 
    186 sym('bin/[', 'test')
    187 
    188 -- TODO: binutils'  config/lib-ld.m4 should use AC_REQUIRE([AC_PROG_EGREP]) and
    189 -- $EGREP instead of egrep.
    190 file('bin/egrep', '755', '$dir/egrep')
    191 
    192 fetch('git')