-
Notifications
You must be signed in to change notification settings - Fork 4
/
maker.sh
309 lines (262 loc) · 8.93 KB
/
maker.sh
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#!/bin/bash
COINNAME="kyf"
COINPATH="kryptofranccore"
#fix root issues
sudo chown -R root:root $COINPATH
sudo chmod -R 777 $COINPATH
# Reset
Color_Off='\033[0m' # Text Reset
# Regular Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Yellow='\033[0;33m' # Yellow
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
White='\033[0;37m' # White
# Bold
BBlack='\033[1;30m' # Black
BRed='\033[1;31m' # Red
BGreen='\033[1;32m' # Green
BYellow='\033[1;33m' # Yellow
BBlue='\033[1;34m' # Blue
BPurple='\033[1;35m' # Purple
BCyan='\033[1;36m' # Cyan
BWhite='\033[1;37m' # White
echo "--------------------------------------------------------------"
echo -e "$BCyan Bitcoin/Altcoin compiler helper: version 1.5"
echo -e "$BBlue maker unix/win64"
echo -e "$BGreen win compile for Windows os "
echo -e " unix compile for Unix (default)"
echo -e " win64 compile for windows 64 bits"
echo -e " mac or osx compile for MAC"
echo -e " doc generate the Doxygen documentation (unix only)"
echo -e " deploy create an exe or a dmg to install the coin."
echo
echo -e "$BYellow example: ./maker.sh unix"
echo " ->will compile for unix"
echo "--------------------------------------------------------------"
echo -e $Color_Off
# force recompile of the version
rm kryptofranccore/src/libbitcoin_util_a-clientversion.o
# initialize the internal variables
OS="unix"
# test the number max of options
if [ "$#" = 0 ] ; then
echo -e "$BRed no option selected: exiting..."
echo -e $Color_Off
exit;
fi
if [ "$#" -ge 5 ] ; then
echo -e "$BRed Error: too many parameters (5 max)"
echo -e $Color_Off
exit
fi
ALL="no"
INSTALL="no"
DOC="no"
DEPLOY="no"
# loop through all the options and set the corresponding variables
while [ "$1" != "" ]; do
case $1 in
install)
INSTALL="yes"
;;
all)
ALL="yes"
;;
unix)
OS="unix"
;;
mac)
OS="osx"
;;
osx)
OS="osx"
;;
win64)
OS="win64"
;;
win32)
OS="win32"
;;
doc)
DOC="yes"
;;
deploy)
DEPLOY="yes"
;;
help)
exit
;;
esac
shift
done
echo -e "$BYellow --------------------------------------------------"
echo " *** EXECUTING SCRIPT WITH OPTIONS ***"
echo
echo "Coin name=$COINNAME"
echo "Coin path=$COINPATH"
echo "OS option $OS"
echo "INSTALL option $INSTALL"
echo "ALL option $ALL"
echo "DEPLOY option $DEPLOY"
echo "DOC option $DOC"
echo "--------------------------------------------------"
echo -e $Color_Off
if [ $OS = "osx" ]; then
if [ $INSTALL = "yes" ]; then
brew install automake berkeley-db4 libtool boost miniupnpc openssl pkg-config protobuf python qt libevent qrencode
brew install librsvg
fi
if [ $ALL = "yes" ]; then
cd $COINPATH
./autogen.sh
./configure --disable-tests --disable-bench
make clean
cd ..
fi
cd $COINPATH
if [ $DEPLOY = "yes" ]; then
make -i deploy
fi
if [ $DEPLOY = "no" ]; then
make -i
fi
cd ..
echo -e "$BYellow --------------------------------------------------"
echo -e "$BGreen PACKAGING will install the DMG in binaries folder"
echo -e $Color_Off
sudo mkdir -p binaries
sudo mkdir -p binaries/osx
sudo cp -rf $COINPATH/$COINNAME-Qt.dmg binaries/osx/$COINNAME-Qt.dmg
sudo cp -rf $COINPATH/src/$COINNAME-tx binaries/osx/$COINNAME-tx
sudo cp -rf $COINPATH/src/$COINNAME-wallet binaries/osx/$COINNAME-wallet
sudo cp -rf $COINPATH/src/$COINNAME-cli binaries/osx/$COINNAME-cli
sudo cp -rf $COINPATH/src/qt/bitcoin-qt binaries/osx/$COINNAME-qt
sudo cp -rf "$COINPATH/src/$COINNAME""d" "binaries/osx/$COINNAME""d"
fi
if [ $OS = "unix" ]; then
if [ $INSTALL = "yes" ]; then
sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3
sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt-get install doxygen
fi
if [ $ALL = "yes" ]; then
cd $COINPATH
make clean
./autogen.sh
./configure --disable-tests --disable-bench
cd ..
fi
cd $COINPATH
if [ $DEPLOY = "yes" ]; then
make
make install
fi
if [ $DEPLOY = "no" ]; then
make
fi
if [ $DOC = "yes" ]; then
doxygen Doxyfile.in
fi
cd ..
echo -e "$BYellow --------------------------------------------------"
echo -e "$BGreen PACKAGING will install all Unix exe in binaries folder"
echo -e $Color_Off
sudo mkdir -p binaries
sudo mkdir -p binaries/unix
sudo cp -rf $COINPATH/src/bitcoin-wallet $COINPATH/src/$COINNAME-wallet
sudo cp -rf $COINPATH/src/qt/bitcoin-qt $COINPATH/src/qt/$COINNAME-qt
# this is for desktop icon, you have to make your own one.
sudo cp assets/android-icon-192x192.png binaries/unix/kryptofranc.png
sudo cp assets/android-icon-192x192.png /usr/share/app-install/icons/kryptofranc.png
sudo cp assets/$COINNAME-wallet.desktop binaries/unix/$COINNAME-wallet.desktop
# end of desktop icon
sudo cp -rf "$COINPATH/src/$COINNAME""d" "binaries/unix/$COINNAME""d"
sudo cp -rf $COINPATH/src/$COINNAME-tx binaries/unix/$COINNAME-tx
sudo cp -rf $COINPATH/src/$COINNAME-cli binaries/unix/$COINNAME-cli
sudo cp -rf $COINPATH/src/$COINNAME-wallet binaries/unix/$COINNAME-wallet
sudo cp -rf $COINPATH/src/qt/$COINNAME-qt binaries/unix/$COINNAME-qt
sudo cp -rf $COINPATH/src/$COINNAME-qt /usr/bin/$COINNAME-qt
sudo strip "binaries/unix/$COINNAME""d"
sudo strip binaries/unix/$COINNAME-tx
sudo strip binaries/unix/$COINNAME-cli
sudo strip binaries/unix/$COINNAME-qt
sudo strip binaries/unix/$COINNAME-wallet
fi
if [ $OS = "win64" ]; then
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:$COINPATH
PATH=$(echo "$PATH" | sed -e 's/:\/mnt.*//g') # strip out problematic Windows %PATH% imported var
if [ $INSTALL = "yes" ]; then
sudo apt update
sudo apt upgrade
sudo apt install g++-mingw-w64-x86-64
sudo apt install build-essential libtool autotools-dev automake pkg-config bsdmainutils curl git
sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:bitcoin/bitcoin
sudo apt-get update
sudo apt-get install libdb4.8-dev libdb4.8++-dev
sudo apt-get install libminiupnpc-dev
sudo apt-get install libzmq3-dev
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler
sudo apt install nsis
echo -e "$BGreen select (1) Posix "
echo -e $Color_Off
sudo update-alternatives --config x86_64-w64-mingw32-g++
sudo chmod -R 777 $COINPATH
cd $COINPATH
cd depends
# -i or it will stop compiling
make HOST=x86_64-w64-mingw32 -i
cd ..
fi
if [ $ALL = "yes" ]; then
cd $COINPATH
sudo ./autogen.sh
sudo CONFIG_SITE=$PWD/depends/x86_64-w64-mingw32/share/config.site ./configure --prefix=/ --disable-tests --disable-bench
# make clean
cd ..
fi
echo -e "$BYellow --------------------------------------------------"
echo -e "$BGreen PACKAGING will install all win64 exe in $COINPATH"
echo -e $Color_Off
# option -i or it will stop compiling
#make deploy -i
cd $COINPATH
if [ $DEPLOY = "yes" ]; then
make -i deploy
fi
if [ $DEPLOY = "no" ]; then
make -i
fi
cd ..
sudo rm -rf binaries
sudo mkdir -p binaries
sudo mkdir -p binaries/win64
sudo cp -rf $COINPATH/src/qt/bitcoin-qt.exe $COINPATH/src/qt/$COINNAME-qt.exe
sudo cp -rf "$COINPATH/src/$COINNAME""d".exe "binaries/win64/$COINNAME""d".exe
sudo cp -rf $COINPATH/src/$COINNAME-tx.exe binaries/win64/$COINNAME-tx.exe
sudo cp -rf $COINPATH/src/$COINNAME-cli.exe binaries/win64/$COINNAME-cli.exe
sudo cp -rf $COINPATH/src/qt/$COINNAME-qt.exe binaries/win64/$COINNAME-qt.exe
sudo cp -rf $COINPATH/src/$COINNAME-wallet.exe binaries/win64/$COINNAME-wallet.exe
sudo strip "binaries/win64/$COINNAME""d".exe
sudo strip binaries/win64/$COINNAME-tx.exe
sudo strip binaries/win64/$COINNAME-cli.exe
sudo strip binaries/win64/$COINNAME-qt.exe
sudo strip binaries/win64/$COINNAME-wallet.exe
sudo cp -r /home/nikko/Kryptofranc/binaries/win64/ /home/nikko/Kryptofranc/kryptofranccore/release
if [ $DEPLOY = "yes" ]; then
sudo cp -rf $COINPATH/kryptofranc-0.18.0-win64-setup.exe /home/binaries/win64/kyf-win64-setup.exe
fi
cd ..
fi