forked from RedisInsight/RedisDesktopManager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·154 lines (125 loc) · 5.66 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
#!/bin/bash
set -e
# On OSX use coreutils package to fix absense of readlink command
if [[ $OSTYPE == darwin* ]]; then
brew install coreutils || true
PATH="/usr/local/opt/coreutils/libexec/gnubin:$PATH"
fi
# Import common functions
DIR=$(dirname "$(readlink -f "$0")") && RDM_DIR=$DIR/../
. $RDM_DIR/build/common_functions
GetOSVersion
RDM_QT_VERSION=${RDM_QT_VERSION:-594}
RDM_QT_BRANCH=${RDM_QT_VERSION:0:2}
if [ "$1" == "breakpad" ]; then
print_title "Build only Breakpad"
build_breakpad
exit 0
fi
if [ "$1" == "libssh2" ]; then
print_title "Build only libssh2"
build_libssh2
exit 0
fi
if [ "$os_VENDOR" == "Ubuntu" ] && [ "$#" -gt 2 ]; then
print_title "Run configure in DEB Script packaging"
build_breakpad
build_libssh2
exit 0
fi
if [ "$os_VENDOR" == "Ubuntu" ] || [ "$os_VENDOR" == "LinuxMint" ] || [ "$os_VENDOR" == "elementary" ]; then
if [ "$os_VENDOR" == "elementary" ]; then
ubuntu_ver=${os_RELEASE:0:3}
else
ubuntu_ver=${os_RELEASE:0:2}
fi
print_title "Build RDM on $os_VENDOR: $ubuntu_ver"
if [ "$os_VENDOR" == "Ubuntu" ] && [ "$ubuntu_ver" == "12" ]; then
echo "RedisDesktopManager doesn't support Ubuntu 12 since 0.8.8 release."
exit 1
fi
if [ "$os_VENDOR" == "LinuxMint" ]; then
if [ "$ubuntu_ver" == "17" ]; then
ubuntu_ver="14"
elif [ "$ubuntu_ver" == "18" ]; then
ubuntu_ver="16"
elif [ "$ubuntu_ver" == "19" ]; then
ubuntu_ver="18"
else
echo "RedisDesktopManager only supports linux mint >=17."
exit 1
fi
fi
if [ "$os_VENDOR" == "elementary" ]; then
if [ "$ubuntu_ver" == "0.4" ]; then
ubuntu_ver="16"
elif [ "$ubuntu_ver" == "0.5" ]; then
ubuntu_ver="18"
else
echo "RedisDesktopManager only supports elementary >=0.4."
exit 1
fi
fi
if [ "$ubuntu_ver" -gt 16 ]; then
print_title "Install Qt ${RDM_QT_BRANCH}"
sudo apt-get install qt5-default qtdeclarative5-dev libqt5charts5-dev \
qml-module-qtquick-controls qml-module-qtquick-controls2 qml-module-qt-labs-settings \
qml-module-qtquick-dialogs qml-module-qtquick-layouts qml-module-qt-labs-folderlistmodel \
qml-module-qtqml-models2 qml-module-qtcharts libssl1.0-dev -y
elif [ ! -f /opt/qt${RDM_QT_BRANCH}/bin/qt${RDM_QT_BRANCH}-env.sh ]; then
print_title "Install Qt ${RDM_QT_VERSION} from ppa"
if [ "$ubuntu_ver" == "14" ]; then
sudo add-apt-repository --yes ppa:beineri/opt-qt${RDM_QT_VERSION}-trusty
elif [ "$ubuntu_ver" == "16" ]; then
sudo add-apt-repository --yes ppa:beineri/opt-qt${RDM_QT_VERSION}-xenial
fi
sudo apt-get update -y
sudo apt-get install qt${RDM_QT_BRANCH}base qt${RDM_QT_BRANCH}imageformats qt${RDM_QT_BRANCH}tools \
qt${RDM_QT_BRANCH}declarative qt${RDM_QT_BRANCH}quickcontrols qt${RDM_QT_BRANCH}quickcontrols2 qt${RDM_QT_BRANCH}charts-no-lgpl qt${RDM_QT_BRANCH}svg -y
sudo apt-get install libssl-dev libgl1-mesa-dev -y
fi
print_title "Install packages required by 3rdparty deps"
sudo apt-get install automake libtool cmake -y
build_breakpad
build_libssh2
if [ "$ubuntu_ver" -lt 17 ]; then
print_title "Run: source /opt/qt${RDM_QT_BRANCH}/bin/qt${RDM_QT_BRANCH}-env.sh && qmake && make "
fi
elif [ "$os_VENDOR" == "Fedora" ] || [[ "$os_VENDOR" == "CentOS" ]]; then
print_title "Build RDM on $os_VENDOR: $os_RELEASE"
print_title "Check deps"
sudo yum install libssh2 libssh2-devel qt5-qtbase qt5-qtsvg-devel \
qt5-qtdeclarative-devel qt5-qtgraphicaleffects qt5-qtquickcontrols qt5-qtquickcontrols2 \
qt5-qttools qt5-qtcharts-devel gcc gcc-c++ libstdc++-static git cmake rsync \
redhat-rpm-config -y
if [[ $? == 1 && "$os_VENDOR" == "CentOS" ]]; then
# Some of the deps might need to come from Epel, so output a nice message
print_title "Not all dependencies were found. Ensure you have the epel repo installed and enabled."
exit
fi
build_breakpad
build_libssh2
print_title "Run: qmake-qt5 && make "
elif [ "$os_VENDOR" == "openSUSE" ]; then
print_title "Check deps"
sudo zypper install -y libopenssl-devel libssh2-devel \
libX11-devel gcc gcc-c++ libstdc++-devel libqt5-qtbase-common-devel libqt5-qtquick1-devel \
libqt5-qtdeclarative-devel libqt5-qtimageformats libqt5-qtquickcontrols \
libQt5Concurrent-devel automake cmake \
build_breakpad
build_libssh2
print_title "Run: qmake-qt5 && make "
elif [[ $OSTYPE == darwin* ]]; then
cd $DEPS_DIR
find gbreakpad -type d -exec chmod 755 {} + && cd gbreakpad
git apply ../breakpad_osx.patch
xcodebuild -quiet -sdk macosx -project src/client/mac/Breakpad.xcodeproj -configuration Release -target Breakpad -xcconfig ../../src/gbreakpad.xcconfig ARCHS=x86_64 -UseModernBuildSystem=NO
xcodebuild -quiet -sdk macosx -project src/client/mac/Breakpad.xcodeproj -configuration Release -target Breakpad -xcconfig ../../src/gbreakpad.xcconfig install DSTROOT=$DEPS_DIR/../bin/osx INSTALL_PATH=/Frameworks ARCHS=x86_64 -UseModernBuildSystem=NO
xcodebuild -quiet -sdk macosx -project src/client/mac/Breakpad.xcodeproj -configuration Release -target Breakpad -xcconfig ../../src/gbreakpad.xcconfig install DSTROOT=$DEPS_DIR/../bin INSTALL_PATH=/Frameworks ARCHS=x86_64 -UseModernBuildSystem=NO
cd ..
brew upgrade openssl || brew install openssl || true
export OPENSSL_ROOT_DIR=/usr/local/opt/openssl/
build_libssh2
else
echo "Your operating system is not supported!"
fi