From 0bf66bd8d1a1db8c512c66069731bf67a9836a44 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 3 Oct 2017 21:32:35 +0200 Subject: pkgs/sandbox: Mount paths from path-like variables On NixOS the LD_LIBRARY_PATH looks similar to this (depending on the configuration): /run/opengl-driver/lib:/run/opengl-driver-32/lib However, we don't have these paths available within the sandbox, because so far we've only used exportReferencesGraph to gather the runtime dependencies after the build has succeeded. This obviously doesn't take into account runtime dependencies from the system itself. We are now taking care of this by using the Nix store library to query the requisities of all the paths that are contained inside path-like variables (multiple paths delimited by colons) and mount them during sandbox setup. Signed-off-by: aszlig --- pkgs/games/build-support/build-sandbox/src/Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'pkgs/games/build-support/build-sandbox/src/Makefile') diff --git a/pkgs/games/build-support/build-sandbox/src/Makefile b/pkgs/games/build-support/build-sandbox/src/Makefile index 49b266fe..f662b5ba 100644 --- a/pkgs/games/build-support/build-sandbox/src/Makefile +++ b/pkgs/games/build-support/build-sandbox/src/Makefile @@ -1,10 +1,14 @@ BINARIES = $(wildcard $(BINDIR)/*) WRAPPERS = $(subst $(BINDIR),$(out)/bin,$(BINARIES)) -OBJECTS = get-closure.o params.o setup.o +NIX_VERSION = `pkg-config --modversion nix-main | \ + sed -e 's/^\([0-9]\+\)\.\([0-9]\+\).*/\1\2/'` -CFLAGS = -Wall -std=gnu11 -DFS_ROOT_DIR=\"$(out)\" -CXXFLAGS = -Wall -std=c++14 `pkg-config --cflags nix-main` +OBJECTS = nix-query.o params.o setup.o + +CFLAGS = -g -Wall -std=gnu11 -DFS_ROOT_DIR=\"$(out)\" +CXXFLAGS = -g -Wall -std=c++14 `pkg-config --cflags nix-main` +CXXFLAGS += -DNIX_VERSION=$(NIX_VERSION) LDFLAGS = `pkg-config --libs nix-main` all: $(OBJECTS) -- cgit 1.4.1