-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcgdb.sh
executable file
·75 lines (65 loc) · 1.8 KB
/
cgdb.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
#!/bin/sh
echo "Starting..."
#Stop on error.
set -e
#Output name.
PKG_NAME=CGDB
#Sources and dependency names.
ZIP=zip-3.0-11
CGDB=cgdb-0.6.7
LNCURSES=libncurses9-5.7-16
LNCURSES_BIN=cygncurses-9.dll
READLINE=libreadline7-6.1.2-3
READLINE_DEV=readline-6.1.2-3
READLINE_BIN=cygreadline7.dll
#Clean up.
rm -rf .working_dir
mkdir .working_dir
cd .working_dir
#Grab sources and dependencies.
echo "Grabbing sources..."
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/zip/$ZIP.tar.bz2
wget http://cgdb.me/files/$CGDB.tar.gz
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/ncurses/libncurses9/$LNCURSES.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/readline/libreadline7/$READLINE.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/readline/$READLINE_DEV.tar.bz2
#Unzip.
echo "Unzipping sources..."
tar xjf $ZIP.tar.bz2 -C / #Needed for packaging.
tar xzf $CGDB.tar.gz
tar xjf $LNCURSES.tar.bz2
tar xjf $READLINE.tar.bz2
tar xjf $READLINE_DEV.tar.bz2
#Move dependencies in place.
cp -r ./usr/* /usr/
#Patch and build.
echo "Building CGDB..."
cd $CGDB
patch -p1 < ../../cgdb.patch
./configure
make
make install
cd ..
#Move sources in place for packaging.
echo "Creating package basis..."
## Bin directory.
mkdir $PKG_NAME
mkdir $PKG_NAME/bin
###cp -r usr/bin/* $PKG_NAME/bin
## Lib directory.
###mkdir $PKG_NAME/lib
###cp -r usr/lib/* $PKG_NAME/lib
## Include and Share directory.
mkdir $PKG_NAME/usr
###cp -r usr/include $PKG_NAME/usr
###cp -r usr/share $PKG_NAME/usr
cp usr/bin/$LNCURSES_BIN $PKG_NAME/bin
cp usr/bin/$READLINE_BIN $PKG_NAME/bin
cp /usr/local/bin/* $PKG_NAME/bin
cp -r /usr/local/share $PKG_NAME/usr
#Build package.
echo "Building package..."
cd $PKG_NAME
zip -r $PKG_NAME.mxt3 .
mv $PKG_NAME.mxt3 ../../
echo "Created package $PKG_NAME.mxt3 successfully!"