Skip to content

Instantly share code, notes, and snippets.

Last active December 20, 2015 22:19
Show Gist options
  • Save chakatz/6204134 to your computer and use it in GitHub Desktop.
Save chakatz/6204134 to your computer and use it in GitHub Desktop.
Build CouchBase 2.1.1 on SmartOS (a Solaris fork)Tested on these images: java:13.1.0 & base64:1.9.1Replace "Trond" to your name in three places before running.
pfexec /opt/local/bin/pkgin -y in libtool-base autoconf \
automake scmgit-base gcc47 \
gnupg gmake libevent icu \
py27-expat snappy erlang- \
pfexec wget -O /opt/local/bin/repo
pfexec chmod a+x /opt/local/bin/repo
pfexec mkdir /opt/couchbase
pfexec chown trond /opt/couchbase
wget --no-check-certificate \
gtar xfz gperftools-2.1.tar.gz
cd gperftools-2.1
./configure --enable-minimal \
--enable-shared \
--disable-static \
gmake install
cd ..
wget --no-check-certificate -Ov8.tar.gz \
gtar xfz v8.tar.gz
cd v8-3.19.0
gmake dependencies
gmake x64 library=shared -j 4
cp out/x64.release/ \
cp include/* /opt/couchbase/include/
mkdir -p ~/.couchbase/build
cat > ~/.couchbase/build/Makefile.extra <<!END!
OPTIONS += CPPFLAGS="-I$(PREFIX)/include -m64"
OPTIONS += LDFLAGS="-R/opt/local/lib -L$(PREFIX)/lib -R$(PREFIX)/lib -m64"
OPTIONS += CXX="g++ -m64 -L/opt/local/lib -I/opt/local/include"
OPTIONS += CC="gcc -m64 -I/opt/local/include -L/opt/local/lib"
memcached_EXTRA_OPTIONS += --enable-tcmalloc-minimal
git config --global "trond.norbye@localhost"
git config --global "Trond Norbye"
git config --global color.ui auto
mkdir compile
cd compile
repo init -u git:// -m released/2.1.1.xml
repo sync
cat > "" <<!END!
--- ep-engine/src/couch-kvstore/ 2013-08-08 08:14:46.840382399 +0000
+++ ep-engine/src/couch-kvstore/ 2013-08-08 08:12:56.808402325 +0000
@@ -515,6 +515,9 @@
char *buffer = NULL;
std::string fname = dbname + "/stats.json";
+ if (access(fname.c_str(), F_OK) == -1) {
+ return;
+ }
std::ifstream session_stats;
session_stats.exceptions (session_stats.failbit | session_stats.badbit);
try {
cd ep-engine/src/couch-kvstore/
patch < ~/compile/
cd -
rm /opt/local/lib/ /opt/local/lib/
gmake PREFIX=/opt/couchbase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment