From 62d02d52c7586b6235e14365f8f346fb31e3415d Mon Sep 17 00:00:00 2001 From: PeterLee Date: Fri, 8 Jun 2018 12:02:46 +0800 Subject: [PATCH 1/2] update build for Sandstorm, add dependence capnp. --- .sandstorm/build.sh | 1 + .sandstorm/setup.sh | 13 +++++++++++++ packages/rocketchat-sandstorm/server/lib.js | 2 +- packages/rocketchat-sandstorm/server/powerbox.js | 3 ++- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.sandstorm/build.sh b/.sandstorm/build.sh index 976f897db276..c8a155a2a351 100755 --- a/.sandstorm/build.sh +++ b/.sandstorm/build.sh @@ -5,6 +5,7 @@ set -euvo pipefail # Make meteor bundle sudo chown vagrant:vagrant /home/vagrant -R cd /opt/app +meteor npm install capnp meteor npm install meteor build --directory /home/vagrant/ diff --git a/.sandstorm/setup.sh b/.sandstorm/setup.sh index 423fb38486cf..78e930e23a16 100755 --- a/.sandstorm/setup.sh +++ b/.sandstorm/setup.sh @@ -23,11 +23,24 @@ tar xf "$CACHE_TARGET" # Create symlink so we can rely on the path /opt/meteor-spk ln -s "${PACKAGE}" meteor-spk +#This will install capnp, the Cap’n Proto command-line tool. +#It will also install libcapnp, libcapnpc, and libkj in /usr/local/lib and headers in /usr/local/include/capnp and /usr/local/include/kj. +wget https://capnproto.org/capnproto-c++-0.5.3.tar.gz +tar zxf capnproto-c++-0.5.3.tar.gz +cd capnproto-c++-0.5.3 +./configure +make -j6 check +# inlcude libcapnp and libkj library to dependencies. +cp .libs/* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ + # Add bash, and its dependencies, so they get mapped into the image. # Bash runs the launcher script. cp -a /bin/bash /opt/meteor-spk/meteor-spk.deps/bin/ cp -a /lib/x86_64-linux-gnu/libncurses.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ cp -a /lib/x86_64-linux-gnu/libtinfo.so.* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ +# for npm in package.json sharp. +cp -a /lib/x86_64-linux-gnu/libresolv* /opt/meteor-spk/meteor-spk.deps/lib/x86_64-linux-gnu/ + # Unfortunately, Meteor does not explicitly make it easy to cache packages, but # we know experimentally that the package is mostly directly extractable to a diff --git a/packages/rocketchat-sandstorm/server/lib.js b/packages/rocketchat-sandstorm/server/lib.js index bb5055b50aa4..efa04f45e553 100644 --- a/packages/rocketchat-sandstorm/server/lib.js +++ b/packages/rocketchat-sandstorm/server/lib.js @@ -5,7 +5,7 @@ import Future from 'fibers/future'; RocketChat.Sandstorm = {}; if (process.env.SANDSTORM === '1') { - const Capnp = require('/node_modules/capnp.js'); + import Capnp from 'capnp'; const SandstormHttpBridge = Capnp.importSystem('sandstorm/sandstorm-http-bridge.capnp').SandstormHttpBridge; let capnpConnection = null; diff --git a/packages/rocketchat-sandstorm/server/powerbox.js b/packages/rocketchat-sandstorm/server/powerbox.js index c644286c3926..2b064232bcd1 100644 --- a/packages/rocketchat-sandstorm/server/powerbox.js +++ b/packages/rocketchat-sandstorm/server/powerbox.js @@ -3,7 +3,8 @@ RocketChat.Sandstorm.offerUiView = function() {}; if (process.env.SANDSTORM === '1') { - const Capnp = require('/node_modules/capnp.js'); + + import Capnp from 'capnp'; const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp'); const Grain = Capnp.importSystem('sandstorm/grain.capnp'); From 71fe467f427c10c18711d31e2440a7500459e1e5 Mon Sep 17 00:00:00 2001 From: PeterLee Date: Fri, 8 Jun 2018 14:09:41 +0800 Subject: [PATCH 2/2] update import capnp --- packages/rocketchat-sandstorm/server/lib.js | 2 +- packages/rocketchat-sandstorm/server/powerbox.js | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/rocketchat-sandstorm/server/lib.js b/packages/rocketchat-sandstorm/server/lib.js index efa04f45e553..3c274fbedfeb 100644 --- a/packages/rocketchat-sandstorm/server/lib.js +++ b/packages/rocketchat-sandstorm/server/lib.js @@ -5,7 +5,7 @@ import Future from 'fibers/future'; RocketChat.Sandstorm = {}; if (process.env.SANDSTORM === '1') { - import Capnp from 'capnp'; + const Capnp = require('capnp'); const SandstormHttpBridge = Capnp.importSystem('sandstorm/sandstorm-http-bridge.capnp').SandstormHttpBridge; let capnpConnection = null; diff --git a/packages/rocketchat-sandstorm/server/powerbox.js b/packages/rocketchat-sandstorm/server/powerbox.js index 2b064232bcd1..96ee75b23ffa 100644 --- a/packages/rocketchat-sandstorm/server/powerbox.js +++ b/packages/rocketchat-sandstorm/server/powerbox.js @@ -3,8 +3,7 @@ RocketChat.Sandstorm.offerUiView = function() {}; if (process.env.SANDSTORM === '1') { - - import Capnp from 'capnp'; + const Capnp = require('capnp'); const Powerbox = Capnp.importSystem('sandstorm/powerbox.capnp'); const Grain = Capnp.importSystem('sandstorm/grain.capnp');