opkg

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

gen.lua (3211B)


      1 sub('libnatpmp.ninja', function()
      2 	cflags{'-D ENABLE_STRNATPMPERR'}
      3 	lib('libnatpmp.a', 'third-party/libnatpmp/(getgateway.c natpmp.c wingettimeofday.c)')
      4 end)
      5 sub('libminiupnp.ninja', function()
      6 	cflags{
      7 		'-D _GNU_SOURCE',
      8 		'-I $outdir/miniupnpc',
      9 		'-isystem $outdir/pkg/sys/openbsd/include',
     10 	}
     11 
     12 	build('sed', '$outdir/miniupnpc/miniupnpcstrings.h', '$srcdir/third-party/miniupnpc/miniupnpcstrings.h.in', {
     13 		expr='-e s,OS/version,Linux, -e s,version,,',
     14 	})
     15 
     16 	lib('libminiupnp.a', [[
     17 		third-party/miniupnpc/(
     18 			connecthostport.c
     19 			igd_desc_parse.c
     20 			minisoap.c
     21 			minissdpc.c
     22 			miniupnpc.c
     23 			miniwget.c
     24 			minixml.c
     25 			portlistingparse.c
     26 			receivedata.c
     27 			upnpcommands.c
     28 			upnpdev.c
     29 			upnperrors.c
     30 			upnpreplyparse.c
     31 		)
     32 	]], {'$outdir/miniupnpc/miniupnpcstrings.h', 'pkg/sys/openbsd/headers'})
     33 end)
     34 
     35 cflags({
     36 	'-D __TRANSMISSION__',
     37 	'-I $dir',
     38 	'-I $srcdir',
     39 	'-I $srcdir/third-party',
     40 	'-I $srcdir/third-party/libb64/include',
     41 	'-I $srcdir/third-party/libnatpmp',
     42 	'-isystem $builddir/pkg/libs/bearssl/include',
     43 	'-isystem $builddir/pkg/libs/libevent/include',
     44 	'-isystem $builddir/pkg/libs/libutp/include',
     45 	'-isystem $builddir/pkg/libs/zlib/include',
     46 	'-isystem $builddir/pkg/net/curl/include',
     47 	'-isystem $builddir/pkg/sys/openbsd/include',
     48 	'-include config.h',
     49 })
     50 
     51 pkg.deps = {
     52 	'pkg/libs/bearssl/headers',
     53 	'pkg/libs/libevent/headers',
     54 	'pkg/libs/libutp/headers',
     55 	'pkg/libs/zlib/headers',
     56 	'pkg/net/curl/headers',
     57 	'pkg/sys/openbsd/headers',
     58 }
     59 
     60 lib('libtransmission.a', [[
     61 	libtransmission/(
     62 		announcer.c
     63 		announcer-http.c
     64 		announcer-udp.c
     65 		bandwidth.c
     66 		bitfield.c
     67 		blocklist.c
     68 		cache.c
     69 		clients.c
     70 		completion.c
     71 		ConvertUTF.c
     72 		crypto.c
     73 		crypto-utils.c
     74 		crypto-utils-fallback.c
     75 		error.c
     76 		fdlimit.c
     77 		file.c
     78 		handshake.c
     79 		history.c
     80 		inout.c
     81 		list.c
     82 		log.c
     83 		magnet.c
     84 		makemeta.c
     85 		metainfo.c
     86 		natpmp.c
     87 		net.c
     88 		peer-io.c
     89 		peer-mgr.c
     90 		peer-msgs.c
     91 		platform.c
     92 		platform-quota.c
     93 		port-forwarding.c
     94 		ptrarray.c
     95 		quark.c
     96 		resume.c
     97 		rpcimpl.c
     98 		rpc-server.c
     99 		session.c
    100 		session-id.c
    101 		stats.c
    102 		torrent.c
    103 		torrent-ctor.c
    104 		torrent-magnet.c
    105 		tr-assert.c
    106 		tr-dht.c
    107 		tr-lpd.c
    108 		tr-udp.c
    109 		tr-utp.c
    110 		tr-getopt.c
    111 		trevent.c
    112 		upnp.c
    113 		utils.c
    114 		variant.c
    115 		variant-benc.c
    116 		variant-json.c
    117 		verify.c
    118 		watchdir.c
    119 		watchdir-generic.c
    120 		web.c
    121 		webseed.c
    122 		wildmat.c
    123 
    124 		watchdir-inotify.c
    125 		file-posix.c
    126 		subprocess-posix.c
    127 		crypto-utils-bearssl.c
    128 	)
    129 	libb64.a libdht.a libminiupnp.a libnatpmp.a
    130 	$builddir/pkg/(
    131 		libs/bearssl/libbearssl.a
    132 		libs/libevent/libevent.a
    133 		libs/libutp/libutp.a
    134 		libs/zlib/libz.a
    135 		net/curl/libcurl.a.d
    136 	)
    137 ]])
    138 
    139 lib('libb64.a', {'third-party/libb64/src/cdecode.c', 'third-party/libb64/src/cencode.c'})
    140 lib('libdht.a', {'third-party/dht/dht.c'})
    141 
    142 exe('transmission-daemon', {
    143 	'daemon/daemon.c',
    144 	'daemon/daemon-posix.c',
    145 	'libtransmission.a.d',
    146 })
    147 file('bin/transmission-daemon', '755', '$outdir/transmission-daemon')
    148 man({'daemon/transmission-daemon.1'})
    149 
    150 for _, tool in ipairs({'create', 'edit', 'remote', 'show'}) do
    151 	exe('transmission-'..tool, {'utils/'..tool..'.c', 'libtransmission.a.d'})
    152 	file('bin/transmission-'..tool, '755', '$outdir/transmission-'..tool)
    153 	man({'utils/transmission-'..tool..'.1'})
    154 end
    155 
    156 fetch('curl')