summaryrefslogtreecommitdiffstats
path: root/packaging
diff options
context:
space:
mode:
Diffstat (limited to 'packaging')
-rwxr-xr-xpackaging/macosx/osx-app.sh63
-rwxr-xr-xpackaging/macosx/osx-build.sh36
2 files changed, 90 insertions, 9 deletions
diff --git a/packaging/macosx/osx-app.sh b/packaging/macosx/osx-app.sh
index 4a0268045..5e4e0666b 100755
--- a/packaging/macosx/osx-app.sh
+++ b/packaging/macosx/osx-app.sh
@@ -95,7 +95,8 @@ do
python_dir="$2"
shift 1 ;;
-s)
- strip_build=true ;;
+ strip_build=true
+ with_dSYM=false ;;
-l|--libraries)
LIBPREFIX="$2"
shift 1 ;;
@@ -657,7 +658,7 @@ while $endl; do
$pkglib/pango/$pango_version/modules/*.so \
$pkglib/gnome-vfs-2.0/modules/*.so \
$pkglib/gio/modules/*.so \
- $pkglib/ImageMagick-$IMAGEMAGICK_VER/modules-Q16/{filters,coders}/*.so \
+ $pkglib/ImageMagick-$IMAGEMAGICKVER/modules-Q16/{filters,coders}/*.so \
$pkglib/*.{dylib,so} \
$pkgbin/*.so \
$python_libs \
@@ -715,6 +716,7 @@ fixlib () {
echo "Skipping loader_to_res for $1"
;;
esac
+ [ $verbose_mode ] && echo ""
[ $verbose_mode ] && echo "basename: $1"
[ $verbose_mode ] && echo "dirname: $2"
[ $verbose_mode ] && echo "filePath: $filePath"
@@ -774,6 +776,63 @@ rewritelibpaths () {
rewritelibpaths
+
+# Include debug info in app bundle
+#----------------------------------------------------------
+# TODO: needs more testing
+
+if [ "$with_dSYM" = "true" ]; then
+
+ echo -e "\n\033[1mAdding debug info to app bundle ...\033[0m\n"
+
+ # package debug symbols for main binary
+ echo "dsymutil $binpath"
+ dsymutil "$binpath"
+
+ # some of the dependencies have debug symbols in MacPorts ...
+ #for item in libbz2.1.0.dylib libexif.12.dylib libopenraw.1.dylib; do
+ for item in libbz2.1.0.dylib libexif.12.dylib; do
+ echo "dsymutil ${pkglib}/${item}"
+ dsymutil "${pkglib}/${item}"
+ done
+
+ # to debug issues with ImageMagick / libMagick++
+ # Note: install ImageMagick with local portfile which includes the 'debug 1.0' portgroup
+ # use 'port -n -k upgrade --enforce-variants ImageMagick +debug' to reinstall with debug symbols
+ # (keep work dir (port -k) to allow recreation of bundled dSYMs with dsymutil)
+ if [[ "$use_port" == "t" ]]; then
+ if [[ "$(port echo ImageMagick and active | grep debug)" ]]; then
+ # if ImageMagick was installed with debug variant
+ for file in $(find $package -name 'libMagick*' -and -name '*.dylib' -and -not -ipath '*.dSYM*'); do
+ echo "dsymutil $file"
+ dsymutil "$file"
+ done
+ for file in $(find $package -ipath '*ImageMagick*' -and -name '*.so' -and -not -ipath '*.dSYM*'); do
+ echo "dsymutil $file"
+ dsymutil "$file"
+ done
+ else
+ echo "Macports' ImageMagick port was not installed with +debug variant."
+ fi
+ else
+ echo "not using MacPorts, skipping recreation of dSYMs included in app bundle."
+ fi
+
+ # for debug bundle, remove translations and tutorials (download size)
+ echo "Removing translation files and tutorials (only for debug builds) ..."
+ rm -rf "$pkglocale"/*
+ rm -f "${pkgshare}/${binary_name}/tutorials"/*
+
+else
+
+ # remove dSYM files if present (local port built with +debug variant from debug port group)
+ for item in $(find "${pkglib}/ImageMagick-${IMAGEMAGICKVER}" -name '*.dSYM'); do
+ rm -r "$item"
+ done
+
+fi
+
+
# All done.
#----------------------------------------------------------
echo "Inkscape.app created successfully."
diff --git a/packaging/macosx/osx-build.sh b/packaging/macosx/osx-build.sh
index 3d5e5b1de..d5e428a0c 100755
--- a/packaging/macosx/osx-build.sh
+++ b/packaging/macosx/osx-build.sh
@@ -53,6 +53,7 @@ Compilation script for Inkscape on Mac OS X.
\033[1mc,conf,configure\033[0m
configure the build (run configure). Edit your configuration
options in $0
+ \033[1m-g,--debug\033[0m compile with debug symbols and without optimization
\033[1m-p,--prefix\033[0m specify install prefix (configure step only)
\033[1mb,build\033[0m
build Inkscape (run make)
@@ -98,6 +99,7 @@ fi
BZRUPDATE="f"
AUTOGEN="f"
CONFIGURE="f"
+DEBUG_BUILD="f"
BUILD="f"
NJOBS=1
INSTALL="f"
@@ -130,6 +132,8 @@ do
AUTOGEN="t" ;;
c|conf|configure)
CONFIGURE="t" ;;
+ -g|--debug)
+ DEBUG_BUILD="t" ;;
b|build)
BUILD="t" ;;
-j|--jobs)
@@ -170,7 +174,7 @@ OSXPOINTNO="$(cut -d. -f3 <<< $OSXVERSION)"
ARCH="$(uname -a | awk '{print $NF;}')"
# MacPorts for dependencies
-[[ -x $LIBPREFIX/bin/port && -d $LIBPREFIX/etc/macports ]] && use_port="t"
+[[ -x $LIBPREFIX/bin/port && -d $LIBPREFIX/etc/macports ]] && export use_port="t"
# guess default build_arch (MacPorts)
if [ "$OSXMINORNO" -ge "6" ]; then
@@ -201,7 +205,11 @@ export CPATH="$LIBPREFIX/include"
export CPPFLAGS="$CPPFLAGS -I$LIBPREFIX/include"
export LDFLAGS="$LDFLAGS -L$LIBPREFIX/lib"
# compiler arguments
-export CFLAGS="$CFLAGS -Os"
+if [[ $DEBUG_BUILD == "t" ]]; then
+ export CFLAGS="-g -O0"
+else
+ export CFLAGS="-Os"
+fi
# Use system compiler and compiler flags which are known to work:
if [ "$OSXMINORNO" -le "4" ]; then
@@ -280,9 +288,14 @@ getinkscapeinfo () {
[ $? -ne 0 ] && INKVERSION="devel"
REVISION="$(bzr revno 2>/dev/null)"
[ $? -ne 0 ] && REVISION="" || REVISION="-r$REVISION"
+ BUILDNO=1
TARGETARCH="$_build_arch"
- NEWNAME="Inkscape-$INKVERSION$REVISION-$gtk_target-$TARGETVERSION-$TARGETARCH"
+ NEWNAME="Inkscape-$INKVERSION$REVISION-$BUILDNO-$gtk_target-$TARGETVERSION-$TARGETARCH"
+ while [ -e "Inkscape-$INKVERSION$REVISION-$BUILDNO-$gtk_target-$TARGETVERSION-$TARGETARCH".dmg ]; do
+ let BUILDNO=${BUILDNO}+1
+ NEWNAME="Inkscape-$INKVERSION$REVISION-$BUILDNO-$gtk_target-$TARGETVERSION-$TARGETARCH"
+ done
DMGFILE="$NEWNAME.dmg"
INFOFILE="$NEWNAME-info.txt"
@@ -304,6 +317,9 @@ checkversion () {
checkversion-port () {
if [[ "$use_port" == "t" ]]; then
PORTVER="$(port echo $1 and active 2>/dev/null | cut -d@ -f2 | cut -d_ -f1)"
+ if [ -z "$PORTVER" ]; then
+ PORTVER="$(port echo ${1}-devel and active 2>/dev/null | cut -d@ -f2 | cut -d_ -f1)"
+ fi
else
PORTVER=""
fi
@@ -331,7 +347,7 @@ checkversion-py-module () {
}
buildinfofile () {
- getinkscapeinfo
+ [ -z "$INFOFILE" ] && getinkscapeinfo
# Prepare information file
echo "Build information on $(date) for $(whoami):
For OS X Ver $TARGETNAME ($TARGETVERSION)
@@ -513,6 +529,10 @@ then
# TODO: fix this: it does not allow for spaces in the PATH under this form and cannot be quoted
fi
+ if [[ "$DEBUG_BUILD" = "t" ]]; then
+ export with_dSYM="true"
+ fi
+
# Create app bundle
./osx-app.sh $STRIP $VERBOSE -b $INSTALLPREFIX/bin/inkscape -p $BUILDPREFIX/Info.plist $PYTHON_MODULES
status=$?
@@ -520,9 +540,6 @@ then
echo -e "\nApplication bundle creation failed"
exit $status
fi
-
- # Prepare information file
- BUILD_INFO="t"
fi
if [[ "$DISTRIB" == "t" ]]
@@ -538,6 +555,11 @@ then
mv Inkscape.dmg $DMGFILE
+ if [[ "$DEBUG_BUILD" = "t" ]]; then
+ mv "$DMGFILE" "${NEWNAME}-debug.dmg"
+ ln -s "${NEWNAME}-debug.dmg" "$DMGFILE"
+ fi
+
# Prepare information file
BUILD_INFO="t"
fi