Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/pkg
Path: blob/main/scripts/install_deps.sh
2065 views
1
#! /bin/sh
2
# Copyright (c) 2012 Bryan Drewery <[email protected]>
3
# All rights reserved.
4
#
5
# Redistribution and use in source and binary forms, with or without
6
# modification, are permitted provided that the following conditions
7
# are met:
8
# 1. Redistributions of source code must retain the above copyright
9
# notice, this list of conditions and the following disclaimer
10
# in this position and unchanged.
11
# 2. Redistributions in binary form must reproduce the above copyright
12
# notice, this list of conditions and the following disclaimer in the
13
# documentation and/or other materials provided with the distribution.
14
#
15
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
16
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18
# IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
19
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20
# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24
# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25
26
# Install build dependencies for pkg on Mac or Linux (Debiaun/Ubuntu) systems.
27
#
28
# This script is primarily intended for travis CI to be able to setup the
29
# build environment.
30
31
install_from_github() {
32
local name="${1}"
33
local ver="${2}"
34
local distname="${name}-${ver}"
35
36
# https://github.com/jmmv/kyua/releases/download/kyua-0.12/kyua-0.12.tar.gz
37
local url="https://github.com/jmmv/${name}"
38
wget "${url}/releases/download/${distname}/${distname}.tar.gz"
39
tar -xzvf "${distname}.tar.gz"
40
41
cd "${distname}"
42
./configure \
43
--disable-developer \
44
--without-atf \
45
--without-doxygen \
46
CPPFLAGS="-I/usr/local/include" \
47
LDFLAGS="-L/usr/local/lib -Wl,-R/usr/local/lib" \
48
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig"
49
make
50
if [ `id -u` -eq 0 ]; then
51
make install
52
else
53
sudo make install
54
fi
55
cd -
56
57
rm -rf "${distname}" "${distname}.tar.gz"
58
}
59
60
if [ $(uname -s) = "Darwin" ]; then
61
brew install libarchive kyua coreutils
62
elif [ $(uname -s) = "Linux" ]; then
63
install_from_github atf 0.21
64
install_from_github lutok 0.4
65
install_from_github kyua 0.12
66
if [ `id -u` -eq 0 ]; then
67
ldconfig
68
else
69
sudo ldconfig
70
fi
71
fi
72
73