diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-01-27 17:17:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-27 17:17:58 +0100 |
commit | b8f345b29a65669f4d6966ba3837fda2341c5ec2 (patch) | |
tree | 7bfb6b59ad8e48454e4311307277017ab6b392de | |
parent | 12de0466fea6558ccb0dd5b98b72d7a068c9b5e8 (diff) | |
parent | 6af6e41df06f0a8a3b919b4052b41d09f0a97678 (diff) |
Merge pull request #4483 from shlevy/libcmd
Move command plugin interface to libnixcmd
-rw-r--r-- | Makefile | 1 | ||||
-rw-r--r-- | src/build-remote/build-remote.cc | 2 | ||||
-rw-r--r-- | src/libcmd/command.cc (renamed from src/nix/command.cc) | 0 | ||||
-rw-r--r-- | src/libcmd/command.hh (renamed from src/nix/command.hh) | 0 | ||||
-rw-r--r-- | src/libcmd/installables.cc (renamed from src/nix/installables.cc) | 0 | ||||
-rw-r--r-- | src/libcmd/installables.hh (renamed from src/nix/installables.hh) | 0 | ||||
-rw-r--r-- | src/libcmd/legacy.cc (renamed from src/nix/legacy.cc) | 0 | ||||
-rw-r--r-- | src/libcmd/legacy.hh (renamed from src/nix/legacy.hh) | 0 | ||||
-rw-r--r-- | src/libcmd/local.mk | 15 | ||||
-rw-r--r-- | src/libcmd/markdown.cc (renamed from src/nix/markdown.cc) | 0 | ||||
-rw-r--r-- | src/libcmd/markdown.hh (renamed from src/nix/markdown.hh) | 0 | ||||
-rw-r--r-- | src/libcmd/nix-cmd.pc.in | 9 | ||||
-rwxr-xr-x | src/nix-build/nix-build.cc | 2 | ||||
-rwxr-xr-x | src/nix-channel/nix-channel.cc | 2 | ||||
-rw-r--r-- | src/nix-collect-garbage/nix-collect-garbage.cc | 2 | ||||
-rwxr-xr-x | src/nix-copy-closure/nix-copy-closure.cc | 2 | ||||
-rw-r--r-- | src/nix-env/nix-env.cc | 2 | ||||
-rw-r--r-- | src/nix-instantiate/nix-instantiate.cc | 2 | ||||
-rw-r--r-- | src/nix-store/nix-store.cc | 2 | ||||
-rw-r--r-- | src/nix/daemon.cc | 2 | ||||
-rw-r--r-- | src/nix/local.mk | 4 |
21 files changed, 36 insertions, 11 deletions
@@ -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 \ diff --git a/src/build-remote/build-remote.cc b/src/build-remote/build-remote.cc index 17a0a8373..5b8ab3387 100644 --- a/src/build-remote/build-remote.cc +++ b/src/build-remote/build-remote.cc @@ -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; diff --git a/src/nix/command.cc b/src/libcmd/command.cc index 614dee788..614dee788 100644 --- a/src/nix/command.cc +++ b/src/libcmd/command.cc diff --git a/src/nix/command.hh b/src/libcmd/command.hh index ed6980075..ed6980075 100644 --- a/src/nix/command.hh +++ b/src/libcmd/command.hh diff --git a/src/nix/installables.cc b/src/libcmd/installables.cc index 4e6bf4a9a..4e6bf4a9a 100644 --- a/src/nix/installables.cc +++ b/src/libcmd/installables.cc diff --git a/src/nix/installables.hh b/src/libcmd/installables.hh index f37b3f829..f37b3f829 100644 --- a/src/nix/installables.hh +++ b/src/libcmd/installables.hh diff --git a/src/nix/legacy.cc b/src/libcmd/legacy.cc index 6df09ee37..6df09ee37 100644 --- a/src/nix/legacy.cc +++ b/src/libcmd/legacy.cc diff --git a/src/nix/legacy.hh b/src/libcmd/legacy.hh index f503b0da3..f503b0da3 100644 --- a/src/nix/legacy.hh +++ b/src/libcmd/legacy.hh diff --git a/src/libcmd/local.mk b/src/libcmd/local.mk new file mode 100644 index 000000000..ab0e0e43d --- /dev/null +++ b/src/libcmd/local.mk @@ -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)) diff --git a/src/nix/markdown.cc b/src/libcmd/markdown.cc index 40788a42f..40788a42f 100644 --- a/src/nix/markdown.cc +++ b/src/libcmd/markdown.cc diff --git a/src/nix/markdown.hh b/src/libcmd/markdown.hh index 78320fcf5..78320fcf5 100644 --- a/src/nix/markdown.hh +++ b/src/libcmd/markdown.hh diff --git a/src/libcmd/nix-cmd.pc.in b/src/libcmd/nix-cmd.pc.in new file mode 100644 index 000000000..1761a9f41 --- /dev/null +++ b/src/libcmd/nix-cmd.pc.in @@ -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 diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc index d1c14596c..361f9730d 100755 --- a/src/nix-build/nix-build.cc +++ b/src/nix-build/nix-build.cc @@ -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; diff --git a/src/nix-channel/nix-channel.cc b/src/nix-channel/nix-channel.cc index 309970df6..57189d557 100755 --- a/src/nix-channel/nix-channel.cc +++ b/src/nix-channel/nix-channel.cc @@ -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> diff --git a/src/nix-collect-garbage/nix-collect-garbage.cc b/src/nix-collect-garbage/nix-collect-garbage.cc index 57092b887..c1769790a 100644 --- a/src/nix-collect-garbage/nix-collect-garbage.cc +++ b/src/nix-collect-garbage/nix-collect-garbage.cc @@ -2,7 +2,7 @@ #include "profiles.hh" #include "shared.hh" #include "globals.hh" -#include "../nix/legacy.hh" +#include "legacy.hh" #include <iostream> #include <cerrno> diff --git a/src/nix-copy-closure/nix-copy-closure.cc b/src/nix-copy-closure/nix-copy-closure.cc index 10990f7b5..ad2e06067 100755 --- a/src/nix-copy-closure/nix-copy-closure.cc +++ b/src/nix-copy-closure/nix-copy-closure.cc @@ -1,6 +1,6 @@ #include "shared.hh" #include "store-api.hh" -#include "../nix/legacy.hh" +#include "legacy.hh" using namespace nix; diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index d6a16999f..106a78fc4 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -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> diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc index 3956fef6d..ea2e85eb0 100644 --- a/src/nix-instantiate/nix-instantiate.cc +++ b/src/nix-instantiate/nix-instantiate.cc @@ -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> diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index b7eda5ba6..37191b9e6 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -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> diff --git a/src/nix/daemon.cc b/src/nix/daemon.cc index a358cb0d9..26006167d 100644 --- a/src/nix/daemon.cc +++ b/src/nix/daemon.cc @@ -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> diff --git a/src/nix/local.mk b/src/nix/local.mk index 23c08fc86..83b6dd08b 100644 --- a/src/nix/local.mk +++ b/src/nix/local.mk @@ -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 |