about summary refs log tree commit diff
path: root/src/libstore/local.mk
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-05-30T15·40+0200
committerEelco Dolstra <edolstra@gmail.com>2017-05-30T15·40+0200
commitacc889c82179e96537ebe1494ec13b9536d579ca (patch)
treeeeff56d8de6984cdbfe8dd661de9fb6d14c1d8a8 /src/libstore/local.mk
parent53a16441878ebd4a5ac6ef8a95a649bfd521da3d (diff)
Darwin sandbox: Use sandbox-defaults.sb
Issue #759.

Also, remove nix.conf from the sandbox since I don't really see a
legitimate reason for builders to access the Nix configuration.
Diffstat (limited to 'src/libstore/local.mk')
-rw-r--r--src/libstore/local.mk14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/libstore/local.mk b/src/libstore/local.mk
index ffdb55abc65b..7bc69f65d800 100644
--- a/src/libstore/local.mk
+++ b/src/libstore/local.mk
@@ -34,12 +34,16 @@ libstore_CXXFLAGS = \
  -DSANDBOX_SHELL="\"$(sandbox_shell)\"" \
  -DLSOF=\"$(lsof)\"
 
-$(d)/local-store.cc: $(d)/schema.sql.hh
+$(d)/local-store.cc: $(d)/schema.sql.gen.hh
 
-%.sql.hh: %.sql
-	$(trace-gen) sed -e 's/"/\\"/g' -e 's/\(.*\)/"\1\\n"/' < $< > $@ || (rm $@ && exit 1)
+$(d)/build.cc: $(d)/sandbox-defaults.sb.gen.hh
 
-clean-files += $(d)/schema.sql.hh
+%.gen.hh: %
+	echo 'R"foo(' >> $@.tmp
+	cat $< >> $@.tmp
+	echo ')foo"' >> $@.tmp
+	mv $@.tmp $@
+
+clean-files += $(d)/schema.sql.gen.hh $(d)/sandbox-defaults.sb.gen.hh
 
 $(eval $(call install-file-in, $(d)/nix-store.pc, $(prefix)/lib/pkgconfig, 0644))
-$(eval $(call install-file-in, $(d)/sandbox-defaults.sb, $(datadir)/nix, 0644))