-
Notifications
You must be signed in to change notification settings - Fork 3
/
cmake.sh
executable file
·61 lines (53 loc) · 1.63 KB
/
cmake.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
#!/bin/sh
echo "Starting..."
#Stop on error.
set -e
#Output name.
PKG_NAME=CMake
#Sources and dependency names.
ZIP=zip-3.0-11
CMAKE=cmake-2.8.9-2
CMAKE_VER=cmake-2.8.9
LIDN=libidn11-1.26-1
LNCURSES=libncurses10-5.7-18
LSTDCPP=libstdc++6-4.8.2-2
#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 ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/cmake/$CMAKE.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/libidn/libidn11/$LIDN.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/ncurses/libncurses10/$LNCURSES.tar.bz2
wget ftp://mirrors.kernel.org/sourceware/cygwin/x86/release/gcc/libstdc++6/$LSTDCPP.tar.xz
#Unzip.
echo "Unzipping sources..."
tar xjf $ZIP.tar.bz2 -C / #Needed for packaging.
tar xjf $CMAKE.tar.bz2
tar xjf $LIDN.tar.bz2
tar xjf $LNCURSES.tar.bz2
tar xf $LSTDCPP.tar.xz
#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
#Copy modules and templates into bin for CMake to work correctly.
cp -r usr/share/$CMAKE_VER/Modules $PKG_NAME/bin
cp -r usr/share/$CMAKE_VER/Templates $PKG_NAME/bin
#Build package.
echo "Building package..."
cd $PKG_NAME
zip -r $PKG_NAME.mxt3 .
mv $PKG_NAME.mxt3 ../../
echo "Created package $PKG_NAME.mxt3 successfully!"