2014-05-17 02:27:49 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2014-05-17 02:53:11 +00:00
|
|
|
if [ -z "${CPU}" ]; then
|
|
|
|
export CPU=arm64
|
|
|
|
export CPU=armv7
|
|
|
|
fi
|
|
|
|
|
2015-06-17 03:47:36 +00:00
|
|
|
export BUILD=1
|
2016-08-18 00:48:29 +00:00
|
|
|
PREFIX=/private/var/radare2
|
2014-05-17 02:27:49 +00:00
|
|
|
|
|
|
|
if [ ! -d sys/ios-include ]; then
|
|
|
|
(
|
|
|
|
cd sys && \
|
|
|
|
wget http://lolcathost.org/b/ios-include.tar.gz && \
|
|
|
|
tar xzvf ios-include.tar.gz
|
|
|
|
)
|
|
|
|
fi
|
|
|
|
|
2016-02-20 22:30:11 +00:00
|
|
|
. sys/ios-env.sh
|
2014-05-17 02:27:49 +00:00
|
|
|
|
2016-08-18 00:48:29 +00:00
|
|
|
BINS="r2 radare2 rax2 rabin2 rahash2 rafind2 rarun2 r2agent ragg2 ragg2-cc radiff2"
|
|
|
|
LIBS=
|
|
|
|
|
2016-01-14 22:26:50 +00:00
|
|
|
makeDeb() {
|
2016-04-25 16:45:10 +00:00
|
|
|
make -C binr ios-sdk-sign
|
2016-01-14 22:26:50 +00:00
|
|
|
rm -rf /tmp/r2ios
|
|
|
|
make install DESTDIR=/tmp/r2ios
|
2016-08-18 00:48:29 +00:00
|
|
|
rm -rf /tmp/r2ios/${PREFIX}/share/radare2/*/www/enyo/node_modules
|
2016-01-14 22:26:50 +00:00
|
|
|
( cd /tmp/r2ios && tar czvf ../r2ios-${CPU}.tar.gz ./* )
|
|
|
|
rm -rf sys/cydia/radare2/root
|
|
|
|
mkdir -p sys/cydia/radare2/root
|
|
|
|
sudo tar xpzvf /tmp/r2ios-${CPU}.tar.gz -C sys/cydia/radare2/root
|
2016-08-18 00:48:29 +00:00
|
|
|
rm -f sys/cydia/radare2/root/${PREFIX}/lib/*.dSYM
|
|
|
|
rm -f sys/cydia/radare2/root/${PREFIX}/lib/*.a
|
|
|
|
(
|
|
|
|
cd sys/cydia/radare2/root/
|
|
|
|
mkdir -p usr/bin
|
|
|
|
# stow
|
|
|
|
echo "Stowing ${PREFIX} into /usr..."
|
|
|
|
for a in `cd ./${PREFIX}; ls` ; do
|
|
|
|
if [ -d "./${PREFIX}/$a" ]; then
|
|
|
|
mkdir -p "usr/$a"
|
|
|
|
for b in `cd ./${PREFIX}/$a; ls` ; do
|
|
|
|
echo ln -fs "${PREFIX}/$a/$b" usr/$a/$b
|
|
|
|
ln -fs "${PREFIX}/$a/$b" usr/$a/$b
|
|
|
|
done
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
)
|
2016-01-14 22:26:50 +00:00
|
|
|
( cd sys/cydia/radare2 ; sudo make clean ; sudo make )
|
|
|
|
}
|
2014-05-17 02:27:49 +00:00
|
|
|
|
2016-02-20 22:30:11 +00:00
|
|
|
fromscratch=1
|
2016-08-18 00:48:29 +00:00
|
|
|
onlymakedeb=1
|
2016-02-20 22:30:11 +00:00
|
|
|
|
2016-07-26 13:17:07 +00:00
|
|
|
if [ "$1" = makedeb ]; then
|
|
|
|
onlymakedeb=1
|
|
|
|
fi
|
|
|
|
|
2016-02-20 22:30:11 +00:00
|
|
|
if [ $onlymakedeb = 1 ]; then
|
|
|
|
makeDeb
|
|
|
|
else
|
|
|
|
if [ $fromscratch = 1 ]; then
|
|
|
|
make clean
|
2016-08-18 00:48:29 +00:00
|
|
|
./configure --prefix="${PREFIX}" --with-ostype=darwin \
|
2016-02-20 22:30:11 +00:00
|
|
|
--with-compiler=ios-sdk --target=arm-unknown-darwin
|
|
|
|
RV=$?
|
|
|
|
else
|
|
|
|
RV=0
|
|
|
|
fi
|
|
|
|
if [ $RV = 0 ]; then
|
2016-07-26 13:17:07 +00:00
|
|
|
time make -j2
|
2016-01-14 22:26:50 +00:00
|
|
|
if [ $? = 0 ]; then
|
|
|
|
makeDeb
|
|
|
|
fi
|
2014-05-17 02:27:49 +00:00
|
|
|
fi
|
|
|
|
fi
|
2016-01-14 22:26:50 +00:00
|
|
|
|
|
|
|
|