Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: "rm nix/agent-js/agent-js.nix, which is not used by anything (#1008)" #1026

Merged
merged 7 commits into from
Sep 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ rec {

# Agents in varous languages
agent-js-monorepo = pkgs.agent-js-monorepo;
agent-js = import ./nix/agent-js/agent-js.nix { inherit system pkgs; };

# Bootstrap frontend.
bootstrap-js = import ./nix/agent-js/bootstrap-js.nix { inherit system pkgs; };
Expand Down
37 changes: 37 additions & 0 deletions nix/agent-js/agent-js.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ pkgs ? import ../. { inherit system; }, system ? builtins.currentSystem }:
pkgs.stdenv.mkDerivation {
name = "agent-js-monorepo-package-agent";
src = "${pkgs.agent-js-monorepo}";
outputs = [
"out"
"lib"
];
buildInputs = [
pkgs.nodejs
pkgs.agent-js-monorepo
];
configurePhase = ''
export HOME=$(mktemp -d)
'';
buildPhase = ''
cd packages/agent
echo "calling npm pack"
npm pack
cd -
'';
installPhase = ''
# $out: everything
mkdir -p $out
cp -R ${pkgs.agent-js-monorepo.agent}/* $out/
cp -R packages/agent/dfinity-agent*.tgz $out/

# $lib/node_modules: node_modules dir that must be resolvable by npm
# for future build steps to work (e.g. at ../../node_modules)
mkdir -p $lib
agent_node_modules="${pkgs.agent-js-monorepo}/packages/agent/node_modules"
if test -d "$agent_node_modules"; then
cp -R "$agent_node_modules" $lib;
fi

'';
}
4 changes: 2 additions & 2 deletions nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"agent-js-monorepo": {
"ref": "next",
"repo": "ssh://git@github.com/dfinity-lab/agent-js",
"rev": "ccea79546e273892041b3863cf7a5e4ad51c2f07",
"rev": "6caaa829bd7a98e3ed182351f5e1fa744718a3fa",
"type": "git"
},
"bats-support": {
Expand Down Expand Up @@ -44,9 +44,9 @@
"type": "git"
},
"ic-ref": {
"branch": "release-0.10",
"repo": "ssh://git@github.com/dfinity-lab/ic-ref",
"rev": "7d453c4b09f78b3fa1f06df6a3ff00e51b11ca3e",
"branch": "release-0.10",
"type": "git"
},
"motoko": {
Expand Down