Skip to content

Commit

Permalink
add build-twister.sh to mac os x
Browse files Browse the repository at this point in the history
  • Loading branch information
dryabov committed Mar 27, 2014
1 parent 05d0d32 commit 4f0b1c9
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
11 changes: 9 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,13 @@ module.exports = function (grunt) {
cwd: 'build/releases/twister/mac/',
src: ['**'],
expand: true
},
{
cwd: 'build-linux/',
src: ['build-twister.sh'],
dest: 'twister/',
mode: 484, // = 0744
expand: true
}
]
},
Expand All @@ -177,7 +184,7 @@ module.exports = function (grunt) {
dest: 'twister/',
mode: 484, // = 0744
expand: true
},
}
]
},
twister_linux_x64: {
Expand All @@ -203,7 +210,7 @@ module.exports = function (grunt) {
dest: 'twister/',
mode: 484, // = 0744
expand: true
},
}
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"main": "index.html",
"name": "twister",
"version": "0.9.19.17",
"version": "0.9.19.16",
"description": "P2P microbloging system",
"window": {
"title": "Twister",
Expand Down
16 changes: 15 additions & 1 deletion build-linux/build-twister.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#!/bin/bash -x
echo "Twister - p2p microbloging system - daemon installer"

echo "Installing dependencies"
sudo apt-get install autoconf build-essential git libboost-all-dev libdb++-dev libminiupnpc-dev libssl-dev libtool

echo "Cloning twister-core repository"
git clone https://github.com/miguelfreitas/twister-core.git
cd twister-core

echo "Configuring twister-daemon"
./autotool.sh
./configure
./configure --enable-logging

echo "Building twister daemon"
make

echo "Copying twisterd to /usr/local/bin"
sudo cp -i twisterd /usr/local/bin

echo "OK, twisterd has been built successfully"
echo "-------------"
42 changes: 42 additions & 0 deletions build-mac/build-twister.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
echo "Twister - p2p microbloging system - daemon installer"

which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
# https://github.com/mxcl/homebrew/wiki/installation
echo "Instaling brew"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
else
echo "Updating brew"
brew update
fi

echo "Installing dependencies"
which -s git || brew install git
which -s boost || brew install boost
which -s miniupnpc || brew install miniupnpc
which -s openssl || brew install openssl
which -s berkeley-db4 || brew install berkeley-db4
which -s autoconf || brew install autoconf
which -s automake || brew install automake
which -s libtool || brew install libtool

echo "Cloning twister-core repository"
git clone https://github.com/miguelfreitas/twister-core.git
cd twister-core

echo "Configuring twister-daemon"
./autotool.sh
./configure --enable-logging --with-openssl=/usr/local/opt/openssl --with-libdb=/usr/local/opt/berkeley-db4

echo "Building twister daemon"
CPUCORES=$(sysctl hw.ncpu | awk '{print $2}')
echo "You have $CPUCORES cores in your CPU"
make -j $CPUCORES

echo "Copying twisterd to /usr/local/bin"
sudo cp -i twisterd /usr/local/bin

echo "OK, twisterd has been built successfully"
echo "-------------"

0 comments on commit 4f0b1c9

Please sign in to comment.