diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-02-15 01:17:27 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-02-15 02:32:41 -0800 |
commit | 61066b9ea941abbaa9b82f211eccb354a4d61d2a (patch) | |
tree | cf4925658c90cb69d66b0e5604f9b2018b9114ba /packaging/macosx/make-package.sh | |
parent | b472712162f5c998b9be2e4187151a97360fbedd (diff) | |
download | subsurface-61066b9ea941abbaa9b82f211eccb354a4d61d2a.tar.gz |
Update tools and instructions for building a signed Mac DMG
This updates the bundle to include the mime.cache and a library that
somehow isn't picked up by the bundle tool.
It also updates the README on how all this is supposed to work and puts
some of the automation into the existing shell script.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'packaging/macosx/make-package.sh')
-rwxr-xr-x | packaging/macosx/make-package.sh | 51 |
1 files changed, 43 insertions, 8 deletions
diff --git a/packaging/macosx/make-package.sh b/packaging/macosx/make-package.sh index 328e73454..81e0f80f8 100755 --- a/packaging/macosx/make-package.sh +++ b/packaging/macosx/make-package.sh @@ -1,20 +1,45 @@ #!/bin/bash # # this simply automates the steps to create a DMG we can ship +# # for this to work you need to have a custom build of MacPorts / gtk / etc # with prefix=/Applications/Subsurface.app/Contents/Resources # yes, that's a major hack, but otherwise gettext cannot seem to find # the gtk related .mo files and localization is only partial # -# run this from the packaging/macosx directory +# run this from the top subsurface directory + +# adjust to your install location of gtk-mac-bundler. I appear to need at +# least 0.7.2 +BUNDLER="../.local/bin/gtk-mac-bundler" +BUNDLER_SRC="${HOME}/gtk-mac-bundler" + +# install location of yourway-create-dmg +DMGCREATE="../yoursway-create-dmg/create-dmg" + +# This is the directory into which MacPorts, libdivecomputer and all the +# other components have been installed +PREFIX="/Applications/Subsurface.app/Contents/Resources" + +# maybe we want to update this to use the git tag magic instead. That +# would be more consistent +VERSION=`grep -1 CFBundleVersionString packaging/macosx/Info.plist | tail -1 | cut -d\> -f 2 | cut -d\< -f 1` -VERSION=`grep -1 CFBundleVersionString Info.plist | tail -1 | cut -d\> -f 2 | cut -d\< -f 1` -BUNDLER="../../../.local/bin/gtk-mac-bundler" +# gtk-mac-bundler allegedly supports signing by setting this environment +# variable, but this fails as we change the shared objects below and all +# the signatures become invalid. +# export APPLICATION_CERT="Dirk" -${BUNDLER} subsurface.bundle +# first clean up the staging area +rm -rf ./staging + +# now populate it with the bundle +${BUNDLER} packaging/macosx/subsurface.bundle + +# correct the paths and names cd staging/Subsurface.app/Contents for i in Resources/lib/gdk-pixbuf-2.0/2.10.0/loaders/* ; do - ~/gtk-mac-bundler/bundler/run-install-name-tool-change.sh $i /Applications/Subsurface.app/Contents/Resources Resources change ; + ${BUNDLER_SRC}/bundler/run-install-name-tool-change.sh $i ${PREFIX} Resources change ; done for i in Resources/lib/*.dylib; do @@ -22,8 +47,18 @@ do done cd ../../.. -if [ -f Subsurface-${VERSION}.dmg ]; then - mv Subsurface-${VERSION}.dmg Subsurface-${VERSION}.dmg.bak + +codesign -s Dirk ./staging/Subsurface.app/Contents/MacOS/subsurface \ + ./staging/Subsurface.app/Contents/MacOS/subsurface-bin + +if [ -f ./Subsurface-${VERSION}.dmg ]; then + rm ./Subsurface-${VERSION}.dmg.bak + mv ./Subsurface-${VERSION}.dmg ./Subsurface-${VERSION}.dmg.bak fi -hdiutil create -volname Subsurface -srcfolder staging Subsurface-${VERSION}.dmg + +${DMGCREATE} --background ./packaging/macosx/DMG-Background.png \ + --window-size 500 300 --icon-size 96 --volname Subsurface-${VERSION} \ + --app-drop-link 380 205 \ + --volicon ~/subsurface/packaging/macosx/Subsurface.icns \ + --icon "Subsurface" 110 205 ./Subsurface-${VERSION}.dmg ./staging |