-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathbuildps
More file actions
executable file
·115 lines (104 loc) · 3.19 KB
/
buildps
File metadata and controls
executable file
·115 lines (104 loc) · 3.19 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
#!/bin/bash
# ARCH variable can set initialize
# In this moment 64 bits can not compiler for 32 bits.
BUILD_DIR=bin
WORKDIR=build
REALARCH=$(uname -m)
ARCH=${ARCH:-${REALARCH}}
BUILDNAME=streamer-udp-grapes-static
BASEDIR=$(pwd) # Supposing the script is called from its dirname...
DEBUG=0
mkdir -p $BUILD_DIR
mkdir -p $WORKDIR
doPatch() {
currentdir=$1
psdir=$2/
cd $currentdir
for file in $currentdir/*; do
[ $DEBUG ] && echo "currentdir is $currentdir"
[ $DEBUG ] && echo "psdir is $psdir"
if [ -d $file ]; then
[ $DEBUG ] && echo "$file is a dir, switching now"
doPatch $file $psdir/$(basename $file)
else
[ $DEBUG ] && echo "switching to $psdir to patch $file"
cd $psdir #Switching to ps workdir to patch the file
patch -p1 < $file #Applying patch
cd - #Switching back to previous working dir
fi
done
psdir=$(dirname $psdir)
}
[[ "$ARCH" =~ x86_64 ]] && {
ARCHDIR="amd64"
mkdir -p $WORKDIR/${ARCHDIR}
mkdir -p $BUILD_DIR/${ARCHDIR}
cd $WORKDIR/${ARCHDIR}
git clone http://halo.disi.unitn.it/~baldesi/PublicGits/Streamers-build.git/
cd Streamers-build
git submodule init
git submodule update
cd THIRDPARTY-LIBS/x264
git checkout 68f6db44035e8f9d4d00a73e5703eb1d7ff8d619
cd ../..
git add THIRDPARTY-LIBS/x264
git commit -m "Change checkout hash"
tmpdir=$PWD
doPatch $BASEDIR/patch $BASEDIR/$WORKDIR/${ARCHDIR}/Streamers-build
cd $tmpdir
make simple
cd ..
cp Streamers-build/Streamers/streamer-udp-grapes-static ../../$BUILD_DIR/${ARCHDIR}/$BUILDNAME
cd ../..
strip $BUILD_DIR/${ARCHDIR}/$BUILDNAME
}
[[ "$ARCH" =~ i.86 ]] && {
ARCHDIR="i386"
mkdir -p $WORKDIR/${ARCHDIR}
mkdir -p $BUILD_DIR/${ARCHDIR}
cd $WORKDIR/${ARCHDIR}
git clone http://halo.disi.unitn.it/~baldesi/PublicGits/Streamers-build.git/
cd Streamers-build
git submodule init
git submodule update
cd THIRDPARTY-LIBS/x264
git checkout 68f6db44035e8f9d4d00a73e5703eb1d7ff8d619
cd ../..
git add THIRDPARTY-LIBS/x264
git commit -m "Change checkout hash"
tmpdir=$PWD
doPatch $BASEDIR/patch $BASEDIR/$WORKDIR/${ARCHDIR}/Streamers-build
cd $tmpdir
make simple
cd ..
cp Streamers-build/Streamers/streamer-udp-grapes-static ../../$BUILD_DIR/${ARCHDIR}/$BUILDNAME
cd ../..
strip $BUILD_DIR/${ARCHDIR}/$BUILDNAME
}
[[ "$ARCH" =~ arm.* ]] && {
ARCHDIR="arm"
mkdir -p $WORKDIR/${ARCHDIR}
mkdir -p $BUILD_DIR/${ARCHDIR}
cd $WORKDIR/${ARCHDIR}
[ ! -d "ffmpeg-1.2.4" ] && {
wget http://www.ffmpeg.org/releases/ffmpeg-1.2.4.tar.gz
tar xzf ffmpeg-1.2.4.tar.gz
}
cd ffmpeg-1.2.4/
./configure --enable-cross-compile --cross-prefix=arm-linux-gnueabi- --arch=arm --target-os=linux
CC=arm-linux-gnueabi-gcc AR=arm-linux-gnueabi-ar make -j 5
cd ..
git clone git://peerstreamer.org/abeni/GRAPES.git
cd GRAPES/src/
CC=arm-linux-gnueabi-gcc AR=arm-linux-gnueabi-ar FFMPEG_DIR=$(pwd)/../../ffmpeg-1.2.4 make
cd ../..
git clone git://halo.disi.unitn.it/cskiraly/Streamers.git
cd Streamers
git checkout grapes-0.3
./configure --with-grapes=$(pwd)/../GRAPES --with-ffmpeg=$(pwd)/../ffmpeg-1.2.4 --with-static=2
#doPatch $BASEDIR/patch $BASEDIR/$WORKDIR/${ARCHDIR}
CC=arm-linux-gnueabi-gcc AR=arm-linux-gnueabi-ar make
cd ..
cp Streamers/streamer-grapes-static ../../$BUILD_DIR/${ARCHDIR}/$BUILDNAME
cd ../..
}