about summary refs log tree commit diff
path: root/pkgs/games/build-support/build-sandbox/src/get-closure.cc
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2017-10-03 15:27:24 +0200
committeraszlig <aszlig@redmoonstudios.org>2017-10-03 23:41:31 +0200
commitcf6a986d822fc99e4fde3b82dd8f03aca58482bc (patch)
tree84fd38721d5f7e89dd705cb276ec3619879a9cd3 /pkgs/games/build-support/build-sandbox/src/get-closure.cc
parentc82d21271656400f5e87e0baf46e61224fe1aaa9 (diff)
pkgs/sandbox: Prepare for querying runtime paths
We're now using a makefile for building the sandbox and use pkg-config
to pass in the flags we need for compiling against lib(nix)store.

Right now the sandbox itself doesn't do anything different because we're
not actually using the (incomplete) code for querying the store.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/games/build-support/build-sandbox/src/get-closure.cc')
-rw-r--r--pkgs/games/build-support/build-sandbox/src/get-closure.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/pkgs/games/build-support/build-sandbox/src/get-closure.cc b/pkgs/games/build-support/build-sandbox/src/get-closure.cc
new file mode 100644
index 00000000..11330a9c
--- /dev/null
+++ b/pkgs/games/build-support/build-sandbox/src/get-closure.cc
@@ -0,0 +1,23 @@
+#include <nix/util.hh>
+#include <nix/local-store.hh>
+#include <nix/store-api.hh>
+#include <nix/misc.hh>
+
+using namespace nix;
+
+int get_closure(const char *path)
+{
+    Path query(path);
+    PathSet paths;
+    auto store = openStore(false);
+
+    computeFSClosure(
+        *store, followLinksToStorePath(query), paths, false, true
+    );
+
+    for (auto i = paths.begin(); i != paths.end(); ++i) {
+        // TODO!
+    }
+
+    return 1;
+}