-
Notifications
You must be signed in to change notification settings - Fork 0
/
FUNCTIONS
executable file
·134 lines (110 loc) · 3.35 KB
/
FUNCTIONS
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
. $GRIMOIRE/libaccount
. $GRIMOIRE/config_query_multi.function
QT4DIR="$INSTALL_ROOT/opt/qt4"
KDE4DIR="$QT4DIR"
SRC=$SOURCE_DIRECTORY
#---------------------------------------------------------------------
function default_pre_build () {
real_default_pre_build
cd $SOURCE_DIRECTORY &&
mkdir build
}
#---------------------------------------------------------------------
## This function automatically fixes any known bad paths
#---------------------------------------------------------------------
function default_grimoire_post_install () {
real_default_sorcery_post_install && # currently a no-op
if [[ $STAGED_INSTALL == off ]]; then
return 0
fi &&
pushd TRANSL &> /dev/null &&
if [[ -d usr/man ]]; then
echo Fixing bad install path: /usr/man &&
mv -v usr/man usr/share
fi &&
if [[ -d usr/info ]]; then
echo Fixing bad install path: /usr/info &&
mv -v usr/info usr/share
fi &&
if [[ -d usr/local/man ]]; then
echo Fixing bad install path: /usr/local/man &&
mv -v usr/local/man usr/share
fi &&
if [[ -d usr/local/info ]]; then
echo Fixing bad install path: /usr/local/info &&
mv -v usr/local/info usr/share
fi &&
popd &> /dev/null
}
#---------------------------------------------------------------------
# Runs update-desktop-database if it is installed
#---------------------------------------------------------------------
function update_desktop_database ()
{
if test -x /usr/bin/update-desktop-database; then
message "${MESSAGE_COLOR}Updating application mime type database.${DEFAULT_COLOR}"
/usr/bin/update-desktop-database
fi
}
# spells in several sections now need cmake or qt4
function cmake_build() {
cd $SOURCE_DIRECTORY/build &&
if [[ -f /usr/bin/ninja ]];then
MAKE=ninja
OPTS+=" -G Ninja"
else
MAKE=make
fi &&
message INSTALL_PREFIX=$KDE4DIR &&
cmake -DCMAKE_INSTALL_PREFIX=$KDE4DIR \
-DCMAKE_INSTALL_LIBDIR=lib \
-DCMAKE_INSTALL_MANDIR=share/man \
-DCMAKE_PREFIX_PATH=share/apps/cmake/modules \
-DSYSCONFDIR=$INSTALL_ROOT/etc \
-DCMAKE_BUILD_TYPE=$CM_BUILD_TYPE \
$OPTS $SRC &&
$MAKE
}
function cmake_install() {
if [[ -f /usr/bin/ninja ]];then
ninja install
else
make install
fi
}
function qt4_cmake_build() {
PATH="$QT4DIR/bin/:$PATH"
export PKG_CONFIG_PATH="$QT4DIR/lib/pkgconfig"
cmake_build
}
qt4_build() {
cd $SOURCE_DIRECTORY &&
PATH="$QT4DIR/bin:$PATH"
qmake PREFIX=$QT4DIR $OPTS $SRC/*.pro &&
make
}
#---
## Default configure
#---
function default_build_configure() {
# this is here so that config_query_option can be used without
# extra junk
local up_spell_name=$(echo $SPELL | tr "a-z" "A-Z") &&
local up_spell_name=$(echo $SPELL | tr "-" "_") &&
local tempopts="${up_spell_name}_OPTS" &&
OPTS="${!tempopts} $OPTS" &&
OPTS="$OPTS --build=${BUILD}" &&
./configure --prefix=${INSTALL_ROOT}/usr \
--sysconfdir=${INSTALL_ROOT}/etc \
--localstatedir=${INSTALL_ROOT}/var \
--libdir=${INSTALL_ROOT}/usr/lib \
--mandir=${INSTALL_ROOT}/usr/share/man \
--infodir=${INSTALL_ROOT}/usr/share/info \
$OPTS
}
#---
## Default make
#---
function default_build_make(){
make
}