Skip to content

Commit

Permalink
libaquarium: Start work on installer program using libaquarium
Browse files Browse the repository at this point in the history
  • Loading branch information
obiwac committed Dec 22, 2022
1 parent eb14046 commit be28514
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2,023 deletions.
17 changes: 12 additions & 5 deletions build.wren
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,13 @@ cc.add_opt("-Wextra")
var lib_src = File.list("src/lib")
.where { |path| path.endsWith(".c") }

var cmd_src = File.list("src/cmd")
var aquarium_src = File.list("src/aquarium")
.where { |path| path.endsWith(".c") }

var src = lib_src.toList + cmd_src.toList
var installer_src = File.list("src/installer")
.where { |path| path.endsWith(".c") }

var src = lib_src.toList + aquarium_src.toList + installer_src

src
.each { |path| cc.compile(path) }
Expand All @@ -32,10 +35,13 @@ var linker = Linker.new(cc)
linker.archive(lib_src.toList, "libaquarium.a")
linker.link(lib_src.toList, ["archive", "copyfile", "crypto", "fetch", "geom", "jail", "mkfs_msdos", "pkg", "zfs"], "libaquarium.so", true)

// create command-line frontend
// XXX in fine, we won't need all these dependencies; they're only here while libaquarium is being worked on
// create aquarium command-line frontend

linker.link(aquarium_src.toList, ["aquarium", "archive", "copyfile", "crypto", "fetch", "jail"], "aquarium")

// create installer command-line frontend

linker.link(cmd_src.toList, ["aquarium", "archive", "copyfile", "crypto", "fetch", "jail"], "aquarium")
linker.link(installer_src.toList, ["aquarium"], "installer")

// copy over headers

Expand All @@ -62,6 +68,7 @@ class Installer {

var install = {
"aquarium": "%(Meta.prefix())/bin/aquarium",
"installer": "%(Meta.prefix())/bin/installer",
"libaquarium.a": "%(Meta.prefix())/lib/libaquarium.a",
"libaquarium.so": "%(Meta.prefix())/lib/libaquarium.so",
"aquarium.h": "%(Meta.prefix())/include/aquarium.h",
Expand Down
2 changes: 1 addition & 1 deletion src/aquarium.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ static char* aquariums_path;
static char* sanctioned_templates;
static char* aquarium_db_path;

static void __dead2 usage(void) {
static void usage(void) {
fprintf(stderr,
"usage: %1$s [-r base]\n"
" %1$s [-r base] -c path [-t template] [-k kernel_template]\n"
Expand Down
Loading

0 comments on commit be28514

Please sign in to comment.