summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ffmpeg/gen.lua8
-rw-r--r--pkg/mpv/gen.lua5
-rw-r--r--pkg/nginx/gen.lua25
-rw-r--r--pkg/nsd/gen.lua3
-rw-r--r--pkg/python/gen.lua7
5 files changed, 18 insertions, 30 deletions
diff --git a/pkg/ffmpeg/gen.lua b/pkg/ffmpeg/gen.lua
index 360cd677..f6ca6e68 100644
--- a/pkg/ffmpeg/gen.lua
+++ b/pkg/ffmpeg/gen.lua
@@ -52,7 +52,7 @@ pkg.deps = {
}
local options = {}
-for line in io.lines(pkg.dir..'/options.h') do
+for line in iterlines('options.h', 1) do
local cfg, val = line:match('^#define ([^ ]+) ([^ ]+)')
if cfg then
options[cfg] = val == '1'
@@ -67,7 +67,7 @@ local sources = {
libswresample={},
libswscale={},
}
-for line in io.lines(pkg.dir..'/sources.txt') do
+for line in iterlines('sources.txt', 1) do
local i = line:find(' ', 1, true)
local cfg = line:sub(1, i and i - 1)
if options[cfg] then
@@ -89,10 +89,6 @@ end
for lib, srcs in pairs(sources) do
sources[lib] = table.keys(srcs)
end
-table.insert(pkg.inputs.gen, {
- '$dir/sources.txt',
- '$dir/options.h',
-})
cc('libavcodec/bitstream_filters.c', {'$outdir/internal/libavcodec/bsf_list.c'})
lib('libavcodec.a', {
diff --git a/pkg/mpv/gen.lua b/pkg/mpv/gen.lua
index 868cfd20..73f18b32 100644
--- a/pkg/mpv/gen.lua
+++ b/pkg/mpv/gen.lua
@@ -46,14 +46,14 @@ for _, f in ipairs{'assdraw', 'defaults', 'options', 'osc', 'ytdl_hook'} do
end
local options = {}
-for line in io.lines(pkg.dir..'/config.h') do
+for line in iterlines('config.h', 1) do
local var, val = line:match('^#define ([^ ]+) ([^ ]+)')
if var and val == '1' then
options[var] = true
end
end
local sources = {}
-for line in io.lines(pkg.dir..'/sources.txt') do
+for line in iterlines('sources.txt', 1) do
local i = line:find(' ', 1, true)
local add = true
if i then
@@ -69,7 +69,6 @@ for line in io.lines(pkg.dir..'/sources.txt') do
end
end
sources = table.keys(sources)
-table.insert(pkg.inputs.gen, {'$dir/config.h', '$dir/sources.txt'})
if options['HAVE_ALSA'] then
cflags{'-I $builddir/pkg/alsa-lib/include'}
diff --git a/pkg/nginx/gen.lua b/pkg/nginx/gen.lua
index c70321f9..f17523ba 100644
--- a/pkg/nginx/gen.lua
+++ b/pkg/nginx/gen.lua
@@ -8,10 +8,8 @@ local libs = {}
pkg.deps = {}
local modules = {}
-for line in io.lines(pkg.dir..'/modules.txt') do
- if #line > 0 then
- modules[line] = true
- end
+for line in iterlines('modules.txt') do
+ modules[line] = true
end
if modules['openssl'] then
@@ -28,7 +26,7 @@ if modules['regex'] then
table.insert(pkg.deps, 'pkg/pcre/headers')
end
local zlib = modules['http_gzip_filter'] or modules['http_gunzip_filter']
-for line in io.lines(pkg.dir..'/ngx_auto_config.h') do
+for line in iterlines('ngx_auto_config.h', 1) do
if line == 'NGX_ZLIB 1' then
zlib = true
break
@@ -130,15 +128,13 @@ local sources = paths[[src/(
ngx_linux_sendfile_chain.c
)
)]]
-for line in io.lines(pkg.dir..'/sources.txt') do
- if #line > 0 and not line:hasprefix('#') then
- local i = line:find(' ', 1, true)
- if modules[line:sub(1, i and i - 1)] then
- while i do
- local j = line:find(' ', i + 1, true)
- table.insert(sources, 'src/'..line:sub(i + 1, j and j - 1))
- i = j
- end
+for line in iterlines('sources.txt') do
+ local i = line:find(' ', 1, true)
+ if modules[line:sub(1, i and i - 1)] then
+ while i do
+ local j = line:find(' ', i + 1, true)
+ table.insert(sources, 'src/'..line:sub(i + 1, j and j - 1))
+ i = j
end
end
end
@@ -158,4 +154,3 @@ build('sed', '$outdir/nginx.8', '$srcdir/docs/man/nginx.8', {
man{'$outdir/nginx.8'}
fetch 'git'
-table.insert(pkg.inputs.gen, {'$dir/sources.txt', '$dir/modules.txt', '$dir/ngx_auto_config.h'})
diff --git a/pkg/nsd/gen.lua b/pkg/nsd/gen.lua
index 773adffb..cecb7468 100644
--- a/pkg/nsd/gen.lua
+++ b/pkg/nsd/gen.lua
@@ -28,8 +28,7 @@ local cfg = {
chrootdir='',
ratelimit_default='on',
}
-table.insert(pkg.inputs.gen, '$dir/config.h')
-for line in io.lines(pkg.dir..'/config.h') do
+for line in iterlines('config.h', 1) do
local var, val = line:match('^#define (%g+) "(%g+)"$')
if var then
cfg[var:lower()] = val
diff --git a/pkg/python/gen.lua b/pkg/python/gen.lua
index 98517143..b9e01bec 100644
--- a/pkg/python/gen.lua
+++ b/pkg/python/gen.lua
@@ -9,8 +9,8 @@ cflags{
local sources = {}
local modules = {}
-for line in io.lines(pkg.dir..'/Setup') do
- if #line > 0 and not line:find('^[*#]') then
+for line in iterlines('Setup') do
+ if not line:hasprefix('*') then
local i = line:find(' ', 1, true)
modules[line:sub(1, i and i - 1)] = true
while i do
@@ -70,7 +70,7 @@ cc('Modules/getpath.c', nil, {
local platform = 'linux'
local abiflags = ''
-for line in io.lines(pkg.dir..'/pyconfig.h') do
+for line in iterlines('pyconfig.h', 1) do
if line == '#define WITH_PYMALLOC 1' then
abiflags = abiflags..'m'
elseif line == '#define Py_DEBUG 1' then
@@ -211,5 +211,4 @@ file('lib/python3.6/_sysconfigdata_'..abiflags..'_'..platform..'_.py', '644', '$
file('lib/python3.6/Makefile', '644', '$dir/lib/Makefile')
dir('lib/python3.6/lib-dynload', '755')
-table.insert(pkg.inputs.gen, {'$dir/Setup', '$dir/pyconfig.h'})
fetch 'curl'