From b529d91902a46e1fe0954d44fbc3622edcbe99ca Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sat, 13 Jan 2024 15:47:08 -0500 Subject: [PATCH] Prefix `-DNIX_` paths to be windows-complient for windows This is a hacky solution, but it will do for now. --- src/libstore/local.mk | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/libstore/local.mk b/src/libstore/local.mk index b74a047bf23..6be748581a3 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -43,17 +43,28 @@ ifdef HOST_WINDOWS INCLUDE_libstore += -I $(d)/windows endif +ifdef HOST_WINDOWS +NIX_ROOT = N:\\\\ +else +NIX_ROOT = +endif + +# Prefix all but `NIX_STORE_DIR`, since we aren't doing a local store +# yet so a "logical" store dir that is the same as unix is prefered. +# +# Also, it keeps the unit tests working. + libstore_CXXFLAGS += \ $(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libstore) \ - -DNIX_PREFIX=\"$(prefix)\" \ + -DNIX_PREFIX=\"$(NIX_ROOT)$(prefix)\" \ -DNIX_STORE_DIR=\"$(storedir)\" \ - -DNIX_DATA_DIR=\"$(datadir)\" \ - -DNIX_STATE_DIR=\"$(localstatedir)/nix\" \ - -DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \ - -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ - -DNIX_BIN_DIR=\"$(bindir)\" \ - -DNIX_MAN_DIR=\"$(mandir)\" \ - -DLSOF=\"$(lsof)\" + -DNIX_DATA_DIR=\"$(NIX_ROOT)$(datadir)\" \ + -DNIX_STATE_DIR=\"$(NIX_ROOT)$(localstatedir)/nix\" \ + -DNIX_LOG_DIR=\"$(NIX_ROOT)$(localstatedir)/log/nix\" \ + -DNIX_CONF_DIR=\"$(NIX_ROOT)$(sysconfdir)/nix\" \ + -DNIX_BIN_DIR=\"$(NIX_ROOT)$(bindir)\" \ + -DNIX_MAN_DIR=\"$(NIX_ROOT)$(mandir)\" \ + -DLSOF=\"$(NIX_ROOT)$(lsof)\" ifeq ($(embedded_sandbox_shell),yes) libstore_CXXFLAGS += -DSANDBOX_SHELL=\"__embedded_sandbox_shell__\"