Move command plugin interface to libnixcmd

This commit is contained in:
Shea Levy 2021-01-26 06:22:24 -05:00
parent 36c4d6f592
commit 6af6e41df0
No known key found for this signature in database
GPG Key ID: 5C0BD6957D86FE27
21 changed files with 36 additions and 11 deletions

View File

@ -7,6 +7,7 @@ makefiles = \
src/libfetchers/local.mk \
src/libmain/local.mk \
src/libexpr/local.mk \
src/libcmd/local.mk \
src/nix/local.mk \
src/resolve-system-dependencies/local.mk \
scripts/local.mk \

View File

@ -17,7 +17,7 @@
#include "store-api.hh"
#include "derivations.hh"
#include "local-store.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
using namespace nix;
using std::cin;

15
src/libcmd/local.mk Normal file
View File

@ -0,0 +1,15 @@
libraries += libcmd
libcmd_NAME = libnixcmd
libcmd_DIR := $(d)
libcmd_SOURCES := $(wildcard $(d)/*.cc)
libcmd_CXXFLAGS += -I src/libutil -I src/libstore -I src/libexpr -I src/libmain -I src/libfetchers
libcmd_LDFLAGS = -llowdown
libcmd_LIBS = libstore libutil libexpr libmain libfetchers
$(eval $(call install-file-in, $(d)/nix-cmd.pc, $(prefix)/lib/pkgconfig, 0644))

9
src/libcmd/nix-cmd.pc.in Normal file
View File

@ -0,0 +1,9 @@
prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
Name: Nix
Description: Nix Package Manager
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lnixcmd
Cflags: -I${includedir}/nix -std=c++17

View File

@ -17,7 +17,7 @@
#include "get-drvs.hh"
#include "common-eval-args.hh"
#include "attr-path.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
using namespace nix;
using namespace std::string_literals;

View File

@ -2,7 +2,7 @@
#include "globals.hh"
#include "filetransfer.hh"
#include "store-api.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include "fetchers.hh"
#include <fcntl.h>

View File

@ -2,7 +2,7 @@
#include "profiles.hh"
#include "shared.hh"
#include "globals.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include <iostream>
#include <cerrno>

View File

@ -1,6 +1,6 @@
#include "shared.hh"
#include "store-api.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
using namespace nix;

View File

@ -14,7 +14,7 @@
#include "json.hh"
#include "value-to-json.hh"
#include "xml-writer.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include <cerrno>
#include <ctime>

View File

@ -10,7 +10,7 @@
#include "store-api.hh"
#include "local-fs-store.hh"
#include "common-eval-args.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include <map>
#include <iostream>

View File

@ -9,7 +9,7 @@
#include "util.hh"
#include "worker-protocol.hh"
#include "graphml.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include <iostream>
#include <algorithm>

View File

@ -8,7 +8,7 @@
#include "globals.hh"
#include "derivations.hh"
#include "finally.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"
#include "daemon.hh"
#include <algorithm>

View File

@ -14,9 +14,9 @@ nix_SOURCES := \
$(wildcard src/nix-instantiate/*.cc) \
$(wildcard src/nix-store/*.cc) \
nix_CXXFLAGS += -I src/libutil -I src/libstore -I src/libfetchers -I src/libexpr -I src/libmain
nix_CXXFLAGS += -I src/libutil -I src/libstore -I src/libfetchers -I src/libexpr -I src/libmain -I src/libcmd
nix_LIBS = libexpr libmain libfetchers libstore libutil
nix_LIBS = libexpr libmain libfetchers libstore libutil libcmd
nix_LDFLAGS = -pthread $(SODIUM_LIBS) $(EDITLINE_LIBS) $(BOOST_LDFLAGS) -llowdown