blob: 29898c025acce6bfcddf6caad2b4ff0bfbb3e8b1 [file] [log] [blame]
Radek Krejcicd6b8682016-07-15 10:42:19 +02001#install dependencies using homebrew
2brew update
Radek Krejcida3c2212016-07-15 12:49:13 +02003brew upgrade openssl
Michal Vaskoc0541c82016-07-20 11:56:00 +02004brew link --force openssl
Radek Krejcicd6b8682016-07-15 10:42:19 +02005brew install pcre
6
7set -e
8
9INSTALL_PREFIX_DIR=$HOME/local
10export PKG_CONFIG_PATH=$INSTALL_PREFIX_DIR/lib/pkgconfig:$PKG_CONFIG_PATH
11
12# use cache if present
13if [ ! -d "$INSTALL_PREFIX_DIR/lib" ]; then
14 echo "Building cache."
15 cd ~
16
17 # libssh
18 wget https://git.libssh.org/projects/libssh.git/snapshot/libssh-0.7.3.tar.bz2
19 tar -xjf libssh-0.7.3.tar.bz2
20 mkdir libssh-0.7.3/build && cd libssh-0.7.3/build
Michal Vasko28c26632016-07-20 11:22:16 +020021 cmake -DCMAKE_SHARED_LINKER_FLAGS=-L/usr/local/opt/openssl/lib -DCMAKE_C_FLAGS=-I/usr/local/opt/openssl/include -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
Radek Krejcicd6b8682016-07-15 10:42:19 +020022 cd ../..
23
24 # CMocka
25 wget https://cmocka.org/files/1.0/cmocka-1.0.1.tar.xz
26 tar -xJf cmocka-1.0.1.tar.xz
27 mkdir cmocka-1.0.1/build && cd cmocka-1.0.1/build
28 cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
29 cd ../..
30
31else
32 echo "Using cache ($INSTALL_PREFIX_DIR)."
33fi
Michal Vasko28c26632016-07-20 11:22:16 +020034
Radek Krejcicd6b8682016-07-15 10:42:19 +020035git clone -b $TRAVIS_BRANCH https://github.com/CESNET/libyang.git
36mkdir libyang/build && cd libyang/build
37cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr .. && make -j2 && sudo make install
38cd ../..
39