Skip to content

Commit

Permalink
New make dist for macos using macdeployqt. missing cocoa plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Nov 14, 2022
1 parent 6feb079 commit e354190
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 2 deletions.
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ else
BIN=build/iaito
endif

#QMAKE_FLAGS+=IAITO_ENABLE_PYTHON=false
QMAKE_FLAGS+=-config release

#install_name_tool -change /path/to/Qt/lib/QtCore.framework/Versions/4.0/QtCore
# @executable_path/../Frameworks/QtCore.framework/Versions/4.0/QtCore
# plugandpaint.app/Contents/plugins/libpnp_basictools.dylib

ifeq ($(WANT_PYTHON),1)
QMAKE_FLAGS+=IAITO_ENABLE_PYTHON=true
endif
Expand All @@ -18,10 +25,17 @@ all: iaito
clean:
rm -rf build

dist:
ifeq ($(shell uname),Darwin)
$(MAKE) -C dist/macos
else
$(MAKE) -C dist/debian
endif

mrproper: clean
git clean -xdf

.PHONY: install run user-install clean mrproper install-translations
.PHONY: install run user-install dist macos clean mrproper install-translations

# force qt5 build when QtCreator is installed in user's home
ifeq ($(shell test -x ~/Qt/5.*/clang_64/bin/qmake || echo err),)
Expand Down
4 changes: 4 additions & 0 deletions dist/macos/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
all:
rm -f ../../build/iaito.dmg
cd ../../build && macdeployqt iaito.app -dmg && cp -f iaito.dmg ../dist/macos

app:
$(SHELL) make-macos-app.sh

pkg:
Expand Down
40 changes: 39 additions & 1 deletion dist/macos/make-macos-app.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/sh

SKIPBUILD=0
BUNDLE=1

SRC=/tmp/iaito-macos
PREFIX=/usr/local
Expand Down Expand Up @@ -36,7 +37,44 @@ ${MAKE} install install-translations PREFIX="${PREFIX}" DESTDIR=${SRC} || exit 1
mkdir -p "${DST}"
echo "DST=$DST"
if [ -d "${SRC}" ]; then
(
( # bundle
LIBS=`rabin2 -ql ${SRC}/usr/local/bin/iaito | grep -v System`
mkdir -p bundle
for a in $LIBS ; do
echo "LIB $a"
D="`basename '$a'`"
cp -f $a bundle
LIBS2=`rabin2 -ql ${a} | grep -v System`
for b in $LIBS2 ; do
D2="`basename '$a'`"
echo "$a $b"
cp $b bundle
done
done
# binary patch the binary
echo cp -f ${SRC}/usr/local/bin/iaito bundle/
cp -f ${SRC}/usr/local/bin/iaito bundle/
for a in bundle/* ; do
libs=`rabin2 -ql $a | grep -v System`
for b in $libs ; do
bn=`basename "$b"`
if ls bundle | grep -q "$bn" ; then
# its bundled
from="$b"
to="@executable_path/lib/$bn"
echo install_name_tool "$from" "$to" "$a"
install_name_tool -change "$from" "$to" "$a"
fi
done
done
rm -rf bundle/lib
mkdir -p bundle/lib
mv bundle/* bundle/lib
mv bundle/lib/iaito bundle/
# cp -f ${SRC}/usr/local/bin/iaito bundle/
exit 1
)
( # massage
cd ${SRC} && find .
mv usr/local/share/iaito/translations Applications/iaito.app/Contents/Resources || exit 1
cd Applications || exit 1
Expand Down
4 changes: 4 additions & 0 deletions src/Iaito.pro
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ IAITO_VERSION_MAJOR = 5
IAITO_VERSION_MINOR = 7
IAITO_VERSION_PATCH = 8

CONFIG+=app_bundle
LIBS+= -dead_strip

CONFIG += sdk_no_version_check

unix:QMAKE_RPATHDIR += /usr/local/lib
Expand Down Expand Up @@ -41,6 +44,7 @@ equals(IAITO_ENABLE_CRASH_REPORTS, true) CONFIG += IAITO_ENABLE_CRASH_REPO

!defined(IAITO_ENABLE_PYTHON, var) IAITO_ENABLE_PYTHON=false
equals(IAITO_ENABLE_PYTHON, true) CONFIG += IAITO_ENABLE_PYTHON
IAITO_ENABLE_PYTHON=false

!defined(IAITO_ENABLE_PYTHON_BINDINGS, var) IAITO_ENABLE_PYTHON_BINDINGS=false
equals(IAITO_ENABLE_PYTHON, true) {
Expand Down

0 comments on commit e354190

Please sign in to comment.