Skip to content

Commit

Permalink
Merge pull request #4483 from shlevy/libcmd
Browse files Browse the repository at this point in the history
Move command plugin interface to libnixcmd
  • Loading branch information
edolstra authored Jan 27, 2021
2 parents 12de046 + 6af6e41 commit b8f345b
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 11 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion src/build-remote/build-remote.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions src/libcmd/local.mk
Original file line number Diff line number Diff line change
@@ -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))
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions src/libcmd/nix-cmd.pc.in
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion src/nix-build/nix-build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/nix-channel/nix-channel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/nix-collect-garbage/nix-collect-garbage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "profiles.hh"
#include "shared.hh"
#include "globals.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"

#include <iostream>
#include <cerrno>
Expand Down
2 changes: 1 addition & 1 deletion src/nix-copy-closure/nix-copy-closure.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "shared.hh"
#include "store-api.hh"
#include "../nix/legacy.hh"
#include "legacy.hh"

using namespace nix;

Expand Down
2 changes: 1 addition & 1 deletion src/nix-env/nix-env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/nix-instantiate/nix-instantiate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/nix-store/nix-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion src/nix/daemon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions src/nix/local.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b8f345b

Please sign in to comment.