FreeBSD Installation Guide

This is the thread about FreeBSD Installation Guide. This guide is not officially supported by Rocket.Chat but feel free to contribute and discuss about the topic here.

The Guide can be found here: https://rocket.chat/docs/installation/community-supported-installation/freebsd/

And the github page for that guide can be found here: https://github.com/RocketChat/docs/tree/master/installation/community-supported-installation/freebsd

With a FreeBSD-12.0-RELEASE. system, and small patches, I got to the “meteor --version” step in this guide.

The patches are below.

References:

https://github.com/williambr/meteor
commit 971902171dc0d3fa505a8659bf30ae7060bfb699 (HEAD -> freebsd, origin/freebsd)

git://github.com/williambr/mongo.git
commit ce930379ff5c14534446e8a6c37b1db85f1bd74e (grafted, HEAD -> ssl-r2.6.7, origin/ssl-r2.6.7)

https://github.com/williambr/node.git
cd674f181b4970d19f5a383f40624d6ec103543f (grafted, origin/v0.10.40-with-npm-5821, v0.10.40-with-npm-5821)

After that ./meteor --version fails like this. How to continue???

$ ./meteor --version
meteor: updating npm dependencies -- meteor-deque...
   Building package meteor                   /
/home/rocketchat/meteor/dev_bundle/lib/node_modules/ip-regex/index.js:3
const word = '[a-fA-F\\d:]';
^^^^^
babel-compiler: updating npm dependencies -- meteor-babel...
ecmascript-runtime: updating npm dependencies -- meteor-ecmascript-runtime...
promise: updating npm dependencies -- meteor-promise...
npm-mongo: updating npm dependencies -- mongodb...
logging: updating npm dependencies -- cli-color...
xmlbuilder: updating npm dependencies -- xmlbuilder...
Errors prevented isopacket build:             

While building package meteor:
error: Can't install npm dependencies. Are you connected to the internet?

While building package babel-compiler:
error: Can't install npm dependencies. Are you connected to the internet?

While building package ecmascript-runtime:
error: Can't install npm dependencies. Are you connected to the internet?
error: File not found: .npm/package/node_modules/meteor-ecmascript-runtime/client.js

While building package promise:
error: Can't install npm dependencies. Are you connected to the internet?
error: File not found: .npm/package/node_modules/meteor-promise/promise.bundle.js

While loading plugin `compile-ecmascript` from package `ecmascript`:
module.js:338:15: Cannot find module 'meteor-deque'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object._.extend.Npm.require (/tools/isobuild/bundler.js:1314:22)
at Meteor.startup (packages/meteor/fiber_helpers.js:17:1)
at <runJavaScript-3>:816:4
at <runJavaScript-3>:1274:3


While building package npm-mongo:
error: Can't install npm dependencies. Are you connected to the internet?

While building package logging:
error: Can't install npm dependencies. Are you connected to the internet?

While building package xmlbuilder:
error: Can't install npm dependencies. Are you connected to the internet?

Error: isopacket build failed?
    at Object.ensureIsopacketsLoadable (/tools/tool-env/isopackets.js:197:11)
    at /tools/cli/main.js:743:40

Patches:

Insert in file scripts/build-mongo-for-dev-bundle.sh

cd mongo
rm -rf .git

echo "Applying patch /tmp/mongo.diff"
git apply /tmp/mongo.diff
# Compile

File scripts/build-node-for-dev-bundle.sh

cd node
echo "Apply patch /tmp/node.diff"
git apply /tmp/node.diff


$ cat /tmp/node.diff
diff --git a/deps/v8/src/stub-cache.cc b/deps/v8/src/stub-cache.cc
index 8490c7e..54947e1 100644
--- a/deps/v8/src/stub-cache.cc
+++ b/deps/v8/src/stub-cache.cc
@@ -1361,7 +1361,7 @@ Handle<Code> StubCompiler::GetCodeWithFlags(Code::Flags flags,
                                             Handle<String> name) {
   return (FLAG_print_code_stubs && !name.is_null())
       ? GetCodeWithFlags(flags, *name->ToCString())
-      : GetCodeWithFlags(flags, reinterpret_cast<char*>(NULL));
+      : GetCodeWithFlags(flags, static_cast<char*>(NULL));
 }

$ cat /tmp/mongo.diff
diff --git a/src/mongo/client/connpool.h b/src/mongo/client/connpool.h
index 9bf4583..e6c9a84 100644
--- a/src/mongo/client/connpool.h
+++ b/src/mongo/client/connpool.h
@@ -323,7 +323,8 @@ namespace mongo {
             return _conn;
         }
 
-        bool ok() const { return _conn > 0; }
+        bool ok() const { return _conn != nullptr; }
 
         string getHost() const { return _host; }
 
diff --git a/src/mongo/db/client.h b/src/mongo/db/client.h
index 9c7f594..840090f 100644
--- a/src/mongo/db/client.h
+++ b/src/mongo/db/client.h
@@ -254,6 +254,6 @@ namespace mongo {
         return *c;
     }
 
-    inline bool haveClient() { return currentClient.get() > 0; }
+    inline bool haveClient() { return currentClient.get() != nullptr; }
 
 };
diff --git a/src/mongo/db/fts/fts_matcher.cpp b/src/mongo/db/fts/fts_matcher.cpp
index c9fad05..c4e40a6 100644
--- a/src/mongo/db/fts/fts_matcher.cpp
+++ b/src/mongo/db/fts/fts_matcher.cpp
@@ -128,7 +128,7 @@ namespace mongo {
          * @param haystack, raw string to be parsed
          */
         bool FTSMatcher::_phraseMatches( const string& phrase, const string& haystack ) const {
-            return strcasestr( haystack.c_str(), phrase.c_str() ) > 0;
+            return strcasestr( haystack.c_str(), phrase.c_str() ) != nullptr;
         }
     }
 }
diff --git a/src/mongo/db/structure/catalog/namespace.h b/src/mongo/db/structure/catalog/namespace.h
index fafa10b..976b75d 100644
--- a/src/mongo/db/structure/catalog/namespace.h
+++ b/src/mongo/db/structure/catalog/namespace.h
@@ -55,7 +55,7 @@ namespace mongo {
         bool operator!=(const char *r) const { return strcmp(buf, r) != 0; }
         bool operator!=(const Namespace& r) const { return strcmp(buf, r.buf) != 0; }
 
-        bool hasDollarSign() const { return strchr( buf , '$' ) > 0;  }
+        bool hasDollarSign() const { return strchr( buf , '$' ) != nullptr;  }
 
         int hash() const; // value returned is always > 0
 
diff --git a/src/mongo/s/d_state.cpp b/src/mongo/s/d_state.cpp
index 031ac2a..b43c6fa 100644
--- a/src/mongo/s/d_state.cpp
+++ b/src/mongo/s/d_state.cpp
@@ -830,7 +830,7 @@ namespace mongo {
         if ( ! shardingState.hasVersion( ns ) )
             return false;
 
-        return ShardedConnectionInfo::get(false) > 0;
+        return ShardedConnectionInfo::get(false) != nullptr;
     }
 
     class UnsetShardingCommand : public MongodShardCommand {
diff --git a/src/mongo/s/shard.h b/src/mongo/s/shard.h
index 247fbde..6e88caf 100644
--- a/src/mongo/s/shard.h
+++ b/src/mongo/s/shard.h
@@ -292,7 +292,7 @@ namespace mongo {
             _finishedInit = true;
         }
         
-        bool ok() const { return _conn > 0; }
+        bool ok() const { return _conn != nullptr; }
 
         /**
            this just passes through excpet it checks for stale configs
diff --git a/src/mongo/util/fail_point_registry.cpp b/src/mongo/util/fail_point_registry.cpp
index ad08533..c75da06 100644
--- a/src/mongo/util/fail_point_registry.cpp
+++ b/src/mongo/util/fail_point_registry.cpp
@@ -53,7 +53,7 @@ namespace mongo {
     }
 
     FailPoint* FailPointRegistry::getFailPoint(const string& name) const {
-        return mapFindWithDefault(_fpMap, name, reinterpret_cast<FailPoint *>(NULL));
+        return mapFindWithDefault(_fpMap, name, static_cast<FailPoint *>(NULL));
     }
 
     void FailPointRegistry::freeze() {

make a patch before or after this?

$ cd meteor
$ ./scripts/build-mongo-for-dev-bundle.sh
$ ./scripts/build-node-for-dev-bundle.sh
$ ./scripts/generate-dev-bundle.sh

I had described two patches, see node.diff and mongo.diff above.

Otherwise one wouldn’t get to the last step, ./meteor --version .

What kind of patch are you suggesting? What does this error message suggest?

/home/rocketchat/meteor/dev_bundle/lib/node_modules/ip-regex/index.js:3
const word = '[a-fA-F\\d:]';
^^^^^

I am not an advanced user, so I can’t help you (
Did you install the chat?

try this:
https://rocket.chat/docs/installation/community-supported-installation/freebsd/universal/

meteor was installed, chat no (FreeBSD 11)

1 Like

Rocket Chat installed:

Running Rocket.Chat

First, we need the meteor binary in our $PATH
$ export PATH=$PATH:$HOME/meteor

Next, we need to download Rocket.chat:
$ cd HOME git clone https://github.com/RocketChat/Rocket.Chat.git
$ cd Rocket.Chat