From de5cc96286df0b16d20278e33f7d3fa276e133d7 Mon Sep 17 00:00:00 2001 From: Joe Groff Date: Fri, 18 Nov 2011 18:39:19 -0800 Subject: [PATCH] new module tools.deploy.embed: make self-exe image --- basis/tools/deploy/embed/authors.txt | 1 + basis/tools/deploy/embed/embed.factor | 17 +++++++++++++++++ basis/tools/deploy/embed/summary.txt | 1 + basis/tools/deploy/embed/tags.txt | 1 + 4 files changed, 20 insertions(+) create mode 100644 basis/tools/deploy/embed/authors.txt create mode 100644 basis/tools/deploy/embed/embed.factor create mode 100644 basis/tools/deploy/embed/summary.txt create mode 100644 basis/tools/deploy/embed/tags.txt diff --git a/basis/tools/deploy/embed/authors.txt b/basis/tools/deploy/embed/authors.txt new file mode 100644 index 0000000000..f13c9c1e77 --- /dev/null +++ b/basis/tools/deploy/embed/authors.txt @@ -0,0 +1 @@ +Joe Groff diff --git a/basis/tools/deploy/embed/embed.factor b/basis/tools/deploy/embed/embed.factor new file mode 100644 index 0000000000..02b9a5db8c --- /dev/null +++ b/basis/tools/deploy/embed/embed.factor @@ -0,0 +1,17 @@ +! (c)2010 Joe Groff bsd license +USING: alien.c-types alien.data bootstrap.image +bootstrap.image.private destructors io io.directories +io.encodings.binary io.files locals system ; +IN: tools.deploy.embed + +:: embed-image ( from-image to-executable -- ) + vm to-executable copy-file + to-executable binary [| out | + out stream-tell :> offset + from-image binary [| in | + in out stream-copy* + ] with-disposal + image-magic uintptr_t out stream-write + offset uintptr_t out stream-write + ] with-disposal ; + diff --git a/basis/tools/deploy/embed/summary.txt b/basis/tools/deploy/embed/summary.txt new file mode 100644 index 0000000000..b54209ae2a --- /dev/null +++ b/basis/tools/deploy/embed/summary.txt @@ -0,0 +1 @@ +Embed a Factor image into a VM to create a single standalone executable file diff --git a/basis/tools/deploy/embed/tags.txt b/basis/tools/deploy/embed/tags.txt new file mode 100644 index 0000000000..8541464a78 --- /dev/null +++ b/basis/tools/deploy/embed/tags.txt @@ -0,0 +1 @@ +deploy