forked from andersdd/xtuple-utility
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevenv.sh
More file actions
115 lines (95 loc) · 4.12 KB
/
devenv.sh
File metadata and controls
115 lines (95 loc) · 4.12 KB
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
#!/bin/bash
dev_menu() {
log "Opened development menu"
while true; do
CC=$(whiptail --backtitle "$( window_title )" --menu "$( menu_title Development\ Menu )" 0 0 1 --cancel-button "Cancel" --ok-button "Select" \
"1" "Install Development Pre-reqs" \
"2" "Build & Install Qt 5.5.1" \
"3" "Build xTuple" \
3>&1 1>&2 2>&3)
RET=$?
if [ $RET -ne 0 ]; then
break
else
case "$CC" in
"1") install_dev_prereqs ;;
"2") build_qt5 ;;
"3") build_xtuple ;;
*) msgbox "Don't know how you got here! Please report on GitHub >> dev_menu $CC" && break ;;
esac
fi
done
}
install_dev_prereqs() {
log "Installing Development Environment pre-requisites..."
log_exec sudo apt-get update
log_exec sudo apt-get -y -qq install libpq-dev libkrb5-dev libmysqlclient-dev libpam0g-dev libperl-dev \
readline-common libreadline6-dev libsqlite0-dev libssl-dev \
libldap2-dev libxml2-dev libxslt1-dev zlib1g-dev \
unixodbc-dev build-essential xorg git perl python \
"^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev libxi-dev \
flex bison gperf libicu-dev ruby \
libssl-dev libxcursor-dev libxcomposite-dev libxdamage-dev libxrandr-dev libfontconfig1-dev \
libcap-dev libbz2-dev libgcrypt11-dev libpci-dev libnss3-dev build-essential libxcursor-dev \
libxcomposite-dev libxdamage-dev libxrandr-dev libdrm-dev \
libasound2-dev gperf libcups2-dev libpulse-dev libudev-dev \
libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libxtst-dev
RET=$?
if [ $RET -ne 0 ]; then
msgbox "There was an error installing pre-requisites. Check the log and correct any issues before trying again."
fi
return $RET
}
build_qt5() {
log "Building Qt5 from source"
cd $WORKDIR
# This moved: http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz
wget https://download.qt.io/archive/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.gz
tar zxvf qt-everywhere-opensource-src-5.5.1.tar.gz
cd qt-everywhere-opensource-src-5.5.1
# we will likely want to embrace qtwebengine but for now it doubles the build time...
log_exec ./configure -qt-sql-psql -qt-sql-sqlite -qt-zlib -qt-libpng -qt-libjpeg -nomake examples -skip qtwebengine -opensource -confirm-license
RET=$?
if [ $RET -ne 0 ]; then
log "There was an error running configure. Check the log and correct any issues before trying again."
return $RET
fi
log_exec make -j`nproc`
RET=$?
if [ $RET -ne 0 ]; then
log "There was an error building Qt. Check the log and correct any issues before trying again."
return $RET
fi
log_exec sudo make install
RET=$?
if [ $RET -ne 0 ]; then
log "There was an error installing Qt. Check the log and correct any issues before trying again."
return $RET
fi
log "Adding Qt installation directory (/usr/local/Qt-5.5.1/) to PATH and LD_LIBRARY_PATH"
sudo bash -c "echo export PATH=/usr/local/Qt-5.5.1/bin:$PATH >> ~/.profile"
sudo bash -c "echo export LD_LIBRARY_PATH=/usr/local/Qt-5.5.1/lib:$LD_LIBRARY_PATH >> ~/.profile"
}
build_xtuple() {
cd $WORKDIR
mkdir xtuple
cd xtuple
git clone https://github.com/xtuple/qt-client
cd qt-client
GITTAG=$(curl https://api.github.com/repos/xtuple/qt-client | \
awk -v FS='"' '/default_branch/ { print $4 }')
if [ -z "$GITTAG" ] ; then
GITTAG=master
fi
git checkout $GITTAG
git submodule update --init --recursive
cd openrpt
qmake
make -j`nproc`
cd ../csvimp
qmake
make -j`nproc`
cd ..
qmake
make -j`nproc`
}