-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a20f368
commit 3bea0b2
Showing
8 changed files
with
152 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: all app clean mrproper | ||
|
||
all: app | ||
|
||
app: ../../build/iaito.app radare2-unpkg | ||
mkdir disk | ||
cp -a ../../build/iaito.app disk/ | ||
scripts/embed-radare2.sh radare2-unpkg disk/iaito.app | ||
cd disk && macdeployqt iaito.app -dmg -verbose=2 | ||
mv disk/*.dmg . | ||
|
||
radare2-unpkg: radare2.pkg | ||
pkgutil --expand-full $< $@ | ||
|
||
radare2.pkg: | ||
echo "Download first radare2.pkg from https://github.com/radareorg/radare2/releases" | ||
@false | ||
|
||
../../build/iaito.app: | ||
echo "Building iaito..." | ||
$(MAKE) -C ../.. QMAKE_FLAGS=IAITO_BUNDLE_R2_APPBUNDLE=true | ||
|
||
clean: | ||
rm -rf disk radare2-unpkg | ||
|
||
mrproper: clean | ||
rm -f radare2.pkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/sh | ||
|
||
CMD=$(basename "$0") | ||
APPDIR=$(cd "$(dirname "$0")/../../../.."; pwd) | ||
|
||
R2_BINDIR="${APPDIR}/Contents/Helpers" | ||
R2_LIBDIR="${APPDIR}/Contents/Frameworks" | ||
R2_LIBR_PLUGINS="${APPDIR}/Contents/PlugIns/radare2" | ||
R2_PREFIX="${APPDIR}/Contents/Resources/radare2" | ||
|
||
export R2_BINDIR | ||
export R2_LIBDIR | ||
export R2_LIBR_PLUGINS | ||
export R2_PREFIX | ||
|
||
exec "${R2_BINDIR}/${CMD}" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/bin/sh -e | ||
|
||
R2PKGDIR="$1" | ||
APPDIR="$2" | ||
|
||
SCRIPTS="$(dirname "$0")" | ||
R2DIR="${R2PKGDIR}/Payload/usr/local" | ||
R2V=$(readlink "${R2DIR}/lib/radare2/last") | ||
|
||
fix_binary() { | ||
echo "Change library paths for \"$1\"..." | ||
ARGS=$(otool -L "$1" | awk '/\/usr\/local\/lib\/libr_/{dst=$1; sub(/\/usr\/local\/lib/,"@executable_path/../Frameworks", dst); print "-change "$1" "dst}') | ||
[ -n "$ARGS" ] && install_name_tool $ARGS "$1" | ||
} | ||
|
||
mkdir -p \ | ||
"${APPDIR}/Contents/Helpers" \ | ||
"${APPDIR}/Contents/Frameworks" \ | ||
"${APPDIR}/Contents/PlugIns/radare2" \ | ||
"${APPDIR}/Contents/Resources/radare2/bin" \ | ||
"${APPDIR}/Contents/Resources/radare2/lib/radare2" | ||
|
||
cp -a "${R2DIR}/bin/"* "${APPDIR}/Contents/Helpers/" | ||
cp -a "${R2DIR}/lib/radare2/${R2V}/"* "${APPDIR}/Contents/PlugIns/radare2/" | ||
cp -a "${R2DIR}/lib/"*.dylib "${APPDIR}/Contents/Frameworks/" | ||
cp -a "${R2DIR}/include" "${APPDIR}/Contents/Resources/radare2/" | ||
cp -a "${R2DIR}/share" "${APPDIR}/Contents/Resources/radare2/" | ||
#cp -a "${R2DIR}/lib/pkgconfig" "${APPDIR}/Contents/Resources/radare2/lib/" | ||
cp -p "${SCRIPTS}/command.sh" "${APPDIR}/Contents/Resources/radare2/bin/radare2" | ||
cp -a "${R2DIR}/lib/radare2/last" "${APPDIR}/Contents/Resources/radare2/lib/radare2/" | ||
ln -s "../../../../PlugIns/radare2" "${APPDIR}/Contents/Resources/radare2/lib/radare2/${R2V}" | ||
|
||
( | ||
cd "${APPDIR}/Contents/MacOS" | ||
fix_binary "iaito" | ||
) | ||
|
||
( | ||
cd "${APPDIR}/Contents/Helpers" | ||
for c in *; do | ||
[ -L "$c" ] || fix_binary "$c" | ||
[ "$c" != "radare2" ] && ln -s radare2 "../Resources/radare2/bin/$c" | ||
done | ||
) | ||
|
||
( | ||
LIBS=$(cd "${R2DIR}/lib"; ls *.dylib) | ||
cd "${APPDIR}/Contents/Frameworks" | ||
for c in $LIBS; do | ||
[ -L "$c" ] || fix_binary "$c" | ||
c2=$c # Resolve upto 2 link levels | ||
[ -L "$c2" ] && c2=$(readlink "$c2") | ||
[ -L "$c2" ] && c2=$(readlink "$c2") | ||
ln -s "../../../Frameworks/$c2" "../Resources/radare2/lib/$c" | ||
done | ||
) | ||
|
||
( | ||
cd "${APPDIR}/Contents/PlugIns/radare2" | ||
for c in *; do | ||
[ -L "$c" ] || fix_binary "$c" | ||
done | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters