From 26e55ced73cb1154906f11b7d6e965cb816a09fe Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 28 Mar 2016 21:59:05 +1000 Subject: Add stuff to build external projects NetSurf and polipo. --- build.lua | 5 +++++ src/others/build_NetSurf.lua | 48 ++++++++++++++++++++++++++++++++++++++++++++ src/others/build_polipo.lua | 17 ++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100755 src/others/build_NetSurf.lua create mode 100755 src/others/build_polipo.lua diff --git a/build.lua b/build.lua index 5661025..115c791 100755 --- a/build.lua +++ b/build.lua @@ -26,6 +26,11 @@ runCommand = function (name, dir, command) os.execute('cd ' .. dir .. '; ' .. command) end +cloneGit = function (name, dir, repo, branch) + runCommand(nil, dir, 'rm -rf ' .. name) + runCommand(nil, dir, 'git clone git://' .. repo .. '/' .. name) +end + compileFiles = function (name, dir, files, extras) local objects = '' print('\n' .. name) diff --git a/src/others/build_NetSurf.lua b/src/others/build_NetSurf.lua new file mode 100755 index 0000000..517d673 --- /dev/null +++ b/src/others/build_NetSurf.lua @@ -0,0 +1,48 @@ +#!/usr/bin/env luajit + +local dir = ... + +if 'nil' == type(dir) then + local build, err = loadfile('../../build.lua') + if build then + setfenv(build, getfenv(2)) + build(2) + else + print("ERROR - " .. err) + end + dir = workingDir +end + +local tools = {"buildsystem", "libnsutils", "nsgenbind"} +local libs = {"libwapcaplet", "libparserutils", "libhubbub", + "libcss", + "libdom", + + "libnsbmp", + "libnsgif", + "librosprite", + "libsvgtiny", + "libutf8proc", + } + +instDir = dir .. '/netsurf/inst' +exports = 'export PKG_CONFIG_PATH=' .. instDir .. '/lib/pkgconfig::;' .. +'export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:' .. instDir .. '/lib;' .. +'export PATH=${PATH}:' ..instDir .. '/bin;' .. +'export PREFIX=' .. instDir .. '; ' + +runCommand(nil, '.', 'rm -rf netsurf; mkdir -p netsurf/inst') + +for i, v in ipairs(tools) do + cloneGit(v, 'netsurf', 'git.netsurf-browser.org', '') + runCommand('NetSurf tool - ' .. v, 'netsurf', exports .. 'cd ' .. v .. '; make install') +end + +for i, v in ipairs(libs) do + cloneGit(v, 'netsurf', 'git.netsurf-browser.org', '') + runCommand('NetSurf lib - ' .. v, 'netsurf', exports .. 'cd ' .. v .. '; make install') +end + +local v = 'netsurf' +cloneGit(v, 'netsurf', 'git.netsurf-browser.org', '') +runCommand('NetSurf', 'netsurf', exports .. 'cd ' .. v .. '; make && cp nsgtk ../inst/bin/netsurf') diff --git a/src/others/build_polipo.lua b/src/others/build_polipo.lua new file mode 100755 index 0000000..23fdde3 --- /dev/null +++ b/src/others/build_polipo.lua @@ -0,0 +1,17 @@ +#!/usr/bin/env luajit + +local dir = ... + +if 'nil' == type(dir) then + local build, err = loadfile('../../build.lua') + if build then + setfenv(build, getfenv(2)) + build(2) + else + print("ERROR - " .. err) + end + dir = workingDir +end + +cloneGit('polipo', '.', 'github.com/jech', '') +runCommand(nil, 'polipo', 'make') -- cgit v1.1